[alsa-devel] AudioArduino - an ALSA soundcard driver for FTDI-based Arduinos

Smilen Dimitrov sd at imi.aau.dk
Mon May 30 22:37:57 CEST 2011

Hi Sid,

> Are there any possibilities of extending it beyond 8-bit / 44.1 kHz?

The driver currently exposes a stereo, 16-bit, 44.1 kHz on the ALSA 
side, since that is the lowest quality with which Audacity works in the 
playback direction.

However, Arduino Duemillanove's ATMega328 is not really capable of 
16-bit reproduction in this context: it has one 16-bit and two 8-bit 
counters, and the 16-bit one is used to derive the 44.1 kHz (PCM) rate, 
so the only thing available for PWM (analog) reproduction are the 8-bit 
counters (there is a bit more on this in the paper on the webpage).

So what happens during stereo, 16-bit, 44.1 kHz playback, is that the 
driver simply extracts the MSB of the left channel, and sends it as an 
8-bit sample representation to the Arduino for PWM reproduction.

So in brief - as far as ALSA interfaces are concerned, I believe it is 
possible to specify any rate you want (which is supported) - however, 
"by default", it would be easy to only get 8-bit resolution (hardware) 
reproduction on the Arduino (however, higher rates should in principle 
be possible; as I think there should still some of bandwidth left, since 
a duplex operation can be demonstrated at 2Mbps).

Hope this helps,

> Regards
> Sid.

More information about the Alsa-devel mailing list