SDL_mixer sounds garbled

I’m building a MP3 player with SDL and SDL_mixer. When I play an MP3 with
SDL_mixer it sounds kind of garbled, almost like it’s not decoding properly.
The file is ABR, 44.1Khz encoded by lame. Is ABR a problem? If I play it using
madplay it sounds just fine.–
Jason Bodnar
@Jason_Bodnar
http://www.shakabuku.org

I’m building a MP3 player with SDL and SDL_mixer. When I play an MP3 with
SDL_mixer it sounds kind of garbled, almost like it’s not decoding properly.
The file is ABR, 44.1Khz encoded by lame. Is ABR a problem? If I play it using
madplay it sounds just fine.

Please try it with “plaympeg” from the SMPEG distribution (since SMPEG is
what SDL_mixer uses for decoding).

If this sounds okay, it’s probably a bug in your code (opened the audio
device at a bad setting, etc).

–ryan.

It’s even worse with plaympeg. It pauses or skips every second or so and the
garbling is also present.

There are couple of peculiarities with my setup. It’s running on a 266Mhz
Cyrix MediaGX (which shouldn’t be a problem?) and it’s built against uClibc.
The kernel is a stripped down linux-2.4.18 kernel without kernal modular
support. The latter leaves me wondering. When I run plaympeg it complains
about not finding /sbin/modprobe and also about not being able to change modes
with the VESA framebuffer. Could the module stuff be a problem?

Thanks,

JasonOn Wed, 6 Nov 2002 07:57:44 -0500 (EST), Ryan C. Gordon wrote

I’m building a MP3 player with SDL and SDL_mixer. When I play an MP3 with
SDL_mixer it sounds kind of garbled, almost like it’s not decoding properly.
The file is ABR, 44.1Khz encoded by lame. Is ABR a problem? If I play it using
madplay it sounds just fine.

Please try it with “plaympeg” from the SMPEG distribution (since
SMPEG is what SDL_mixer uses for decoding).

If this sounds okay, it’s probably a bug in your code (opened the audio
device at a bad setting, etc).


Jason Bodnar
@Jason_Bodnar
http://www.shakabuku.org

There are couple of peculiarities with my setup. It’s running on a 266Mhz
Cyrix MediaGX (which shouldn’t be a problem?) and it’s built against uClibc.
The kernel is a stripped down linux-2.4.18 kernel without kernal modular
support. The latter leaves me wondering. When I run plaympeg it complains
about not finding /sbin/modprobe and also about not being able to change modes
with the VESA framebuffer. Could the module stuff be a problem?

It sounds like you’re underpowered, honestly, but I could be wrong. uClibc
might have an incompatibility, too. Does the same MP3 have this problem on
other boxes?

Does the MediaGX have a floating point unit?

–ryan.

Icculus said:----------------------

There are couple of peculiarities with my setup. It’s running on a
266Mhz
Cyrix MediaGX (which shouldn’t be a problem?) and it’s built against
uClibc.
The kernel is a stripped down linux-2.4.18 kernel without kernal
modular
support. The latter leaves me wondering. When I run plaympeg it
complains
about not finding /sbin/modprobe and also about not being able to
change modes
with the VESA framebuffer. Could the module stuff be a problem?

It sounds like you’re underpowered, honestly, but I could be wrong.
uClibc
might have an incompatibility, too. Does the same MP3 have this problem
on
other boxes?

Does the MediaGX have a floating point unit?

The MediaGX does have a floating point processor. It should be
roughly equivalent to a Pentium 166/200 or so.

If you don’t remember, the MediaGX was Cyrix’s all-in-one chipset. The
CPU and main RAM powered the sound, video, and normal processor
functions (perhaps modem and a LAN as well?). Basically it’s along the
lines of a lot of the current chipsets/motherboards that run everything
under the sun off the processor (I know a lot of older ones did this
too).

This should still be powerful enough to do MP3 decoding quite well. I
know my friend set one up as a MP3 jukebox for his parents running
WinAmp and win 95 or 98. He never ran into any problems.

My guess is that the plaympeg complaints are slowing it down too much.
Perhaps you could try using mpg123 from the command line? If that
doesn’t work, you should try something that uses mad to decode mp3s
(http://www.mars.org/home/rob/proj/mpeg/#using)

Hope this helps,
Joe

It sounds like you’re underpowered, honestly, but I could be wrong.

Perhaps for smpeg. As the description says on Loki’s smpeg page:

“SMPEG does not achieve adequate performance on slower systems.”

But madplay plays it just fine.

uClibc
might have an incompatibility, too.

I think might be true. my uClibc version of plaympeg seems to have problems
exiting after it’s finished playing a sound. I think it also my the sound
chip. The same track plays fine with plaympeg on my workstation at home but
doesn’t sound so great on 1.2Ghz laptop at work. mpg123 also has problems
playing it at work but again plays fine at home.

So, I’ll chalk it up to uClibc and a bad sound chip and take a look at some
high level APIs for libmad. I may try running it under a debugger just to see
what’s going on.

Does the MediaGX have a floating point unit?

Yes.

Thanks for everyone’s help,

JasonOn Thu, 7 Nov 2002 13:45:12 -0500 (EST), Ryan C. Gordon wrote


Jason Bodnar
@Jason_Bodnar
http://www.shakabuku.org

It sounds like you’re underpowered, honestly, but I could be wrong.

Perhaps for smpeg. As the description says on Loki’s smpeg page:

Yes, that what I meant. It wasn’t a threat against your masculinity. :slight_smile:

So, I’ll chalk it up to uClibc and a bad sound chip and take a look at some
high level APIs for libmad. I may try running it under a debugger just to see
what’s going on.

Might be a driver thing, too…try playing with the SDL_AUDIODRIVER
enviroment variable.

–ryan.