General > Discussion

sound glitches

(1/1)

atomisirsi:
I'm using alsa as sound output but ufoai always uses the wrong period size. As an result the sound is a little bit stutteringly.

Now I've found a way to prevent that:

--- Code: ---Index: src/linux/snd_alsa.c
===================================================================
--- src/linux/snd_alsa.c (Revision 189)
+++ src/linux/snd_alsa.c (Arbeitskopie)
@@ -138,7 +138,7 @@
  }
 
  dma.channels = sndchannels->value;
- if(dma.channels < 1 || dma.channels > 2)
+ if(dma.channels != 1 && dma.channels != 2)
   dma.channels = 2;  //ensure either stereo or mono
--- End code ---


But I haven't found the 'real reason', yet...

atomisirsi:
In snd_oss.c sndchannels->value gets casted to int, maybe that could help, too?

btw: what's snd_alsa.c.new for? Is it a new implementation?

Mattn:
yes, this is a fork of http://jdolan.dyndns.org/jaydolan/files/quetoo-README
but there seams to be problems, too

atomisirsi:
Please forget the 'fix'. I've tested a little bit more and it's not this line but the used alsa device that is responsible for the problems.

If I use device hw:0,0 I get no error and the sound is fine, with dmixer I get no error, but the sound is ugly and finally with default I get the both error message and ugly sound.

[*]hw:0,0 is the plain pcm device
[*]dmixer is the playback part of the same pcm device with the dmix plugin configured
[*]default maps to the asym plugin with dmix and dsnoop configured[/list]

I've checked the other two sound implementations, oss and sdl, too, but they didn't work either  :(
With oss I get big gaps between two played samples (the gaps depend on the used sample rate), like tok.........tok.........
And sdl (uses alsa, too) doesn't play any sounds.
With both variants I get no error messages.

Navigation

[0] Message Index

Go to full version