Skip to contentSkip to conversation

madplay on mips

DISCUSSION Pete Popov 3 participants 4 messages Feb 4, 2002 – Feb 5, 2002 MIPS

lore
Share & tools
lore

Pete Popov

author
#0 lore raw

Has anyone used madplay on mips to play mp3 files successfully? I've tried it on two mips boards with different sound drivers, and in both cases it plays the song slower and a bit muffled. It works on x86 and supposedly ppc.

Pete

#1 lore raw
Quoted 6 lines · Pete Popov

Has anyone used madplay on mips to play mp3 files successfully? I've tried it on two mips boards with different sound drivers, and in both cases it plays the song slower and a bit muffled. It works on x86 and supposedly ppc.

I tried it before, and had the same results.

I looked over the system calls, and was pretty much sure that the problem was on madplay side, and not on the driver side. One problem suspected was the floating point issue, but did get into it.

Jun

author
#2 lore raw
Quoted 8 lines · Jun Sun
Quoted 6 lines · Pete Popov

Has anyone used madplay on mips to play mp3 files successfully? I've tried it on two mips boards with different sound drivers, and in both cases it plays the song slower and a bit muffled. It works on x86 and supposedly ppc.

Quoted 5 lines

I tried it before, and had the same results.

I looked over the system calls, and was pretty much sure that the problem was on madplay side, and not on the driver side. One problem suspected was the floating point issue, but did get into it.

Even though madplay claims that no floating point is used, the disassembly of the latest version shows otherwise. But I tried it on a board with a cpu that does have a hardware floating point unit with the same result.

Pete

#3 lore raw
Quoted 4 lines · Pete Popov

Has anyone used madplay on mips to play mp3 files successfully? I've tried it on two mips boards with different sound drivers, and in both cases it plays the song slower and a bit muffled. It works on x86 and supposedly ppc.

Muffled sound could be the result of a poor FPM choice, or a buggy compiler.

For best performance, MAD needs a multiply/accumulate instruction, which is not available on all MIPS platforms. Check the MIPS section of libmad/fixed.h and see whether you can use either of the MADD_ASM alternatives, then change your libmad/config.h to suit (or consider updating libmad/configure.in). In the worst case you might need to write a new asm alternative, or try something more generic like FPM_64BIT or FPM_DEFAULT -- though the latter could also be the cause of poor sound.

I've encountered problems with certain gcc optimization options on some platforms, notably ARM and MIPS, the symptom being a sort of muffled sound result rather than the clear sound MAD ought to produce. I never traced these bugs in the compiler, so my only advice is to try different combinations of -fstrength-reduce and -finline-functions if you suspect this to be a problem.

Quoted 4 lines

Even though madplay claims that no floating point is used, the disassembly of the latest version shows otherwise. But I tried it on a board with a cpu that does have a hardware floating point unit with the same result.

The _only_ floating point used by madplay is in option parsing and calculation of peak amplitude in decibels upon completion of decoding. There is no floating point used in the decoder proper (libmad).

I'm not sure what you mean by songs "playing slower" but it could be either libmad is not reaching real-time performance, or there could be issues with channel/sampling frequency selection in your sound driver. You could try -m and/or --downsample, or modify the audio output module to use a fixed known good sampling frequency. Also try sending output to a file (-o out.wav) and see if you can play that successfully with another program.

If the problem is real-time performance, you can try the --enable-speed option to `configure' at the expense of some accuracy.

Signature · 2 lines
Rob Leslie
[email protected]