|
From: Hans de G. <hde...@re...> - 2012-05-15 08:26:23
|
Hi, On 05/14/2012 11:45 PM, Deron wrote: > >>> My attempts at a custom frequency changing program will generate pops in the audio output when changing the frequency, but the audio is silent. The radio program (http://www.cs.fsu.edu/~baker/devices/lxr/http/source/xawtv-3.95/console/radio.c) seems to enable the radio as when it is started the audio goes from silent to static, but I get the error "VIDIOCGAUDIO: Invalid argument" twice to console and changing the frequency does not generate any change in audio output. No pop, no change to static. >> >> Ah, you're using an old version of xawtv which uses the no longer >> supported v4l1 API, there is a newer version here, hopefully its >> radio.c version will work better: >> http://git.linuxtv.org/xawtv3.git >> >> Regards, >> >> Hans >> > > I just used the URL as reference thinking it was the latest. I actually installed the program with apt-get install radio as I recall, and it seems to be old as well. Compiling the latest requires X11 which is a bit crazy for a server. I'm going to strip out the frequency change commands and see if I can get it to work... > > > ......... > > IT WORKS!!! Good! > > With the following (roughly) commands, I can make it work: > > nano /etc/modprobe.d/radio.conf > add: options radio-usb-si470x space=0 band=0 de=0 > > cd /sys/bus/usb/drivers/usbhid > echo '4-1:1.2' > unbind > modprobe radio-usb-si470x > cd /sys/bus/usb/drivers/radio-si470x > echo '0x12cf 0x7111' > new_id > > /dev/radio0 now exists and responds to proper commands. I can record with arecord -D "plughw:CARD=Radio,DEV=0" -f cd >audio.raw > > > So what can I do to make this permanent so as to survive resets of the server? I've attached a kernel patch, if you build a kernel with this patch you should no longer need the unbind and new_id magic. > Can I do anything to help get this added to future releases? Test the patch. > And Hans, I owe you an AlertFM device :-) Would it be of any use to you? I appreciate the offer, but I already have bought an si470x based usb radio stick myself, it should arrive at my home soon-ish. The reason I bought one is because of the poor state of userspace support for radio devices under Linux, which I hope to one day improve... What would be great (if you think it would be fun to do) would be if you could work on a decent userspace app for radios. IE something like gnome-radio ported to gnome/gtk3 and taught that most modern radio's don't have analog output, but that it needs to read the data from an alsa device and loopback it into another alsa device. For the alsa loopback part, see the code in the tv part of xawtv which already knows how to figure out which alsa node belongs to a v4l2 node, and how to loop back. Another project would be separating that code from the tv part of xawtv and also make the xawtv radio app use it :) If you want to donate me some hardware, I'm always looking for *old* usb webcams to complete my collection (which I've for testing purposes as I maintain a lot of usb webcam drivers). Chances are that whatever you've I already have, so if you've an old cam you consider donating, please first plug it in and do an lsusb, no use in shipping me a cam I already have, and I already have about a 100 different models :) Regards, Hans |