LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-17-2018, 01:11 PM   #1
jimbolaya
LQ Newbie
 
Registered: Oct 2013
Posts: 14

Rep: Reputation: Disabled
gnomeradio and snd_pcm_recover underrun/overrun occurred


I've got an FM radio stick and I've found the only thing I can use to get it to run is gnomeradio.

Mplayer says "MPlayer was compiled without Radio interface support." and I can't get kradio4 to put out any sound, though it records fine.

Gnomeradio uses alsa loopback to get the sound from the card to the speakers. It kinda works, but I ran into this problem but after a little while, I get underrun/overrun occurred messages at random intervals:

Code:
ALSA lib pcm.c:7843:(snd_pcm_recover) overrun occurred
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7843:(snd_pcm_recover) overrun occurred
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
I've done some testing like increasing the alsa buffer size, but that only delays the issue.

I'm hoping I can get this to work without a lot of extra work, like recompiling mplayer.
 
Old 05-18-2018, 04:54 PM   #2
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 3,602
Blog Entries: 1

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
Code:
rtl_fm -f 93.3e6 -M wbfm -s 176400 -d 0 -g 36.4 \
           -l 0 -o 2 -p 0 -E deemp -r 44100 -t 5 -F off -A fast - | \
    sox -t raw -c 1 -r 44100 -e signed -b 16 --endian little -q -V0 - \
        -t wav -c 2 -r 44100 - | \
    mpv --ao=pulse -
What I use as the alarm part of a bash script that launches it. And a variant that runs through various local stations:

Code:
for CHANNEL in 89.5 90.5 91.3 92.1 93.3 93.7 94.7 95.5 96.7 98.1 98.9 99.3 99.9 100.7 101.5 101.9 102.3 104.3 105.5 106.3; do echo "========== "$CHANNEL" =========="; rtl_fm -f "$CHANNEL"e6 -M wbfm -s 176400 -d 0 -g 14.4 -l 0 -o 2 -p 0 -E deemp -r 44100 -t 5 -F off -A fast - |     sox -t raw -c 1 -r 44100 -e signed -b 16 --endian little -q -V0 - -t wav -c 2 -r 44100 - |     mpv --ao=pulse -; done
With the adafruit freqshow python thing to find said stations. Using GRC directly is still a bit too much effort IMO. If all you're doing is listenting to FM radio, then rtl_fm from package rtl-sdr is good enough. Albeit MONO, not stereo radio.
 
Old 05-18-2018, 05:06 PM   #3
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 3,602
Blog Entries: 1

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
The freqshow thing is intended more towards embedded devices so you might have to run it in a reduced resolution state. It's flakey if your pixels are > 1020x1020. I accomplish that with Xephyr on my 1920x1080 screen.

$ Xephyr :1 -screen 800x600 &
$ xterm -display :1 &

Select the term now in the window.

$ cd $HOME/linux/rtlsdr/FreqShow/
$ python freqshow.py
$ cd $HOME/

How I do that thing in my case. Plus some code editing for mouse versus touch responsiveness outlined in several forums. The path is unique to me and where I installed the freqshow.py script(s).
 
Old 05-19-2018, 11:39 AM   #4
jimbolaya
LQ Newbie
 
Registered: Oct 2013
Posts: 14

Original Poster
Rep: Reputation: Disabled
It's not a rtl device. It's a v4l device.

Thanks for the reply though.
 
Old 05-19-2018, 04:32 PM   #5
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 3,602
Blog Entries: 1

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
The only v4l device I've had with that was PCI and used the cd-audio cable for the FM audio. Is this a USB device at all? PCI? PCIe? Software defined? or hardware only?
 
Old 05-19-2018, 06:56 PM   #6
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 3,602
Blog Entries: 1

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
What does this say:

$ v4l2-ctl --info
 
Old 05-21-2018, 09:26 AM   #7
jimbolaya
LQ Newbie
 
