Some time back I tried to get a Griffin Technology radioSHARK working in Linux, but ran into USB problems. Now Michael Rolig has gotten it to work. Read on for my experience and suggestions.
I was trying to use libusb, and had a lot of trouble writing to an interrupt endpoint.
It requires the latest libhid code from the Subversion repository. Once I had that built, the program worked fine, though it requires root privilege. I suppose you could install it setuid, or perhaps there’s a way to set up the hotplug system to make it available without privs.
The next hurdle was getting the actual sound out of it. The web page suggests that the radioSHARK only support 6400 samples per second, and gives directions for using ecasound to do live play with sample rate conversion. However, my experience is that the radioSHARK is perfectly happy to sample at 8000 or 32000 samples per second, or perhaps other rates.
I’ve never been able to get ecasound to build on a 64-bit platform. I figured out that I can use the ALSA arecord utility to record from it, and aplay to play the recording to my sound card or headset. This records half an hour from a local station:
sudo shark -fm 89.7 # KFJC - Los Altos Hills CA
arecord -d 1800 -c 2 -f S16 -r 32000 -D hw:1,0 foo.wav
Anything that can play .wav files should work with the result. On my system, I can play it with:
aplay -D hw:0,0 foo.wav
Of course, doing it that way doesn’t play it live. One way to do that is:
arecord -c 2 -f S16 -r 32000 -D hw:1,0 | aplay -D hw:0,0
Possibly a “tee” command could be put into the pipeline if you want to record and listen simultaneously.
Maybe JACK would make this stuff easier. JACK is another thing I haven’t yet got working.
If anyone wants it, I can put together Fedora Core 4 RPMs of the shark program and the required version of libhid.
Thanks to Michael for making the code available!