I-Appliance BBS
The Official Source for Internet Appliance Upgrades and Mods

Click Here!
BBS Main List | Sign In | Sign Up | Search | Help | Linux-Hacker.netReply to Thread | Printer |

Home / Other I-Appliances / WebPal
Repost ->WebPal sound driver works

New MessageRepost ->WebPal sound driver works (modified 0 times) Ifaistos
Profile
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

01-07-2003 06:57:21

New MessageRE:Repost ->WebPal sound driver works (modified 0 times) justdavesj
Profile | Email
I've been trying to get the sound to work. Using cat file > /dev/dsp seems to work. I can hear the music but there is a lot of static. I am using amplified speakers connected to the rca jacks. I tried unamplified speakers but got the same result only quieter.

Has anyone had this problem?

dave

03-11-2003 14:47:39

New MessageRE:Repost ->WebPal sound driver works (modified 0 times) n1gp
Profile
I did some playing around with the sound today. Seems I can only play
44.1khz PCM MONO 8-BIT files. Unless I converted files to this format
they would not play correctly.

I think we could go into the vidc driver and look at the wav info, if
it is say a 22khz format we could just do 2 writes of the same data before
it gets shifted. That type of game. Not sure why we're limited to 8 bit
and mono at that.

03-15-2003 07:48:22

New MessageRE:Repost ->WebPal sound driver works (modified 0 times) justdavesj
Profile | Email
You are right. When I run the wav files through sox with the 43200hz and c1 it plays wonderfully. I did take a look at the driver for a minute and the fix was not evident. The mp3 players that I have tried (mpg123 and mad) do not work. mpg compiles fine but gives a seg fault when I run it. madplay compiles and runs but produces two clicks on the speakers and no audio.

dave

03-23-2003 20:50:30

New MessageRE:Repost ->WebPal sound driver works (modified 0 times) mrhim
Profile
The sound does indeed work. wav files play just fine. madplay is ... interesting. It doesn't seem like the CLPS7500 has the juice to decode an mp3, at least not via libmad. It's pretty much unidentifiable noise with the occasional recognizable bit of sound. Saying that it's "choppy" would be putting it mildly :). Out of curiosity I recompiled busybox w/ top and, sure enough, madplay has the cpu pegged balls to the wall.

mpg123-0.59r wouldn't even compile (via make generic); it kept bitching about a few undefined functions ... it looks like some #ifdef NOXFERMEM statements are missing from common.c (and others) but I'm too lazy to bother with it right now. And, given that the box is using fpu emulation, I'd be suprised if it performed better than mad.

Has anyone else tried any other mp3 decoding libs/players ?


Dave

P.S. I did spend an hour and ported portmap to a busybox "applet". If anyone's interested in it, I'll throw together a patch.


--
MrHim
05-23-2003 16:05:03

New MessageRE:Repost ->WebPal sound driver works (modified 0 times) n1gp
Profile
Saw this site and thought of this thread. Looks like they used
an app called "aud" to convert from mp3 to wav and then used "tplay"
to play the file. Perhaps this is workable for the Webpal?

Rick


http://www.cs.tut.fi/~ik/tplay.html

http://www.cs.tut.fi/~ik/tplay/screenshot.jpg

06-11-2003 18:45:14

New MessageRE:Repost ->WebPal sound driver works (modified 0 times) justdavesj
Profile | Email
I'm starting work on the sound again. I have madplay running but only get a click from the speakers. Has anyone had any other success with the sound?

dave

10-31-2003 17:15:54

Reply to Thread | Printer |
All times are PSTPowered by UltraBoard v1.62



Copyright © 2000, Netmake Inc. All Rights Reserved.
See Terms and Conditions for more information.




i-opener opener laptop notebook computer help drivers dll free windows dos repair fix linux mac macintosh 2000 95 98 nt pc configure hardware software sound video netscape explorer network networking lan wan software cmos fat bios printer card mouse modem ide scsi cd rom controllers scanner tape hard drive cgi scripts source code mp3