project-navigation
Personal tools

Author Topic: sound glitches  (Read 5334 times)

atomisirsi

  • Guest
sound glitches
« on: March 07, 2006, 06:53:01 pm »
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: [Select]
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


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

atomisirsi

  • Guest
sound glitches
« Reply #1 on: March 07, 2006, 07:14:57 pm »
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?

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
sound glitches
« Reply #2 on: March 08, 2006, 12:22:51 am »
yes, this is a fork of http://jdolan.dyndns.org/jaydolan/files/quetoo-README
but there seams to be problems, too

atomisirsi

  • Guest
sound glitches
« Reply #3 on: March 08, 2006, 01:08:29 am »
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
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.