From: Adrian M. <ad...@mc...> - 2001-12-27 12:08:51
|
I have been working to make/port a decent mp3 player for the Dreamcast now that there is a sound driver. I have built mpg123 with these options: dream: $(MAKE) CC=sh4-linux-gcc LDFLAGS= \ OBJECTS='decode.o dct64.o audio_oss.o' \ CFLAGS='-DREAL_IS_FLOAT -DLINUX -Wall -O2 \ -DOSS \ -fomit-frame-pointer -funroll-all-loops \ -finline-functions -ffast-math' \ mpg123-make but this always generates a floating point exception at run time. I have been able to isolate this to the following function: costab[k] = 1.0 / (2.0 * cos( 3.14159265358979323846 * ((double) k * 2.0 + 1.0) / (double) divv)); This is looped 0 < k < kr With k as 0 it costab[k] is returned as NaN and with k = 1 the floating point exception is generated. kr is 16 and divv is 64. My maths indicates costab[0] should be roughly 0.5. Incuidentally with -DREAL_IS_FLOAT switched off then there is no fp exception but the program outputs static. So: the questions are - is this a known problem, has it been fixed in later kernels or have I just got it wrong? Adrian |
From: Adrian M. <ad...@mc...> - 2001-12-27 12:35:28
|
Additional point: I am using gcc 3.0.1 as the cross compiler |
From: NIIBE Y. <gn...@m1...> - 2001-12-28 02:54:54
|
Adrian McMenamin wrote: > costab[k] = 1.0 / (2.0 * cos( 3.14159265358979323846 * ((double) k * 2.0 + > 1.0) / (double) divv)); [...] > So: the questions are - is this a known problem, has it been fixed in later > kernels or have I just got it wrong? I don't know if this is related, we have a FPU bug wrt floating point to double conversion. For example, compiling runtime of Java, GCC fails because of exception. I have experimental fix for this issue, I'll send this to linuxsh-dev soon. -- |
From: Adrian M. <ad...@mc...> - 2002-01-01 12:05:10
|
On Friday 28 Dec 2001 2:54 am, NIIBE Yutaka wrote: > Adrian McMenamin wrote: > > costab[k] = 1.0 / (2.0 * cos( 3.14159265358979323846 * ((double) k * 2.0 > > + 1.0) / (double) divv)); > > [...] > > > So: the questions are - is this a known problem, has it been fixed in > > later kernels or have I just got it wrong? > > I don't know if this is related, we have a FPU bug wrt floating point > to double conversion. For example, compiling runtime of Java, GCC > fails because of exception. > > I have experimental fix for this issue, I'll send this to linuxsh-dev > soon. Just to close this. I rebuilt my tools and upgraded to gcc 3.0.3 and now the programme compiles and runs fine. Not sure what the problem was exactly - could have been a badly patched compiler, could have been a corrupted library - but it works now. Adrian |
From: Adrian M. <ad...@mc...> - 2002-01-05 00:55:55
|
A new, much improved, pre-release version of the open sound system (OSS) compatible AICA sounddriver for Linux on the Dreamcast is available for testing. This version implements a new buffering mechanism that has meant continuous playing of PCM and MP3 samples. The driver needs to be tested in very high demand environments (eg MPEG video) as there is potential for synchronisation problems - I haven't ported any such applications, but I know others have and could test this. Anyway: The files are at: http://www.mcmen.demon.co.uk/linuxdc/aica You need aica.c and arm7.h to build the drivers However, as this is an OSS driver you will also need a minimal OSS system on your DC. The files and a smaple makefile are also available at the above address to build this. Simply download, alter to fit your set up and install with insmod soundcore.o and insmod aica.o Please feel free to post any questions to me or (preferably) the linuxdc-dev (and others if you feel it appropriate - but don't spam people) list. Happy New Year to all, Adrian |
From: M. R. B. <mr...@0x...> - 2001-12-27 18:00:34
|
* Adrian McMenamin <ad...@mc...> on Thu, Dec 27, 2001: > I have been working to make/port a decent mp3 player for the Dreamcast no= w=20 > that there is a sound driver. >=20 > I have built mpg123 with these options: >=20 > dream: > $(MAKE) CC=3Dsh4-linux-gcc LDFLAGS=3D \ > OBJECTS=3D'decode.o dct64.o audio_oss.o' \ > CFLAGS=3D'-DREAL_IS_FLOAT -DLINUX -Wall -O2 \ > -DOSS \ > -fomit-frame-pointer -funroll-all-loops \ > -finline-functions -ffast-math' \ > mpg123-make >=20 > but this always generates a floating point exception at run time. >=20 I'm not to keen on how the flags function for the SH backend of GCC (maybe NIIBE-san knows?) but I always thought -ffast-math was a i386-based (not necessarily specific) optimization. I don't think it's wise to use it here =2E.. although it may be a no-op. Only a read through GCC's source will confirm that. >=20 > Incuidentally with -DREAL_IS_FLOAT switched off then there is no fp excep= tion=20 > but the program outputs static. >=20 Have you tried with -m4-single-only? It generates FP code conforming to what its name implies. > So: the questions are - is this a known problem, has it been fixed in lat= er=20 > kernels or have I just got it wrong? >=20 I don't see how it could be a kernel issue. M. R. |
From: M. R. B. <mr...@0x...> - 2001-12-27 21:22:12
|
* Adrian McMenamin <ad...@mc...> on Thu, Dec 27, 2001: > I have been working to make/port a decent mp3 player for the Dreamcast no= w=20 > that there is a sound driver. >=20 > I have built mpg123 with these options: >=20 > dream: > $(MAKE) CC=3Dsh4-linux-gcc LDFLAGS=3D \ > OBJECTS=3D'decode.o dct64.o audio_oss.o' \ > CFLAGS=3D'-DREAL_IS_FLOAT -DLINUX -Wall -O2 \ > -DOSS \ > -fomit-frame-pointer -funroll-all-loops \ > -finline-functions -ffast-math' \ > mpg123-make > Update: Using the above line in mpg123/Makefile (with dream changed to linux-sh for consistency), I built mpg123 and executed it on the Dreamcast = ... no problems whatsoever. You must have a snag in your toolchain somewhere. I'm using (all patched with the latest patchset from ftp.m17n.org/pub/super-h/testing/) binutils 2.11.2, GCC 3.0.3, and glibc 2.2.4. This was executed under the busybox shell (the sh-like one) under kernel 2.4.16. M. R. |