Monthly ArchiveJuly 2012
I’ve moved on to the official Raspbian release. This OS image using the hardware floating-point capabilities on board the RasPi and is noticeably faster than the Debian “squeeze” image was. It allows me to reboot when I’m powering the RasPi from my USB hub, something I couldn’t do before.
I’ve also tested a total of five different sound devices with Raspbian and ALSA for recording a mono microphone input. I’ve gotten one recording by fluke on a “Virtual 7.1 Ch Sound” device, and consistently get the claim that there is no capture device associated with the Behringer UCA202. The only device that has worked consistently for recording is a Syba “USB Stereo Sound Adapter” CMedia CM119. I didn’t pay more than $9 for any of the non-Behringer devices.
The CMedia is recognized, the controls come up appropriately in alsamixer, and arecord works without complaint on it. My only problem in simply going with this adapter is that I cannot reliably reboot my RasPi with it plugged into the USB hub. If it is plugged in on boot, the network interface throws “kevent 4″ errors. If the network is not plugged in, but the CMedia device is, ALSA throws a lot of errors at boot. Given that I want to deploy my RasPi remotely for a couple of weeks at a time, this sort of behavior doesn’t give me confidence. Things have improved since the earliest firmware I was using, but there seems to be a ways to go.
Syba SD-CM-UAUD USB Stereo Audio Adapter, C-Media Chipset, RoHS ($8.08 from Amazon)
The currently non-recording adapters:
Virtual 5.1-surround USB 2.0 External Sound Card ($1.78 from Amazon)
7.1 Channel USB External Sound Card Audio Adapter ($2.38 from Amazon)
Behringer UCA202 ($29.99 from Amazon)
Intermittently working adapter (I can’t say exactly how I managed to get one recording done with this):
Syba USB2.0 7.1CH Sound Adapter Add Stereo Output Mono Input Led ($3.28 from Amazon)<= get_option(\'vc_tag\') ?>> = get_option(\'vc_text_before\') ?> 20160 = get_option(\'vc_human_count_text_many\') ?> = get_option(\'vc_preposition\') ?> 6404 = get_option(\'vc_human_viewers_text_many\') ?> = get_option(\'vc_tag\') ?>>
Well, I spent my Saturday morning programming a C# application for Windows Mobile 5 to periodically record audio.
I was aiming to set up a data logger using the Raspberry Pi board I’ve got, but I’ve run into enough problems that I decided to look at another approach.
The idea is to log acoustic data underwater to get snapping shrimp snaps. Snapping shrimp are small crustacean predators who use a specialized claw to generate cavitation events that stun or kill their prey. Cavitation events are loud, and snapping shrimp populations are large, so a major component of the acoustic background in tropical to semi-tropical waters where there is structure is snapping shrimp snaps. These various elements come together to make snapping shrimp an excellent indicator species. The acoustic record can be used as an indicator of population health for snapping shrimp, and since snapping shrimp are metazoan predators, they indicate the health of the ecosystem.
The state of Florida has a Harmful Algal Bloom (HAB) program where monitoring stations are scattered around places. The stations have power, some have internet, and there’s space for more instruments to be loaded aboard. The regular schedule of sampling of other instruments is four times an hour. So I’m looking to sample one minute of acoustic data on each quarter hour, so my data can be correlated with the data generated by the other instruments.
The Raspberry Pi looked pretty promising as a data logging platform. It comes with an SD card slot, has an Ethernet port, and allows expansion via USB. There are three things that are holding me back on that: stable power, USB audio compatibility, and time synchronization. Getting the RasPi to power on from a cold start is a piece of cake. Getting it to reboot with “sudo shutdown -r now” is not reliable. This is likely a power interaction between my power source(s) (I’ve tried three so far) and the USB hub(s) (I’ve tried two so far). The recommended low-cost USB audio interface for Linux is a Behringer UCA202. ALSA on the RasPi, though, doesn’t think it has a capture device. The RasPi doesn’t have an RTC. This isn’t a problem with an Ethernet connection to the internet, but it is a problem if there is no connection when the RasPi boots. I’ve tried setting up GPSD with NTP to fill in when there is no network connection, but with negative results so far.
That brings me to my alternative plan. Back in 2005, Diane and I had to hurriedly design an autonomous acoustic recording system with COTS parts in order to deploy in three weeks for a field season in Wyoming. We settled on using Pocket PC devices with Core Audio’s PDAudio sound cards and A/D devices. I rigged regulated power supplies that ran off motorcycle batteries so that each unit only had to be serviced every couple of days to swap batteries and memory cards.
Since I’ve gotten my Android phone, I haven’t been using my Dell Axim X50v PDA much. I’ve done ad hoc recordings with the X50v before dropping a hydrophone over a seawall or overpass, and it’s done OK. So I started looking at audio programming for Windows Mobile devices. It was a bit tougher than it strictly needed to be. The declining market share for Windows CE/Pocket PC/Windows Mobile means that application development goes through Visual Studio 2008, not the latest development tools. (I did install SharpDevelop, but dropped that for VS2008). Audio support for Windows Mobile looks pretty minimal. There’s an interface based on the Platform Invoke Library (PIL) provided by Microsoft, and there’s the OpenNETCF library that wraps the PIL. I tried OpenNETCF because it looked simpler to implement, but I ended up with memory leaks. Using PIL directly gave me success this morning, and now I’m just letting the application record one minute of audio every five minutes as a test. The system memory report under Settings is showing stable usage of memory so far. I’m aiming to deploy the system where it will only be serviced every two weeks, so I really need to watch out for long-term problems. So far, though, it looks like I should be able to finish up with power supply issues and the acoustic gear side of things and get it installed by the time the next HAB station gets deployed. And it fits on the budget I’ve got, which is pretty close to nothing at all.
I spoke a little too soon. While the periodic recording bit seems stable and I appear to have quashed memory leaks, I think I’ve got a hardware issue. I had listened to a couple of recordings that actually picked up the signal I was providing on line-in. I checked some more, and found that at some point the X50v went back to recording from its built-in microphone. That, of course, does me no good. I have tried two different cables with the same result. Usually, switching with a plug is simply a matter of physical displacement; if the plug is in, the alternative input makes no connection to the system. I’m not sure how it goes with the X50v, but I’ll probably have to disassemble it to find out.<= get_option(\'vc_tag\') ?>> = get_option(\'vc_text_before\') ?> 19811 = get_option(\'vc_human_count_text_many\') ?> = get_option(\'vc_preposition\') ?> 5232 = get_option(\'vc_human_viewers_text_many\') ?> = get_option(\'vc_tag\') ?>>