project-navigation
Personal tools

Author Topic: stutteringly sound  (Read 6370 times)

f-bert

  • Guest
stutteringly sound
« on: April 24, 2006, 11:20:33 pm »
ok if i would renice the process:

renice [ufoai] -15

then the sound works fine in the game. but so i will get stutteringly menues.
maybe there is something wrong with the priority of the sound thread!?

daniel

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
stutteringly sound
« Reply #1 on: April 25, 2006, 06:26:09 am »
which driver? alsa, oss, sdl?

f-bert

  • Guest
stutteringly sound
« Reply #2 on: April 25, 2006, 08:15:43 pm »
i used alsa on ubuntu dapper.
the both other dirver oss and sdl doesn't work.
but it should normaly, because i have emu10k sound chip with hardware mixing....

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
stutteringly sound
« Reply #3 on: April 26, 2006, 09:07:34 am »
for oss try this:
Code: [Select]

echo "ufo 0 0 direct" > /proc/asound/card0/pcm0p/oss


for sdl you can set the audiodriver via an environment var:
available drivers (may differ - depends on how sdl-libs are compiled by you or your vendor)
Code: [Select]

openbsd (OpenBSD)
dsp (OSS /dev/dsp: Linux, Solaris, BSD etc)
alsa (Linux)
audio (Unix style /dev/audio: SunOS, Solaris etc)
AL (Irix)
artsc (ARTS audio daemon)
esd (esound audio daemon)
nas (NAS audio daemon)
dma (OSS /dev/dsp, using DMA)
dsound (Win32 DirectX)
waveout (Win32 WaveOut)
baudio (BeOS)
sndmgr (MacOS SoundManager)
paud (AIX)
AHI (Amiga)


out this into your ufo-ai wrapper
Code: [Select]

export SDL_AUDIO_DRIVER [driver_from_list_above]

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
stutteringly sound
« Reply #4 on: April 26, 2006, 09:10:09 am »
forgot about one thing: there is a second approach to implement alsa. rename the current snd_aksa.c in src/linux to and snd_alsa.c.tmp or somthing and then rename the snd_alsa.c.new to snd_alsa.c

i´ve not tested this driver for quit a long time - but maybe it will work for you - please give feedback,

f-bert

  • Guest
stutteringly sound
« Reply #5 on: April 27, 2006, 02:55:00 pm »
thanks for help

i had build the last trunk svn version but there where some other truppels. i used there alsa.c.new but the sound stuttering.
with sdl btw. oss i got no voice from the speaker.

is it compatible with  x.org 7 ?

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
stutteringly sound
« Reply #6 on: April 27, 2006, 06:25:35 pm »
i´m not sure whether it is compatible - i use the "old" xfree that ships with debian. why? doesn´t it compile? give me error messages, please

f-bert

  • Guest
stutteringly sound
« Reply #7 on: April 28, 2006, 03:31:47 pm »
it compiles fine. i dont now why it is lacking... maybe you can test it on ubuntu dapper.

Offline Bandobras

  • Captain
  • *****
  • Posts: 586
    • View Profile
stutteringly sound
« Reply #8 on: June 16, 2006, 12:31:18 am »
> is it compatible with x.org 7 ?

Yes, it is. I run it with Debian unstable.

Offline bullfrog

  • Cannon Fodder
  • **
  • Posts: 5
    • View Profile
stutteringly sound
« Reply #9 on: July 25, 2006, 01:09:45 am »
Hey guys!!
First post, have to say: thank you so much for all that you are doing!!
This game is great!!
I have some coding skill but don't think good enough for actually working on the game code! Will try to help doing some "low skill" things... and reporting bugs, of course! :)

Now, something serious...
I'm experiencing the same problem with the ALSA sound driver: the .ogg are played at a ultrafast speed. Switching to SDL solve the problem. So, would say this is a low priority. I tried to use the snd_alsa.c.new but i couldn't compile:
.
.
.
 * [UFO] ../debugi386/client/snd_alsa.o
ports/linux/snd_alsa.c: In function 'ALSA_SNDDMA_Init':
ports/linux/snd_alsa.c:49: error: expected expression before '/' token
ports/linux/snd_alsa.c:56: error: 'false' undeclared (first use in this function)
ports/linux/snd_alsa.c:56: error: (Each undeclared identifier is reported only once
ports/linux/snd_alsa.c:56: error: for each function it appears in.)
ports/linux/snd_alsa.c:79: error: expected expression before '/' token
ports/linux/snd_alsa.c:81: error: expected expression before '/' token
ports/linux/snd_alsa.c:89: error: expected expression before '/' token
ports/linux/snd_alsa.c:99: error: expected expression before '/' token
ports/linux/snd_alsa.c:103: warning: pointer targets in passing argument 3 of 'snd_pcm_hw_params_set_rate_near' differ in signedness
ports/linux/snd_alsa.c:105: error: expected expression before '/' token
ports/linux/snd_alsa.c:111: error: expected expression before '/' token
ports/linux/snd_alsa.c:128: error: expected expression before '/' token
ports/linux/snd_alsa.c:137: error: expected expression before '/' token
ports/linux/snd_alsa.c:170: error: expected expression before '/' token
ports/linux/snd_alsa.c:179: error: 'true' undeclared (first use in this function)
ports/linux/snd_alsa.c:45: warning: unused variable 'i'
ports/linux/snd_alsa.c:180: warning: control reaches end of non-void function
ports/linux/snd_alsa.c: In function 'ALSA_SNDDMA_Submit':
ports/linux/snd_alsa.c:224: error: expected expression before '/' token
ports/linux/snd_alsa.c:225: error: expected expression before '/' token
ports/linux/snd_alsa.c:229: error: expected expression before '/' token
ports/linux/snd_alsa.c:232: error: expected expression before '/' token
make[1]: *** [../debugi386/client/snd_alsa.o] Error 1
make: *** [build_debug] Error 2

So, I fixed all the comments from //comment to /*comment*/ and the true/false constants to qtrue/qfalse (in this case I just guessed... LOL, no idea about that!).
Anyway, I managed to compile it getting just a:
 * [UFO] ../debugi386/client/snd_alsa.o
ports/linux/snd_alsa.c: In function 'ALSA_SNDDMA_Init':
ports/linux/snd_alsa.c:103: warning: pointer targets in passing argument 3 of 'snd_pcm_hw_params_set_rate_near' differ in signedness
ports/linux/snd_alsa.c:118: warning: pointer targets in passing argument 3 of 'snd_pcm_hw_params_set_rate_near' differ in signedness

I think that this file needs more work as the alsa sound was wrong (guess the wrong things are going in the buffer) but I could hear the original music. The speed is better but is still faster than with SDL.

Hope all this will be useful.

Ops, forgot:
Version: trunk (just updated)
OS: linux debian unstable (kernel 2.6.16.20)

Keep up the good work!!