Audio_alsa_sink problem


#1

When trying to use audio sink in GRC I get following error:

audio: using audio_alsa
audio_alsa_sink[hw:0,0]: set_period_time_near failed: Invalid argument
Traceback (most recent call last):
File “/home/gr/top_block.py”, line 45, in
tb = top_block()
File “/home/gr/top_block.py”, line 32, in init
self.audio_sink_0 = audio.sink(44100, “”, True)
File
“/usr/local/lib64/python2.5/site-packages/gnuradio/audio_alsa.py”,
line 307, in sink
return _audio_alsa.sink(*args, **kwargs)
RuntimeError: audio_alsa_sink

The audio test samples in gnuradio-examples/python/audio do work with
no problems.

I tried to google for further information, but found only the archive
of this mail list suggesting to search the net for the solution. Looks
like a recursive solution for me. :slight_smile:

I am new to gnuradio stuff so it may well be my ignorance causing
this, but I can not find any tutorials or manuals or documentation
especially for the GRC.

best regards,

arto


Arto Oksanen
removed_email_address@domain.invalid
Muurame, Finland


#2

On Sun, Mar 01, 2009 at 09:38:31PM +0200, Arto Oksanen wrote:

line 307, in sink
return _audio_alsa.sink(*args, **kwargs)
RuntimeError: audio_alsa_sink

The audio test samples in gnuradio-examples/python/audio do work with
no problems.

I tried to google for further information, but found only the archive
of this mail list suggesting to search the net for the solution. Looks
like a recursive solution for me. :slight_smile:

Thanks for searching first!

I am new to gnuradio stuff so it may well be my ignorance causing
this, but I can not find any tutorials or manuals or documentation
especially for the GRC.

I’ve seen the error before (but not on my h/w). Can you try using
plughw:0,0 instead of hw:0,0 and see if that changes anything?

Eric


#3

Using plughw:0,0 does not change anything. The error is the same.

arto

2009/3/1 Eric B. removed_email_address@domain.invalid:

File “/usr/local/lib64/python2.5/site-packages/gnuradio/audio_alsa.py”,
like a recursive solution for me. :slight_smile:
Eric


Arto Oksanen
removed_email_address@domain.invalid
Muurame, Finland


#4

im having the same problem
dial tone in GRC crashes with the same error
but the python dialtone example works fine
running svn trunk on ubuntu 8.10 64bit standard install with a
gigabyte ga-ep45-ud3r onboard audio…
if you figure it out let me know…
thanks…


#5

The audio sink in GRC has 3 parameters:
sample_rate, device_name, ok_to_block

The generated code looks like this:
audio.sink(sample_rate, device_name, ok_to_block)

If entering plughw:0,0 for the device_name does not fix the problem, I
am unsure about what is wrong… GRC generates the code, we can always
compare this to the code in a working example.

Is the GRC block missing an extra (4th) parameter to audio.sink?

-Josh


#6

putting plughw:0,0 in as the hardware name for the audio sink worked
for me, the default was blank…


#7

this is from the working dial_tone.py

dst = audio.sink (sample_rate, options.audio_output)

and this is from GRC generated code:

self.audio_sink_0 = audio.sink(44100, “plughw:0,0”, True)

For me it looks like the generated code has an extra parameter…

arto

2009/3/2 Josh B. removed_email_address@domain.invalid:

Is the GRC block missing an extra (4th) parameter to audio.sink?

if you figure it out let me know…

2009/3/1 Eric B. removed_email_address@domain.invalid:

File “/home/gr/top_block.py”, line 32, in init

I’ve seen the error before (but not on my h/w). Can you try using

removed_email_address@domain.invalid
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Discuss-gnuradio mailing list
removed_email_address@domain.invalid
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Arto Oksanen
removed_email_address@domain.invalid
Muurame, Finland


#8

I will add a note to the documentation in grc audio blocks about plughw.

Can you edit the generated code and test the following 2 combinations:

self.audio_sink_0 = audio.sink(44100, “plughw:0,0”, False)
self.audio_sink_0 = audio.sink(44100, “plughw:0,0”)

Let me know. -Josh


#9

What is needed IMHO is not extra documentation about GRC but to NOT USE
plughw or require it when it is not needed. For those of us with sound
cards like Delta or other many channeled things, this causes
unnecessary burden on the complexity.

Bob


#10

The grc dialtone flowgraph py would work ONLY if i changed BOTH

self.audio_sink_0 = audio.sink(44100, “hw:0,0”, True)
to
self.audio_sink_0 = audio.sink(32000, “plughw:0,0”, True)

and

self.samp_rate = samp_rate = 44100
to
self.samp_rate = samp_rate = 32000

not sure what to make of that…
looks like I was stumbling on 2 different things, device name syntax
and sample rate ( hardware limitation ? ) not sure…


#11

Neither did work, but changing the sample rate to 48000 did the trick.
Thanks davek!

arto

2009/3/2 Josh B. removed_email_address@domain.invalid:

arto

unsure about what is wrong… GRC generates the code, we can always

dial tone in GRC crashes with the same error

Using plughw:0,0 does not change anything. The error is the same.

audio_alsa_sink[hw:0,0]: set_period_time_near failed: Invalid
RuntimeError: audio_alsa_sink
Thanks for searching first!


Arto Oksanen
removed_email_address@domain.invalid
Muurame, Finland


#12

Hey Everyone,
This is very simple problem. Just check what your hardware
is. Mine is not hw:0,0 or plughw:0,0 it is hw:1,0. So, I just change
hw:1,0 whenever I use audio_alsa_sink block. I hope GNU Radio guys will
put this info in the audio_sink block documentation by next release.

Regards,
Ravi Sharan. B. A. G.,
A GNU Radio Enthusiast.


#13

got the same problem:

return _audio_alsa.sink(*args, **kwargs)
RuntimeError: audio_alsa_sink

I did a check on the processes running at that time…and found that the
sound card was being held by another process…probably the flash video
playing in my web browser…!!

killed the process and made the sampling rate to 48000…left the
device space blank…and finally, it worked…!!