Registered: Oct 2013
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Shadow_7 View Post
The only v4l device I've had with that was PCI and used the cd-audio cable for the FM audio. Is this a USB device at all? PCI? PCIe? Software defined? or hardware only?
I'm quite sure it's a v4l device. I can post a picture of it if you like. Here's the relavent dmesg:
Code:
[1108568.280647] usb 3-2.2: new full-speed USB device number 21 using xhci_hcd
[1108568.386737] usb 3-2.2: New USB device found, idVendor=10c4, idProduct=818a
[1108568.386742] usb 3-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[1108568.386744] usb 3-2.2: Product: FM Radio
[1108568.386746] usb 3-2.2: Manufacturer: SILICON LABORATORIES INC.
[1108568.386934] usb 3-2.2: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
[1108568.389265] radio-si470x 3-2.2:1.2: DeviceID=0x1242 ChipID=0x0409
[1108568.389268] radio-si470x 3-2.2:1.2: This driver is known to work with firmware version 12,
[1108568.389270] radio-si470x 3-2.2:1.2: but the device has firmware version 9.
[1108568.389676] radio-si470x 3-2.2:1.2: software version 0, hardware version 6
[1108568.389678] radio-si470x 3-2.2:1.2: If you have some trouble using this driver,
[1108568.389680] radio-si470x 3-2.2:1.2: please report to V4L ML at linux-media@vger.kernel.org

Quote:
Originally Posted by Shadow_7 View Post
What does this say:

$ v4l2-ctl --info
This only lists my WebcamStudio driver and not the above mentioned FM Radio. It may be this is only a v4l1 capable device.

However, this isn't really a question about v4l or v4l2. It's more a question about routing audio without buffer overruns/underruns.
 
Old 05-21-2018, 11:27 AM   #8
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,385

Rep: Reputation: 979Reputation: 979Reputation: 979Reputation: 979Reputation: 979Reputation: 979Reputation: 979Reputation: 979
Sometimes it's tricky to get the buffer just the right size. I've had it where I needed 100x the recommended maximum size for the buffer. If mplayer configured without radio support, it's because there were missing libraries on the system. If you reconfigure it now it will probably work.
 
Old 05-24-2018, 06:08 AM   #9
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 3,602
Blog Entries: 1

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
For the vender:device of 10c4:818a I came up with a few links.

https://usb-ids.gowdy.us/read/UD/10c4/818a?sort=name

https://cateee.net/lkddb/web-lkddb/USB_SI470X.html

Special documentation in the kernel source tree:

./Documentation/video4linux/si470x.txt

Listed under video4linux, so yeah, it's v4l. v4l2 should be backwards compatible (I thought). Special sound "routing" instructions for that device.

modules: radio-si470x, radio-usb-si470x

https://github.com/spotify/linux/blo...nux/si470x.txt

Some dated info there (OSS and dsp routing). But informative. Modern options are probably aconnect -ish.

$ aconnect -lo -li

Should list input and output things that can be "connected" with alsa. Kind of like one would do with qjackctl or jack_connect (CLI option) for jack. I couldn't get much done with kradio4 for my radio dongle. It seemed like it was meant more for internet radio streaming, versus using your hardware radio.

Oversampling is common for radio dongles. *2 the output rate for decent quality, and *2 again for stereo. Not sure if the broadcast favors 44.1kHz or 48kHz (probably 44.1kHz aka CD quality / audio). I use 176400 as my sample rate (for rtl_fm).

$ echo $(( 44100 * 4 ))
176400
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Freezing video/ERROR pipe A+B underrun+CPU pipe FIFO underrun Linux Noobie Linux - Kernel 1 03-28-2016 02:51 PM
ttyS0: 1 input overrun(s) rajes4india Linux - Software 3 08-01-2012 08:31 AM
ttyS0: 1 input overrun(s) tovis Programming 2 02-03-2007 04:12 PM
Buffer Overrun? gnashley Slackware 0 07-28-2004 04:12 PM
Gnomeradio - Could not start lirc liguorir Linux - Software 0 08-07-2003 08:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration