audio plays back too fast on certain hardware

Dave Dodge dododge at dododge.net
Tue Feb 10 00:43:14 EST 2004


Summary: audio plays back too fast on VIA 82cxxx hardware. It's
probably due to a mismatch between the audio file and the hardware
output rate.

When I built and tested 0.9.0 this weekend I was using an old P3-500
with an SBLive card, and it worked okay.

I moved the drives to a much faster Athlon system, but which has VIA
audio on the motherboard. Pydance runs arrows at the normal
speed, but the audio comes out too fast and gets farther and farther
ahead of the arrows as the song proceeds.

This happens for both mp3 and ogg files. Even the music pydance plays
while loading files at startup is noticably higher in pitch than it
ought to be. xmms on the same system plays back the same files
correctly.

Now, I notice that mpg123 and ogg123 can't play back at all. They give
errors such as:

  libao - OSS cannot set rate to 44100

I think the problem here is that the mp3/ogg files are 44.1KHz, and
VIA for some reason does not support that as a hardware output rate.
I ran into something similar with another VIA-chipset system a few
months ago, and found that I could only get SPDIF output from aplay at
48KHz; nothing I tried ever managed to get SPDIF output at 44.1KHz
from this chipset. I'm not explicitly using SPDIF in this particular
case, but I'm guessing it's the same basic problem.

In fact if I use ogg123/sox/oggenc to resample the file to 48KHz,
pydance does play it back at the right speed.

Do you think this is something that can be handled in pydance playback
(similar to what xmms must be doing)? Or is the only likely solution
going to be to upsample all of my existing files or stick a different
audio device in the machine?

                                                  -Dave Dodge



More information about the pyddr-discuss mailing list