Forum: GNU Radio audio_alsa_sink problem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Arto Oksanen (Guest)
on 2009-03-01 21:40
(Received via mailing list)
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 <module>
    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. :-)

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
Eric B. (Guest)
on 2009-03-01 23:05
(Received via mailing list)
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. :-)

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
Arto Oksanen (Guest)
on 2009-03-01 23:31
(Received via mailing list)
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. :-)
> Eric
>



--
Arto Oksanen
removed_email_address@domain.invalid
Muurame, Finland
davek (Guest)
on 2009-03-02 00:57
(Received via mailing list)
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..
Josh B. (Guest)
on 2009-03-02 02:49
(Received via mailing list)
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
davek (Guest)
on 2009-03-02 06:24
(Received via mailing list)
putting plughw:0,0 in as the hardware name for the audio sink worked
for me, the default was blank...
Arto Oksanen (Guest)
on 2009-03-02 07:54
(Received via mailing list)
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
Josh B. (Guest)
on 2009-03-02 09:04
(Received via mailing list)
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
Bob McGwier (Guest)
on 2009-03-02 09:10
(Received via mailing list)
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
davek (Guest)
on 2009-03-02 09:36
(Received via mailing list)
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...
Arto Oksanen (Guest)
on 2009-03-02 17:11
(Received via mailing list)
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
Anubhav S. (Guest)
on 2012-08-10 23:32
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..!!
Ravi Sharan B. (Guest)
on 2012-08-26 07:44
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.
This topic is locked and can not be replied to.