|
From: Hans de G. <hde...@re...> - 2012-05-13 04:53:18
|
Hi, <snip snip> On 05/13/2012 06:29 AM, Deron wrote: > On 5/8/12 3:55 AM, Hans de Goede wrote: >> Chances are that your device is using the si470x chipset, as that uses >> a usb-audio class interface for the audio and a hid interface for >> tuning... > > I took it apart awhile ago, and it is using an si part, but I don't recall that being the number. I'll have to find my notes... > > Ok, best as I can see here are the number from the si chip is: > > silabs > f321 > ecnab3 > o741+ > >> To test this you would need to do the following (as root): >> >> 1) plug in the device >> 2) do dmesg, you should see something like this in there: >> usb 2-1.5: New USB device found, idVendor=12cf, idProduct=7111 > > Not exactly what I get. I get: > > [ 6.940474] generic-usb 0003:12CF:7111.0001: hiddev0,hidraw0: USB HID v1.11 Device [Axentia Technologies AB ALERT FM Radio] on usb-0000:00:1a.1-1/input2 > [ 6.940494] usbcore: registered new interface driver usbhid > [ 6.940496] usbhid: USB HID core driver > > >> Note the 2-1.5 >> 3) "cd /sys/bus/usb/drivers/usbhid" >> 4) "ls" >> You should see a symlink in there starting with the same prefix as in the >> dmesg, followed by :1.2, ie: "2-1.5:1.2", > > Ok, I see: > > 9-4.1:1.0 > 9-4.4:1.0 > 4-1:1.2 <- second time around I see this! > > Which I can't correlate to any of the dmesg output. They link to: > > ../../../../devices/pci0000:00/0000:00:02.0/0000:0e:00.0/usb9/9-4/9-4.1/9-4.1:1.0 > ../../../../devices/pci0000:00/0000:00:02.0/0000:0e:00.0/usb9/9-4/9-4.4/9-4.4:1.0 > > And appear to be the mouse and keyboard. > >> then do: >> 5) "echo '2-1.5:1.2' > unbind" >> Replacing 2-1.5:1.2 with the address string for your device > > Just for kicks, I went ahead and unbound the two devices. > >> 6) "modprobe radio-usb-si470x" >> 7) "cd /sys/bus/usb/drivers/radio-si470x" >> 8) "echo '0x12cf 0x7111' > new_id" >> 9) ls, now the 2-1.5:1.2 like string should be there, if not >> see "dmesg" for errors :| > > Well, I now see 4-1:1.2 -> ../../../../devices/pci0000:00/0000:00:1a.1/usb4/4-1/4-1:1.2 > >> 10) "ls /dev/radio*" >> If there is a radio device there things seem to be working! > > And I now see /dev/radio0 > >> >> Now start a program recording / looping back sound from >> the alsa device for the usb-stick, and then start a radio >> tuning program, for example the very simple "radio" app >> from xawtv. > > "radio" appears to get a little further along. It actual seems to enable the radio in so much as when it is running, I get what seems like real radio static as to the just near silence I get otherwise. But I don't get any change in the output no matter the frequency tuned. > Ok, good, looking in: drivers/media/radio/si470x/radio-si470x-common.c I see the following module parameters: /* Spacing (kHz) */ /* 0: 200 kHz (USA, Australia) */ /* 1: 100 kHz (Europe, Japan) */ /* 2: 50 kHz */ static unsigned short space = 2; module_param(space, ushort, 0444); MODULE_PARM_DESC(space, "Spacing: 0=200kHz 1=100kHz *2=50kHz*"); /* Bottom of Band (MHz) */ /* 0: 87.5 - 108 MHz (USA, Europe)*/ /* 1: 76 - 108 MHz (Japan wide band) */ /* 2: 76 - 90 MHz (Japan) */ static unsigned short band = 1; module_param(band, ushort, 0444); MODULE_PARM_DESC(band, "Band: 0=87.5..108MHz *1=76..108MHz* 2=76..90MHz"); /* De-emphasis */ /* 0: 75 us (USA) */ /* 1: 50 us (Europe, Australia, Japan) */ static unsigned short de = 1; module_param(de, ushort, 0444); MODULE_PARM_DESC(de, "De-emphasis: 0=75us *1=50us*"); /* Tune timeout */ static unsigned int tune_timeout = 3000; module_param(tune_timeout, uint, 0644); MODULE_PARM_DESC(tune_timeout, "Tune timeout: *3000*"); /* Seek timeout */ static unsigned int seek_timeout = 5000; module_param(seek_timeout, uint, 0644); MODULE_PARM_DESC(seek_timeout, "Seek timeout: *5000*"); Especially the band parameter looks interesting, as according to your commented usb dumps your device has a bottom of 87.5 Mhz, were the driver defaults to 76 Mhz, so if you tuned to a known to work station in radio, you actually didn't because of this setting being wrong, edit /etc/modprobe.d/radio.conf And put the following there: options radio-usb-si470x band=0 Then do: rmmod radio-usb-si470x modprobe radio-usb-si470x And redo the driver binding, now tune to a radio station you know to work (from testing in windows for example) using radio, and hopefully things will work then. >> >> ### >> >> If the above does not work, it looks like you do need to write >> some software to drive the device yourself after all. IMHO the end >> result of this project would be to write a v4l2 kernel driver. > > No problem. I'm happy to do what I can. > >> >> For starters we can write a little libusb program, but once we've >> put in that effort why not go all the way and make it usable as a >> normal/standard radio device under Linux? >> >> The first step would be to catch some USB-traces of windows setting >> the frequency, or iow windows doing some tuning to a radio station. > > I have some of that, and maybe this will tell you at a glance if it should be compatible. I'm not that familiar with the si470x driver, lets first give the above a try before we dive into the USB dumps. A quick look at the si470x driver does show that it is doing various sanity check though, so if your device is not an actual si470x, it is very close. Regards, Hans |