Greetings !
This was posted on the arm.linux list.
----------------------------------------------------------------------------------------------
Hi,
Thanks to Russell King and Bill Danielson I was able to make the sound
work on the WebPal. For the most part the RPC driver is used with
minor changes:
1. The DMA IRQ needs to be enabled.
2. Only 44.1K data rate is supported by the hardware.
3. The codec needs data in "Japanese" format.
There is no mixer and no volume control. I planned to add rudimentary
volume control by adding a few instructions to the buffer filler
routine that would shift right the data (divide by n) before copying
to the DMA buffer, however I got pre-empted by a higher priority task.
So here is my patch as is.
To use it I do
/sbin/insmod soundcore.o
/sbin/insmod sound.o
/sbin/insmod vidc_mod.o
Then just write your sound data to /dev/dsp
I have manually added CONFIG_SOUND_VIDC into the .config file. It
should be added to the config.in in the drivers/sound directory.
Something like:
if [ "$CONFIG_ARM" = "y" ]; then
if [ "$CONFIG_ARCH_ACORN" = "y" -o "$CONFIG_ARCH_WEBPAL" = "y" ]; then
dep_tristate ' VIDC 16-bit sound' CONFIG_SOUND_VIDC $CONFIG_SOUND_OSS
fi
dep_tristate ' Netwinder WaveArtist' CONFIG_SOUND_WAVEARTIST $CONFIG_SOUND_OSS $CONFIG_ARCH_NETWINDER
fi
The only modifications is to the file "drivers/sound/vidc.c"
# diff drivers/sound/vidc.c drivers/sound/vidc.c.orig
201,211d200
< #if CONFIG_ARCH_WEBPAL
< /* Modification by Alex Freed.
< Only the 44.1K (approximately) is available
< The used codec demands the clock to be 256 times the data rate
< The clock happens to be 22.1184 MHz so we can get 43200 rate only
< */
<
< hwctrl = 2; // codec only works this way
< hwrate = 8; // written value must be 2
< rate = 43200;
< #else
229c218
< #endif
---
>
371,383d359
<
< #if CONFIG_ARCH_WEBPAL
< /* Modification by Alex Freed. Not sure it belongs in this place,
< but it works every time :))
<
< The format needs to be switched to "Japanise".
< The IRQ should really be enabled by configuring it autoenable.
< I did it this way so the module works with pre-built kernels.
< */
<
< iomd_writeb(2, IOMD_VIDMUX); // mode set
< enable_irq(IRQ_DMAS0); // enable IRQ
< #endif
Best regards,
Alex mailto:alex@mirrow.com
-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ/Etiquette: http://www.arm.linux.org.uk/armlinux/mailinglists.php