Usb Sound Input?


Is there a possible way now to connect some kind of a microphone to GP2X and use it to record voice?

Another ambitious feature, if this tool exist(s/ed), could it be modified to encode from another audio source?
 
A lot of these types of devices are supported by linux using a generic usb audio module. I don't know if usb audio has been compiled into the gp2x kernel. Probably not I'd say. It wouldn't be too hard to compile a new one though.

The major problem is that these devices are usually powered by the USB bus and require a USB host. The usually present themselves to the operating system as a standard USB soundcard. You would need a dev board and a few AC adaptors. Not very convenient.

But if someone did find an unpowered/self-powered USB audio input device and created a plug for the extension port (to get USB host) then you could potentially record any audio from any source you want. You could even encode on the fly into mp3/ogg/flac straight to the SD card.
 
I wonder how those codecs handle encoding... might be more processing power than the GP2X has without a fixed point encoder, which I doubt exists. It should certainly be possible to record raw .wav and then encode it after the fact.
 
swf posted on Aug 9 2006 at 04:58 AM said:
But if someone did find an unpowered/self-powered USB audio input device and created a plug for the extension port (to get USB host)


a powered usb hub could be used couldnt it ?
that would power the device and give usb host support
 
Last edited by a moderator:
a powered usb hub could be used couldnt it ?
that would power the device and give usb host support

Yes, that would work. It just wouldn't be very portable. All you would need is the usb sound module and some software to do the recording.

I have just received a dev board but I don't have any usb audio devices. If anyone can recommend a cheap device that works on linux desktops then I can look into this.
 
Thanks for that. I just got one for $45 (aussie dollars). It should be here in a few days. I should be getting another AC adaptor around then as well.

I haven't done any kernel work on the GP2X before but I have done a little on the desktop. Hopefully I will have something interesting to post this weekend.
 
BradN posted on Aug 8 2006 at 09:05 PM said:
I wonder how those codecs handle encoding... might be more processing power than the GP2X has without a fixed point encoder, which I doubt exists. It should certainly be possible to record raw .wav and then encode it after the fact.
That is interesting because the MMSP2 is a SoC designed for DVR boxes, it has full-on MPEG4 encode and decode.

I am guessing that the sound is not saved as a .wav when that happens. See my sig, I am not perfectly clear either, but the documents clearly state mpeg4 encode.
 
Last edited by a moderator:
Well, it haves a video encoder, but afaik none for sound.
And mp3 encodeing realy dosnt use much cpu, at lest medium quality should be quite possible, maybe it can also be done on the 940 to save resources on the 920.

Straight from the lame page:
"Fast! Encodes faster than real time on a PII 266 at highest quality mode."
Of course, a p2 haves a fpu, but medium quality should be feasible.
 
P2's have an FPU, and they're superscalar (can execute more than one instruction at a time, pipeline permitting).

I'd personally be surprised if you can encode realtime with existing software on the GP2X, but it should certainly be possible with the right encoder (either an optimized ARM fixed point encoder, or something using a hardware encoding ability of the MMSP2). You have to realize that LAME has core routines optimized in fpu/mmx and I think sse (though sse is of no consequence on a P2) assembly.
 
Off topic:
Mmm, I don't know if anyone has mentioned this before or not, but all I found were suggestions for H.D.D powered using either a rechargable battery or few AA/AAA batteries, has anyone thought of a BOB or a mod to the current BOB so it contains a battery compartment? I know it can have sufficient power from an AC adaptor, but I think it will be useful to design a casing for the developer version of BOB taking into consideration some space for the batteries.
 
I received the microphone and serial cable today. After plugging the mic into my linux laptop I can see that it is just a standard usb audio device (the snd-usb-audio module was loaded).

I've set up my dev board and connected it to my laptop through the serial cable but so far nothing has come through. I've never had much luck with serial before :( (but once I did managed to get multiplayer Doom 2 over serial working :) )

I've set it minicom using the instructions I have in the dev board:
  • 15200 bps
  • 8bit data bit
  • No parity bit
  • Stop bit 1bit
  • No flow control
And I've tried /dev/ttyS0, /dev/ttyS1 and /dev/ttyS2. So far no luck :( Maybe I'll have something for you guys on the weekend.
 
I'd recommend just using USB networking (with the USB2 port) and using ssh or telnet from there. Plus, you can copy files with scp or nfs/samba then...
 
Success! I have serial access to my gp2x and I have compiled the usb audio driver from the kernel source. I plugged the mic into the dev board and loaded the usb audio driver.

So it seems possible to get audio capture on the gp2x. Everything at the system level is available, we just need the capture/encoding software. If we could get rid of the dev board then that would be great.

Here's what happened when I loaded the driver (with the mic already plugged in to the dev board):
[root@gp2x sd]$insmod audio.o
Using audio.o
usb.c: registered new driver audio
usbaudio: device 5 audiocontrol interface 0 has 1 input and 0 output AudioStreaming interfaces
usbaudio: device 5 interface 1 altsetting 1 channels 1 framesize 2 configured
usbaudio: valid input sample rate 8000
usbaudio: valid input sample rate 48000
usbaudio: valid input sample rate 44100
usbaudio: valid input sample rate 22050
usbaudio: valid input sample rate 11025
usbaudio: device 5 interface 1 altsetting 1: format 0x00000010 sratelo 8000 sratehi 48000 attributes 0x01
usbaudio: registered dsp 14,19
usbaudio: warning: found 1 of 0 logical channels.
usbaudio: assuming the channel found is the master channel (got a Philips camera?). Should be fine.
usbaudio: registered mixer 14,16
audio.c: v1.0.0:USB Audio Class driver
The mic is presented as a normal sound card (dsp1):
[root@gp2x sd]$ls -l /dev/sound/
crw------- 1 root root 14, 3 Jan 1 00:00 dsp
crw------- 1 root root 14, 19 Jan 1 00:00 dsp1
crw------- 1 root root 14, 0 Jan 1 00:00 mixer
crw------- 1 root root 14, 16 Jan 1 00:00 mixer1

If I get some sound capture software working over the next few days I will be posting it to the dev board. I am moving house so don't expect much from me anytime soon.
 
hey this is really interesting .. i also have the usb audio module compiled for my gipiMIDI linux distro for the gp2x, but haven't really bothered testing it much .. should be fairly easy to hook up linuxsampler/sooperlooper from this point on .. ;)
 
sox can be compiled with oss device support for recording or playback - might be a good test program, if not particularly user friendly.
 
Back
Top