Ugly ogg problems

I’m playing some music and sound effects, both loaded as OGG samples.

The sound effects play perfectly. The music, however, is “accelerated” -
it’s like the mixer constantly skipped sections.

I’m using the newest SDL libs, ALSA 0.9, and OSS emulation in Linux.
Note that this behavior doesn’t happen in Windows, with the same code.
XMMS plays the same ogg files without problems. mplayer has no problems
with sound, either.

Any ideas? Where to start looking, at least?

Thanks
–Gabriel

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy

I get the same symptoms when the data is 16-bit mono but SDL thinks it’s
16-bit stereo - the data rate is double what it should be, so it sounds like
jabbering monkeys. :)On Friday 19 September 2003 09:22 am, Gabriel Gambetta wrote:

I’m playing some music and sound effects, both loaded as OGG samples.

The sound effects play perfectly. The music, however, is “accelerated” -
it’s like the mixer constantly skipped sections.

So can SDL not play 16 - Bit Mono?

Andrew> ----- Original Message -----

From: tsm@accesscomm.ca (Tyler Montbriand)
Newsgroups: gmane.comp.lib.sdl
Sent: Saturday, September 20, 2003 2:42 PM
Subject: Re: Ugly ogg problems

On Friday 19 September 2003 09:22 am, Gabriel Gambetta wrote:

I’m playing some music and sound effects, both loaded as OGG samples.

The sound effects play perfectly. The music, however, is “accelerated” -
it’s like the mixer constantly skipped sections.
I get the same symptoms when the data is 16-bit mono but SDL thinks it’s
16-bit stereo - the data rate is double what it should be, so it sounds like
jabbering monkeys. :slight_smile:

I’m quite sure it can - but not if you tell it to play 16-bit stereo
and then feed it 16-bit mono data without conversion. :wink:

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Saturday 20 September 2003 23.56, Andrew Balmos wrote:

So can SDL not play 16 - Bit Mono?

SDL can play both 16-bit stereo and 16-bit mono - just not at the same time.
:slight_smile: Like, if you fed raw 8-bit samples directly into a 16-bit sound device
you’d get garbage… something has to translate them to 16-bit first.

I presume you’re using SDL_sound, since you mention OGG samples. When you
create the music stream, be sure to inform SDL_sound that you REQUIRE the
stream’s data format to match that of your current sound device; otherwise it
doesn’t know it’s supposed to give you anything but the channels and sample
rate of your music file.On Saturday 20 September 2003 03:56 pm, Andrew Balmos wrote:

So can SDL not play 16 - Bit Mono?

I get the same symptoms when the data is 16-bit mono but SDL thinks
it’s
16-bit stereo - the data rate is double what it should be, so it
sounds like
jabbering monkeys. :slight_smile:

That makes sense. The description is pretty accurate, too :wink:

I presume you’re using SDL_sound, since you mention OGG samples. When
you
create the music stream, be sure to inform SDL_sound that you REQUIRE
the
stream’s data format to match that of your current sound device;
otherwise it
doesn’t know it’s supposed to give you anything but the channels and
sample
rate of your music file.

OK, thanks, I’ll try that. I thought the conversion was automatic.

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy> ----- Original Message -----

From: Tyler Montbriand [mailto:tsm@accesscomm.ca]
Sent: Domingo, 21 de Septiembre de 2003 10:29 p.m.
To: sdl at libsdl.org
Subject: Re: [SDL] Re: Ugly ogg problems

On Saturday 20 September 2003 03:56 pm, Andrew Balmos wrote:

So can SDL not play 16 - Bit Mono?
SDL can play both 16-bit stereo and 16-bit mono - just not at the same
time.
:slight_smile: Like, if you fed raw 8-bit samples directly into a 16-bit sound
device
you’d get garbage… something has to translate them to 16-bit first.

I presume you’re using SDL_sound, since you mention OGG samples. When
you
create the music stream, be sure to inform SDL_sound that you REQUIRE
the
stream’s data format to match that of your current sound device;
otherwise it
doesn’t know it’s supposed to give you anything but the channels and
sample
rate of your music file.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Tyler Montbriand escribi?:> On Saturday 20 September 2003 03:56 pm, Andrew Balmos wrote:

So can SDL not play 16 - Bit Mono?
SDL can play both 16-bit stereo and 16-bit mono - just not at the same time.
:slight_smile: Like, if you fed raw 8-bit samples directly into a 16-bit sound device
you’d get garbage… something has to translate them to 16-bit first.

I presume you’re using SDL_sound, since you mention OGG samples. When you
create the music stream, be sure to inform SDL_sound that you REQUIRE the
stream’s data format to match that of your current sound device; otherwise it
doesn’t know it’s supposed to give you anything but the channels and sample
rate of your music file.

I had a similar problem recently. I finally realised it was a problem with the drivers:
for any unknown reason, ALSA drivers doesnt work well with SDL for my board (VIA 8235
integrated audio codec).

I switched to OSS/Free and all worked fine.

Regards,
Wizord.