[alsa-devel] ASoC how to modify audio IC register values

Philip Balister philip at balister.org
Wed Sep 22 22:55:33 CEST 2010

On 09/21/2010 04:21 PM, Almohanad Fayez wrote:
> Hi,  I'm running Alsa on an embedded platform, Beagleboard, which uses an OMAP3530 chip.  The platform uses the TWL4030 ASoC driver. I'm trying to find a way to modify the audio rate register values to force sampling rates other than 44.1 kHz and 48 kHz.  I'm running the Angstrom Linux Distro on the board.  Alsa is running fine on the board, I'm trying to avoid using "hw:0,0" to make sure that I'm running the audio chip at the specified rate instead of having ALSA resample my audio.  Currently I can see that the audio card supports only 48 kHz and 44.1 kHZ, but I know that it supports 32kHz and 16kHz.  I managed to find the Codec_Register listing under the /sys/ directory and I'm trying to set the "codec_reg" register to the proper value to run the chip at 32kHz.  Basically when I run "cat
>    /sys/devices/platform/soc-audio/codec_reg" register 0x1 reads 0x91 which from the datasheet means the sampling rate = 44.1kHz.  I'm trying to set register 0x1 to 0x81 to force it to run at
>   32 kHz.  but the "echo 1 81>  codec_reg" command is apparently not supported and from the angstrom the register is read-only I even tried chmod +w the register but that didn't work.
> I tried using debugfs to modify the register value unfortunately  the functionality isn't available through that.  I found a few listings online of ALSA patches that expose the register during debugfs, after copying and pasting them I still couldn't access the register.  When I tried modifying the twl4030.c driver in the openembedded directory linux-omap-2.6.28/git/audio/soc/twl4030.c  by basically hardcoding the reigster value to 0x81 it still didn't work.
> I'm running the 2.6.28 Linux kernel.  can anyone share some advice ???

I'm interested in the solution also. I'm familiar with the work Al is 
doing and have never found a satisfactory solution. The basic problem is 
we are receiving samples of digitized RF containing an FM radio signal. 
Due to contraints on the sample rates of the RF hardware we end up with 
audio at odd rates (such as 32K). If you let libsamplerate fix the rate, 
we us more processor than we have available.

If anyone knows if the Beagle hardware can support different sample 
rates and how to add support to the ALSA driver, I'd love to hear 


More information about the Alsa-devel mailing list