From: <ba...@us...> - 2006-09-17 23:48:47
|
Revision: 359 http://svn.sourceforge.net/cadcdev/?rev=359&view=rev Author: bardtx Date: 2006-09-17 16:48:43 -0700 (Sun, 17 Sep 2006) Log Message: ----------- kos: Patch #1552720 from SourceForge: As discussed in the latter part of http://sourceforge.net/mailarchive/message.php?msg_id=30315678. There's one more thing I wanted to bring up. In FreeSCI I use more than two streaming sound channels, but the aica driver only updates the current playing position of the first two. This is easy to fix by changing the "for (i=0; i<2; i++)" line into "for (i=0; i<64; i++)" in arm/main.c. This exposes another problem, however. It seems that a delay is necessary between selecting the sound channel, and reading back its position. This is arm/aica.c, function aica_get_pos. Without the delay, the positions will "trail behind" by two channels (e.g. channel 2 position is actually that of channel 0, etc). When you're only updating two channels you won't notice this as the two channel delay matches the numbers of channels, so even though you're reading old data, it'll be for the right channel. I hope I'm making sense here. ;) A simple for (i=0; i<20; i++); loop seems to fix it, but there might be a better way to do the delay. Modified Paths: -------------- kos/kernel/arch/dreamcast/sound/arm/aica.c kos/kernel/arch/dreamcast/sound/arm/main.c kos/kernel/arch/dreamcast/sound/arm/stream.drv Modified: kos/kernel/arch/dreamcast/sound/arm/aica.c =================================================================== --- kos/kernel/arch/dreamcast/sound/arm/aica.c 2006-09-17 23:44:08 UTC (rev 358) +++ kos/kernel/arch/dreamcast/sound/arm/aica.c 2006-09-17 23:48:43 UTC (rev 359) @@ -207,8 +207,13 @@ /* Get channel position */ int aica_get_pos(int ch) { + int i; + /* Observe channel ch */ SNDREG8(0x280d) = ch; + + /* Wait a while */ + for (i = 0; i < 20; i++); /* Update position counters */ chans[ch].pos = SNDREG32(0x2814) & 0xffff; Modified: kos/kernel/arch/dreamcast/sound/arm/main.c =================================================================== --- kos/kernel/arch/dreamcast/sound/arm/main.c 2006-09-17 23:44:08 UTC (rev 358) +++ kos/kernel/arch/dreamcast/sound/arm/main.c 2006-09-17 23:48:43 UTC (rev 359) @@ -178,7 +178,7 @@ /* Wait for a command */ for( ; ; ) { /* Update channel position counters */ - for (i=0; i<2; i++) + for (i=0; i<64; i++) aica_get_pos(i); /* Check for a command */ Modified: kos/kernel/arch/dreamcast/sound/arm/stream.drv =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |