Thursday, 13 December 2012

Raspberry Pi usb sound into pure data- the Griffin Imic

After testing a few usb sound cards i settled on this one giving the best results for the bat-box project (and the set up described here is the one i used for this specific project)

 i used a 50 sec buffer size and the sound set at 2250hz. This seemed to work really well, i didn't really investigate getting the sound up to 44100hz,(i spent a day trying it with not much success) because 22.5kz is  stable, and good enough sound quality, obviously this is something to investigate more when not in the middle of getting a project going.

The imic is really stable when running, although there are a few random issues. 

the imic doesn't need setting through the terminal alsamixer each time when using pure-data extended, but the first time you use it (and if something goes wrong) do this…..

-open terminal
- and type in  (stuff between quotes, don't include quote marks when typing)


-f6 key lets you choose the card
-f5 lets you change the mic in , sound out ,treble and bass setting

press escape to leave the alsamixer

Pure-data extend generally flashes a red  warning as it boots up warning of a problem  with the audio,  "audio I/O error" -  ignore this as it doesn't stop or crash the audio.

the imic really likes the top usb-port, moving it from here can sometimes cause problems. If you're using more than two usb items (which you would do as you need a mouse and keyboard at least) invest in a usb powered hub -the best one i found was from the mod my pi website, remember as in all periphals working with the pi,  not all powered hubs are equal - some work better than others). 

The imic can go down if you're using too much power, for instance when using with an arduino, but once the program is optimised it will run with no problem each time. (-run without a gui , take bits out of the program to make it more efficient).A good indicator is the green cpu monitor in the corner of the pi, you want to leave a bit of a gap at the top so its not totally green, when it goes totally green thats when the sound card is in danger of going down.

Also with the imic you get one shot per boot, if it goes down it wont work again, if you close pure-data extended and don't reboot the next time you open pd-extended the imic wont work, so each time you close pd-extended you have to reboot in order to use it again.

Sometimes after p-d extended is started but before the pure-data patch is opened the imic decides to not work, the easy fix solution is just to restart the pi, and generally it works. If it carries on, re open alsamixer and reset the sound card…-this might help….
...... also turning the pi off for a day then coming back to it has weirdly worked a few times.

No comments: