OP25 Audio Routing

Status
Not open for further replies.

ianew

Member
Joined
Aug 10, 2007
Messages
1
I've been able to set get OP25 up and running on a dedicated Linux machine using the instructions from the VM thread. I've tried to use the -O flag to route the output audio to a non-default sink but when I do I get Invalid Argument error when I use either a plughw or hw option. The app will run just fine with either no argument for -O, or "pulse" or "default" as arguments.

It does look like it is successfully finding audio devices, if I put in a non-existent sink, say 7,0 it will spit out a different "not found" error.

I opened up the p25_decoder.py file and noticed that there is a commented out line which sets the default output value to "plughw:0,0" maybe this is a known issue? I've done a bunch googling without any success. You guys all seem to have a lot more experience with this than I do. Any thoughts?

$ ./scope.py --args rtl=0 -N LNA:30 -f 460.50000e6 -S 2400000 -q 37 -v 10 -o 5000 -T trunk.tsv -O plughw:1,0
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.000.git-249-gef57ffcb

gr-osmosdr v0.1.4-72-g164a09fc (0.1.5git) gnuradio v3.7.10-1-ge55666b7
built-in source types: file osmosdr fcd rtl rtl_tcp uhd hackrf bladerf rfspace airspy redpitaya
Using device #0 Realtek RTL2838UHIDIR SN: 00000001
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
gain: name: LNA range: start 0 stop 0 step 0
setting gain LNA to 30
supported sample rates 250000-2560000 step 24000
[R82XX] PLL not locked!
set_center_freq: 460505000
Project 25 IMBE Encoder/Decoder Fixed-Point implementation
Developed by Pavel Yazev E-mail: pyazev@gmail.com
Version 1.0 (c) Copyright 2009
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; see the file ``LICENSE'' for details.
gr::log :INFO: audio source - Audio sink arch: alsa
gr::log :ERROR: audio_alsa_sink0 - [plughw:1,0]: snd_pcm_sw_params: Invalid argument
Traceback (most recent call last):
File "./scope.py", line 2751, in <module>
app = stdgui2.stdapp(p25_rx_block, "APCO P25 Receiver", 3)
File "/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/stdgui2.py", line 46, in __init__
wx.App.__init__ (self, redirect=False)
File "/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 7981, in __init__
self._BootstrapApp()
File "/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 7555, in _BootstrapApp
return _core_.PyApp__BootstrapApp(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/stdgui2.py", line 56, in OnInit
frame.top_block().start ()
File "/usr/local/lib/python2.7/dist-packages/gnuradio/gr/top_block.py", line 109, in start
top_block_start_unlocked(self._impl, max_noutput_items)
File "/usr/local/lib/python2.7/dist-packages/gnuradio/gr/runtime_swig.py", line 3668, in top_block_start_unlocked
return _runtime_swig.top_block_start_unlocked(*args, **kwargs)
RuntimeError: audio_alsa_sink"
 

n8whg

Newbie
Joined
May 22, 2010
Messages
1
I've been able to set get OP25 up and running on a dedicated Linux machine using the instructions from the VM thread. I've tried to use the -O flag to route the output audio to a non-default sink but when I do I get Invalid Argument error when I use either a plughw or hw option. The app will run just fine with either no argument for -O, or "pulse" or "default" as arguments.

It does look like it is successfully finding audio devices, if I put in a non-existent sink, say 7,0 it will spit out a different "not found" error.

I opened up the p25_decoder.py file and noticed that there is a commented out line which sets the default output value to "plughw:0,0" maybe this is a known issue? I've done a bunch googling without any success. You guys all seem to have a lot more experience with this than I do. Any thoughts?
I hit almost the same spot. I did try snd-aloop and trying jack to try and redirect the audio to a audio loopback with a hope of forwarding to Darkice and ultimately Icecast (or RR, etc...)

I'm using Ubuntu 14.04.5 and I suspect some conflict in audio drivers. Everything connects but there is no audio.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,339
Location
Talbot Co, MD
The issue is that gnuradio attempts to set up the period size and buffers based on certain assumptions, and a lot of the time the ALSA device cannot support those capabilities. (I spent some considerable time digging down in those weeds...)

You might try increasing the alsa device's prealloc buffer size:

sudo sh
cd /proc/asound/card0/pcm0p/sub0
echo 1024 > prealloc

Note: you might need to change the card0, pcm0p names to whatever is needed for your sound hardware.

Note2: "hw" devices usually don't support 8000hz sample rate required by OP25. Make sure you use the "plughw" variant which supports rate adaption.

Note3: after making the above changes create the file ~/.gnuradio/config.conf with the following contents:
[audio_alsa]
period_time = 0.015
nperiods = 16
 
Status
Not open for further replies.
Top