|
From: Deron <de...@pa...> - 2012-05-07 16:11:22
|
Hello, I hope this is an appropriate things to post here. I have an AlertFM usb radio that is "windows only" that I want to use on my Ubuntu server. The plan is to set it up to listen for EAS warnings on our local radio station. (We live a long way from civilization and don't always have the TV on). If I can get the audio stream, I can do the rest easy enough (I've got that part written and tested using recordings of EAS audio messages). Anyway, I have a windows computer and captured some channel changing data using their software, and digging around I found this software which actually recommends hidapi for HID devices. No problem, I have that installed along with libusb and I think I even have it changing channels (one report sets the channel, and another reads back the current channel. Still an input report I can't seem to grab which gives signal strength data etc, but I could live without that.) What I don't have now is the audio stream. I'm not very familiar with USB, so this is a really basic question, but what do I do to read that data? I'm guessing that hidapi won't be able to read that data, and somehow need to mix in calls with libusb? I've not had much luck finding sample applications for hidapi, and if someone could just nudge me in the correct direction I would appreciate it or even basic info on USB that would fluff out my knowledge without have to read an encyclopedia on USB. Thanks! Deron |
|
From: Peter S. <pe...@st...> - 2012-05-07 16:55:00
|
Hi! Deron wrote: > What I don't have now is the audio stream. I'm not very familiar with > USB, so this is a really basic question, but what do I do to read that > data? This is highly device-specific. The process is to reverse-engineer how the device communicates with the PC. You may have to learn a fair bit of USB details. > if someone could just nudge me in the correct direction I would > appreciate it or even basic info on USB that would fluff out my > knowledge without have to read an encyclopedia on USB. If you send the output of lsusb -v for the device to this list, we may be able to help you find the correct process. If you want, you can also check out my USB intro talk which goes into some light technical detail about the bus. Slides: http://events.ccc.de/congress/2010/Fahrplan/events/4234.en.html MPEG-4: http://mirror.fem-net.de/CCC/27C3/mp4-h264-HQ/27c3-4234-en-usb_and_libusb.mp4 Flash: http://youtu.be/uBBE2gihv5I And feel free to stop by #libusb on freenode for some live discussion. //Peter |
|
From: Deron <de...@pa...> - 2012-05-07 18:59:19
|
On 5/7/12 10:48 AM, Peter Stuge wrote:
> Hi!
>
> Deron wrote:
>> What I don't have now is the audio stream. I'm not very familiar with
>> USB, so this is a really basic question, but what do I do to read that
>> data?
> This is highly device-specific. The process is to reverse-engineer
> how the device communicates with the PC. You may have to learn a fair
> bit of USB details.
>
>
>> if someone could just nudge me in the correct direction I would
>> appreciate it or even basic info on USB that would fluff out my
>> knowledge without have to read an encyclopedia on USB.
> If you send the output of lsusb -v for the device to this list, we
> may be able to help you find the correct process.
This is what I get:
Bus 004 Device 002: ID 12cf:7111
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x12cf
idProduct 0x7111
bcdDevice 1.00
iManufacturer 1 Axentia Technologies AB
iProduct 2 ALERT FM Radio
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 145
bNumInterfaces 3
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 1 Audio
bInterfaceSubClass 1 Control Device
bInterfaceProtocol 0
iInterface 0
AudioControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 1 (HEADER)
bcdADC 1.00
wTotalLength 43
bInCollection 1
baInterfaceNr( 0) 1
AudioControl Interface Descriptor:
bLength 12
bDescriptorType 36
bDescriptorSubtype 2 (INPUT_TERMINAL)
bTerminalID 1
wTerminalType 0x0710 Radio Receiver
bAssocTerminal 0
bNrChannels 2
wChannelConfig 0x0003
Left Front (L)
Right Front (R)
iChannelNames 0
iTerminal 0
AudioControl Interface Descriptor:
bLength 13
bDescriptorType 36
bDescriptorSubtype 6 (FEATURE_UNIT)
bUnitID 2
bSourceID 1
bControlSize 2
bmaControls( 0) 0x01
bmaControls( 0) 0x00
Mute
bmaControls( 1) 0x00
bmaControls( 1) 0x00
bmaControls( 2) 0x00
bmaControls( 2) 0x00
iFeature 0
AudioControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (OUTPUT_TERMINAL)
bTerminalID 3
wTerminalType 0x0101 USB Streaming
bAssocTerminal 0
bSourceID 2
iTerminal 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 0
iInterface 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 1
bNumEndpoints 1
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 0
iInterface 0
AudioStreaming Interface Descriptor:
bLength 7
bDescriptorType 36
bDescriptorSubtype 1 (AS_GENERAL)
bTerminalLink 3
bDelay 0 frames
wFormatTag 1 PCM
AudioStreaming Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 2 (FORMAT_TYPE)
bFormatType 1 (FORMAT_TYPE_I)
bNrChannels 2
bSubframeSize 2
bBitResolution 16
bSamFreqType 1 Discrete
tSamFreq[ 0] 96000
Endpoint Descriptor:
bLength 9
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 1
bRefresh 0
bSynchAddress 0
AudioControl Endpoint Descriptor:
bLength 7
bDescriptorType 37
bDescriptorSubtype 1 (EP_GENERAL)
bmAttributes 0x00
bLockDelayUnits 2 Decoded PCM samples
wLockDelay 0 Decoded PCM samples
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 2
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.11
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 203
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 10
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
Device Status: 0x0000
(Bus Powered)
> If you want, you can also check out my USB intro talk which goes into
> some light technical detail about the bus.
Thanks! Just what I'm looking for!
>
> Slides: http://events.ccc.de/congress/2010/Fahrplan/events/4234.en.html
> MPEG-4: http://mirror.fem-net.de/CCC/27C3/mp4-h264-HQ/27c3-4234-en-usb_and_libusb.mp4
> Flash: http://youtu.be/uBBE2gihv5I
>
> And feel free to stop by #libusb on freenode for some live
> discussion.
Once I get a little better grip on this where I can ask more intelligent
questions, will. Thanks! If any of the above output points to something
I should be reading up on, please let me know. Also, here is a little of
the output from USBlyzer demo. Since they just keep coming, I presume
this is the actual audio data.
URB 1294-1233 16:06:21.806 2.415316 s 118.542 ms Isoch Transfer
3844 bytes data 80 DA 80 D9 00 D9 C0 D7... in 01:01:83 8AC78030h
USBPDO-2 usbhub 8481B768h Success (Success)
00000000 80 DA 80 D9 00 D9 C0 D7 40 D7 80 D6 00 D7 80 D7 ........@.......
00000010 80 D7 C0 D6 00 D7 C0 D6 00 D7 C0 D6 40 D6 00 D6 ............@...
00000020 80 D6 80 D5 00 D5 80 D3 80 D3 80 D3 00 D4 80 D3 ................
00000030 00 D3 80 D2 80 D3 00 D4 C0 D4 40 D5 40 D6 40 D7 ..........@.@.@.
00000040 80 D8 80 D9 C0 DA 40 DB 00 DC C0 DC 80 DD C0 DD ......@.........
00000050 80 DE 00 DF 00 E0 80 E0 00 E1 80 E1 C0 E1 00 E3 ................
00000060 80 E3 C0 E3 C0 E3 C0 E4 40 E5 C0 E5 80 E6 80 E6 ........@.......
...
Thanks again!
Deron
|
|
From: François R. <re...@fr...> - 2012-05-07 19:29:13
|
On 07/05/2012 20:58, Deron wrote: > bInterfaceClass 1 Audio > bInterfaceSubClass 1 Control Device [...] > bInterfaceClass 1 Audio > bInterfaceSubClass 2 Streaming [...] Those two interfaces are standard USB classes, meaning a generic usb audio driver should be able to handle it already. > bInterfaceClass 3 Human Interface Device > bInterfaceSubClass 0 No Subclass That's just the interface to control the parameters (like the tuner frequency) AFAIK. François. |
|
From: Deron <de...@pa...> - 2012-05-07 21:49:15
|
On 5/7/12 1:28 PM, François Revol wrote: > On 07/05/2012 20:58, Deron wrote: > > >> bInterfaceClass 1 Audio >> bInterfaceSubClass 1 Control Device > [...] >> bInterfaceClass 1 Audio >> bInterfaceSubClass 2 Streaming > [...] > > Those two interfaces are standard USB classes, meaning a generic usb > audio driver should be able to handle it already. > >> bInterfaceClass 3 Human Interface Device >> bInterfaceSubClass 0 No Subclass > That's just the interface to control the parameters (like the tuner > frequency) AFAIK. > > François. > Thanks for the info. What would be the easiest way to pull audio data from it then? Deron |
|
From: Peter S. <pe...@st...> - 2012-05-07 22:14:08
|
Deron wrote: > >> bInterfaceClass 1 Audio > >> bInterfaceSubClass 2 Streaming > > > > Those two interfaces are standard USB classes, meaning a generic > > usb audio driver should be able to handle it already. > > Thanks for the info. What would be the easiest way to pull audio > data from it then? What do you want to do with the audio data? You do not need to consider the fact that this is a USB device at all beyond the interaction with the HID class interface, the device appears as a sound card in your system. Try: cat /proc/asound/cards Run alsamixer or similar to set mixer controls, and an audio recording software to record audio. //Peter |
|
From: Deron <de...@pa...> - 2012-05-08 01:01:14
|
On 5/7/12 4:13 PM, Peter Stuge wrote:
> Deron wrote:
>>>> bInterfaceClass 1 Audio
>>>> bInterfaceSubClass 2 Streaming
>>> Those two interfaces are standard USB classes, meaning a generic
>>> usb audio driver should be able to handle it already.
>> Thanks for the info. What would be the easiest way to pull audio
>> data from it then?
> What do you want to do with the audio data?
>
> You do not need to consider the fact that this is a USB device at all
> beyond the interaction with the HID class interface, the device
> appears as a sound card in your system. Try:
>
> cat /proc/asound/cards
>
> Run alsamixer or similar to set mixer controls, and an audio
> recording software to record audio.
>
>
> //Peter
>
I guess I know less about Linux audio then I do USB!
Indeed, it shows:
1 [Radio ]: USB-Audio - ALERT FM Radio
Axentia Technologies AB ALERT FM Radio at
usb-0000:00:1a.1-1, full speed
I realize this may be beyond the knowledge of this list, but I'll
explain anyway. I'm just looking for the pcm audio stream (be it 16bit,
2 channel or whatever) so that my code can look for the audio tones that
precede the EAS (the Emergency Alert System used in Canada and the US to
broadcast severe weather warnings and other emergency notifications) and
act accordingly. So opening a device/pipe is perfectly acceptable.
Recording to disk and then checking it after the fact would be a bit
difficult, but I suppose the tools might let me pipe it to my
application(?).
I'm guessing I need to look into ALSA?
Deron
|
|
From: Peter S. <pe...@st...> - 2012-05-08 01:17:10
|
Deron wrote: > Indeed, it shows: > > 1 [Radio ]: USB-Audio - ALERT FM Radio > Axentia Technologies AB ALERT FM Radio at > usb-0000:00:1a.1-1, full speed > > I realize this may be beyond the knowledge of this list, but I'll > explain anyway. I'm just looking for the pcm audio stream (be it > 16bit, 2 channel or whatever) so that my code can look for the > audio tones that precede the EAS (the Emergency Alert System used > in Canada and the US to broadcast severe weather warnings and other > emergency notifications) and act accordingly. So opening a > device/pipe is perfectly acceptable. .. > I'm guessing I need to look into ALSA? Yes. You will find a large number of programs which work with audio input on Linux systems. A simple capture example is: http://equalarea.com/paul/alsa-audio.html#captureex Depending on what analysis you need to perform to match the emergency audio signature there may also exist many helpful tools and libraries already. Since it's radio I expect you'll want to have a bit of fuzz. //Peter |
|
From: Hans de G. <hde...@re...> - 2012-05-08 10:08:18
|
Hi,
On 05/07/2012 05:10 PM, Deron wrote:
> Hello,
>
> I hope this is an appropriate things to post here. I have an AlertFM usb
> radio that is "windows only" that I want to use on my Ubuntu server. The
> plan is to set it up to listen for EAS warnings on our local radio
> station. (We live a long way from civilization and don't always have the
> TV on). If I can get the audio stream, I can do the rest easy enough
> (I've got that part written and tested using recordings of EAS audio
> messages).
>
> Anyway, I have a windows computer and captured some channel changing
> data using their software, and digging around I found this software
> which actually recommends hidapi for HID devices. No problem, I have
> that installed along with libusb and I think I even have it changing
> channels (one report sets the channel, and another reads back the
> current channel. Still an input report I can't seem to grab which gives
> signal strength data etc, but I could live without that.)
>
> What I don't have now is the audio stream. I'm not very familiar with
> USB, so this is a really basic question, but what do I do to read that
> data? I'm guessing that hidapi won't be able to read that data, and
> somehow need to mix in calls with libusb? I've not had much luck finding
> sample applications for hidapi, and if someone could just nudge me in
> the correct direction I would appreciate it or even basic info on USB
> that would fluff out my knowledge without have to read an encyclopedia
> on USB.
I see that you've already gotten several useful replies further in the
thread. So it looks like getting the audio from the device is a solved
problem, which only leaves the tuning. Tuning normally is handled
by v4l2 kernel driver.
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...
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
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", then do:
5) "echo '2-1.5:1.2' > unbind"
Replacing 2-1.5:1.2 with the address string for your device
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 :|
10) "ls /dev/radio*"
If there is a radio device there things seem to be working!
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.
###
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.
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.
The way to do that now a days is to start windows inside a vm under Linux
and then redirect the usb device to the windows vm.
When you've the device working inside a windows vm, then:
-figure out on which usb bus the device sits (lsusb will tell you this)
-shutdown the windows vm
-unplug the device
-start wireshark as root and ignore the security warning, it is not really
relevant when using wireshark to monitor usb devices
-tell wireshark to record usb transfers on the bus the device was on
-re-plug in the device, this needs to happen after starting wireshark,
so that wireshark sees the usb device descriptors come past and can
thus automatically load the right protocol dissectors
-write down where in the log wireshark now is, as everything up till this
point was send by the standard linux hid and audio drivers
-start the vm and redirect the device to it
-write down where in the log wireshark now is, as everything up till this
was windows initialization which is likely not interesting
-start the windows radio app, look in the wireshrak log for any HID messages,
these are likely doing the tuning
-tune to a certain frequency if possible (ie no auto tuning, but pick a fixed freq.),
write down where in the log you are, and what frequency you tuned to
-tune to a another frequency if possible (ie no auto tuning, but pick a fixed freq.)
write down where in the log you are, and what frequency you tuned to
-stop the windows radio app
-stop wireshark capturing usb packets
-save the capture in wireshark!
And then you can go and try to figure things out from the capture. Note besides
a libusb developer I'm also a v4l2 developer and have reverse engineered quite
a few usb devices. This sounds like a fun little project and I would like to help,
which requires me getting my hands on such a device...
Regards,
Hans
|
|
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 |
|
From: Deron <de...@pa...> - 2012-05-13 16:02:06
|
On 5/12/12 10:57 PM, Hans de Goede wrote: > >> "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. > I was so hopeful! However, it made no difference. I even then tried setting space=0 and de=0, to no avail. 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. Thanks! Deron |
|
From: Chuck C. <cm...@ea...> - 2012-05-13 16:09:47
|
The chip that is being controlled is by SIlicaon labs http://www.silabs.com/pages/Silabs-Search.aspx?q=si470x On 05/13/2012 12:01 PM, Deron wrote: > On 5/12/12 10:57 PM, Hans de Goede wrote: >>> "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. >> > > I was so hopeful! However, it made no difference. I even then tried > setting space=0 and de=0, to no avail. > > 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. > > > Thanks! > > Deron > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > libusb-devel mailing list > lib...@li... > https://lists.sourceforge.net/lists/listinfo/libusb-devel > |
|
From: Hans de G. <hde...@re...> - 2012-05-14 08:16:09
|
Hi, On 05/13/2012 06:01 PM, Deron wrote: > On 5/12/12 10:57 PM, Hans de Goede wrote: >> >>> "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. >> > > > I was so hopeful! However, it made no difference. I even then tried setting space=0 and de=0, to no avail. > > 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 |
|
From: Deron <de...@pa...> - 2012-05-14 21:45:39
|
>> 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!!! 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? Can I do anything to help get this added to future releases? And Hans, I owe you an AlertFM device :-) Would it be of any use to you? The device also supports some new US EAS like system, but it is not in my area (yet?) so no idea what would be required to make that work. Just happy to have the radio working properly now! Deron |
|
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 |
|
From: Deron <de...@pa...> - 2012-05-13 04:30:12
|
On 5/8/12 3:55 AM, Hans de Goede wrote:
> Hi,
>
> On 05/07/2012 05:10 PM, Deron wrote:
>> Hello,
>>
>> I hope this is an appropriate things to post here. I have an AlertFM usb
>> radio that is "windows only" that I want to use on my Ubuntu server. The
>> plan is to set it up to listen for EAS warnings on our local radio
>> station. (We live a long way from civilization and don't always have the
>> TV on). If I can get the audio stream, I can do the rest easy enough
>> (I've got that part written and tested using recordings of EAS audio
>> messages).
>>
>> Anyway, I have a windows computer and captured some channel changing
>> data using their software, and digging around I found this software
>> which actually recommends hidapi for HID devices. No problem, I have
>> that installed along with libusb and I think I even have it changing
>> channels (one report sets the channel, and another reads back the
>> current channel. Still an input report I can't seem to grab which gives
>> signal strength data etc, but I could live without that.)
>>
>> What I don't have now is the audio stream. I'm not very familiar with
>> USB, so this is a really basic question, but what do I do to read that
>> data? I'm guessing that hidapi won't be able to read that data, and
>> somehow need to mix in calls with libusb? I've not had much luck finding
>> sample applications for hidapi, and if someone could just nudge me in
>> the correct direction I would appreciate it or even basic info on USB
>> that would fluff out my knowledge without have to read an encyclopedia
>> on USB.
>
> I see that you've already gotten several useful replies further in the
> thread. So it looks like getting the audio from the device is a solved
> problem, which only leaves the tuning. Tuning normally is handled
> by v4l2 kernel driver.
I'm not so sure. Using the ALSA command:
arecord -l
shows:
card 0: Intel [HDA Intel], device 0: ALC889 Analog [ALC889 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC889 Digital [ALC889 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 2: ALC889 Analog [ALC889 Analog]
Subdevices: 2/2
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
card 1: Radio [ALERT FM Radio], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
But
arecord -D "plughw:CARD=Radio" -f cd >audio.raw
Give me static. Ok, but a simple little program using hidapi appears to
set the freq, but all I get are "clicks" in the arecord output that
conincide with the attempts to change the frequency. I even tried
looping through all frequencies every ten seconds but no go.
>
> 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.
>
> ###
>
> 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. Here is the output from a Windows program. It was
something like USBalizer or some such. I cut out the repeating parts
(the "input report"). Frequency was 107.7 when I started the capture,
and then 107.7 -> 107.9 -> 87.5 -> 87.7.
Input Report id:18 len:13 12 02 05 FC 65 41 A5 3E 10 3E 9F
3C 08 repeating
Set Report (Feature id:4 len:3) 04 80 66
setting freq to 107.9
Get Report (Feature id:11 len:64) 0B 02 05
x9
Get Report (Feature id:11 len:64) 0B 02 01
x17
Input Report id:18 len:13 12 02 05 FC 65 41 A5 3E 10 3E 9F 3C
08 x1
(3rd element corrisponds to
RSSI in the Windows AlertFM interface) (5th element appears to
corrispond to BER in the Windows AlertFM interface)
Get Report (Feature id:11 len:64) 0B 02 01
x22
Get Report (Feature id:11 len:64) 0B 42 06
x1
Set Report (Feature id:4 len:3) 04 00 66
Get Report (Feature id:12 len:64) 0C FC 66
x1
Input Report id:18 len:13 12 02 04 FC 66 41 A5 3E 10 3E 9F 3C
08 repeating
Input Report id:18 len:13 12 02 05 FC 66 41 A5 3E 10 3E 9F 3C
08 repeating
Set Report (Feature id:4 len:3) 04 80 00
setting freq to 87.5 (it appears that the value they use is
(freq - 87.5) * 5 )
Get Report (Feature id:11 len:64) 0B 02 04
x
Input Report id:18 len:13 12 02 04 FC 66 41 A5 3E 10 3E 9F 3C 08
Get Report (Feature id:11 len:64) 0B 02 14
Input Report id:18 len:13 12 02 14 FC 00 41 A5 3E 10 3E 9F 3C 08
Get Report (Feature id:11 len:64) 0B 02 14
Set Report (Feature id:4 len:3) 04 00 00
Get Report (Feature id:12 len:64) 0C FC 00
Input Report id:18 len:13 12 02 15 FC 00 41 A5 3E 10 3E 9F 3C 08
Input Report id:18 len:13 12 02 13 FC 00 41 A5 3E 10 3E 9F 3C 08
Feature Report
02 0a 50
waiting...
Data read:
12 14 18 f8 00 42 3f d6 0c c7 c2 85 d9
Set Report (Feature id:4 len:3) 04 80 01
setting freq to 87.7
Get Report (Feature id:11 len:64) 0B 02 14
Get Report (Feature id:11 len:64) 0B 02 11
Input Report id:18 len:13 12 02 14 FC 00 41 A5 3E 10 3E 9F 3C 08
Get Report (Feature id:11 len:64) 0B 02 11
Set Report (Feature id:4 len:3) 04 00 01
Get Report (Feature id:12 len:64) 0C FC 01
Input Report id:18 len:13 12 02 11 FC 01 41 A5 3E 10 3E 9F 3C 08
Input Report id:18 len:13 12 12 10 FC 01 41 A5 3E 10 3E 9F 3C 08
I did not capture from the beginning to the end of startup etc. I can go
back and do that if helpful and post uncut results to a page somewhere
on one of my web sites.
Thanks for your great email!
Deron
>
> The way to do that now a days is to start windows inside a vm under Linux
> and then redirect the usb device to the windows vm.
>
> When you've the device working inside a windows vm, then:
> -figure out on which usb bus the device sits (lsusb will tell you this)
> -shutdown the windows vm
> -unplug the device
> -start wireshark as root and ignore the security warning, it is not
> really
> relevant when using wireshark to monitor usb devices
> -tell wireshark to record usb transfers on the bus the device was on
> -re-plug in the device, this needs to happen after starting wireshark,
> so that wireshark sees the usb device descriptors come past and can
> thus automatically load the right protocol dissectors
> -write down where in the log wireshark now is, as everything up till this
> point was send by the standard linux hid and audio drivers
> -start the vm and redirect the device to it
> -write down where in the log wireshark now is, as everything up till this
> was windows initialization which is likely not interesting
> -start the windows radio app, look in the wireshrak log for any HID
> messages,
> these are likely doing the tuning
> -tune to a certain frequency if possible (ie no auto tuning, but pick
> a fixed freq.),
> write down where in the log you are, and what frequency you tuned to
> -tune to a another frequency if possible (ie no auto tuning, but pick
> a fixed freq.)
> write down where in the log you are, and what frequency you tuned to
> -stop the windows radio app
> -stop wireshark capturing usb packets
> -save the capture in wireshark!
>
> And then you can go and try to figure things out from the capture.
> Note besides
> a libusb developer I'm also a v4l2 developer and have reverse
> engineered quite
> a few usb devices. This sounds like a fun little project and I would
> like to help,
> which requires me getting my hands on such a device...
>
> Regards,
>
> Hans
>
|
|
From: Vincent P. <plr...@gm...> - 2012-05-13 09:17:25
|
Le dimanche 13 mai 2012 06:29:44, Deron a écrit : > But > > arecord -D "plughw:CARD=Radio" -f cd >audio.raw > > Give me static. Ok, but a simple little program using hidapi appears to > set the freq, but all I get are "clicks" in the arecord output that > conincide with the attempts to change the frequency. I even tried > looping through all frequencies every ten seconds but no go. FWIW, I have a similar experience with a radio part on a PCI tv card. When I enable FM tuner and loop the card's audio dev to speakers, I get static-ish noise... Until I switch the FM off, at which point I get perfect audio until some buffer runs out of data (ie, half a second, by hear). I suspect there is a bug in some ring buffer access, where writing would overwrite not-read-yet data, or where updating write pointer would interfere with read pointer. But I'm not sure where to look. -- Vincent Pelletier |
|
From: Vincent P. <plr...@gm...> - 2012-05-13 12:31:21
|
Le dimanche 13 mai 2012 11:17:16, Vincent Pelletier a écrit : > Le dimanche 13 mai 2012 06:29:44, Deron a écrit : > > But > > > > arecord -D "plughw:CARD=Radio" -f cd >audio.raw > > > > Give me static. Ok, but a simple little program using hidapi appears to > > set the freq, but all I get are "clicks" in the arecord output that > > conincide with the attempts to change the frequency. I even tried > > looping through all frequencies every ten seconds but no go. > > FWIW, I have a similar experience with a radio part on a PCI tv card. When > I enable FM tuner and loop the card's audio dev to speakers, I get > static-ish noise... Until I switch the FM off, at which point I get > perfect audio until some buffer runs out of data (ie, half a second, by > hear). > I suspect there is a bug in some ring buffer access, where writing would > overwrite not-read-yet data, or where updating write pointer would > interfere with read pointer. But I'm not sure where to look. And I was wrong. The solution to this problem is to use "fm -T forever on" so "fm" keeps the device opened - otherwise, tuner is put to sleep but sound is not muted, resulting in static noise. -- Vincent Pelletier |