Wyrmkeep Entertainment Board
June 03, 2020, 11:53:30 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Patreon for Inherit the Earth:Sand and Shadows launched!
 
Our sites: Wyrmkeep Entertainment Home   Inherit the Earth Comic   Mole's Quest   The Labyrinth of Time
   Home   Help Search Members Login Register  
Pages: [1]
  Print  
Author Topic: linux sound output choppy (demo)  (Read 16390 times)
simcop2387
Newbie
*
Offline Offline

Posts: 3



View Profile
« on: September 30, 2004, 07:57:35 PM »

playing the demo it seems that the audio is choppy, the gameplay seems to be fine, no other game/app does this, if possible i'd like some details about how your doing sound, (straight SDL, ALSA, or something else) so that i know what to check, i'm about to do a kernel recompile to try to get MIDI output and see if that will help (i need to upgrade the kernel anyway).  any hints would be helpful, or even how to get a debug output to help you guys
Logged
WyrmMaster
Administrator
Sr. Member
*****
Offline Offline

Posts: 478



View Profile
« Reply #1 on: September 30, 2004, 10:54:59 PM »

Straight SDL, although we did recompile libSDL 1.2.7 under an older glibc (3.1). I don't know if our compile supports ALSA. You might want to remove the libSDL we provided and see (hear) what happens.

What are your system's specs?

The Linux version doesn't use MIDI, it's all digital audio.
 
Logged
eriktorbjorn
Newbie
*
Offline Offline

Posts: 12



View Profile
« Reply #2 on: October 01, 2004, 02:31:37 AM »

Wild speculation mode on; please bear with me.

Some time ago there was a ScummVM bug report about choppy audio in the Linux version when playing Broken Sword 2, albeit only when the player moves in such a way that the "camera" has to move to follow him. Ordinarily, BS2 outputs 12 frames per second. Most of the rest of the time it "sleeps", that is to say it calls SDL_Delay(). The result is that most of the time, CPU usage stays fairly low. When the camera moves, on the other hand, it would output frames as fast as it could to make the screen scroll more smoothly. At these times ScummVM would use up pretty much all available CPU time.

What I eventually did was to add a brief delay (~ 10 ms, since that's the granularity the SDL documentation says is the most common) between the frames even in this case. The bug reporter said this caused the choppiness to go away, and since the scrolling still looked smooth to me I left it that way. My guess is that while the main thread was hogging the CPU, the OS scheduler didn't give enough time to the audio thread, causing it to run out of audio samples to play. But that's just speculation. I was never able to reproduce the bug myself, neither under Linux nor Windows, however.

Just like with ScummVM, I don't hear any choppiness in the audio with the Linux ITE demo. I haven't yet had the time to try the full version since it only arrived yesterday and I was dead tired, but I assume it's the same in that respect. I did notice that it does appear to use all available CPU at all times, so it could be the same problem, I guess.
« Last Edit: October 01, 2004, 09:59:25 AM by eriktorbjorn » Logged
simcop2387
Newbie
*
Offline Offline

Posts: 3



View Profile
« Reply #3 on: October 01, 2004, 07:41:10 AM »

yea removing your libsdl was one of the first things i did, i figured that well maybe their libsdl was causing problems, no change.  here's my system specs.

CPU: AMD Athlon XP 1800+ (1.5ghz)
Mem: 512mb ram
Audio: Trident 4D wave DX
GFX: Geforce 3 TI 200 (64mb ram)
Distro: Gentoo

i think thats all that would be relavent in this case, i doubt you've seen my audio card before.  It works rather well, full duplex, i can easily have artsd and esd running at the same time, all while playing music with XMMS, so its a decent card.

EDIT: Making SDL go through ESD/Artsd rather than straight alsa seems to fix the problem, i halfway wonder if its some sort of buffering issue because i've never seen that happen before (even in a perl script i wrote that dials my phone that has a crappy speed dial)

in case anyone else has a similar problem, here's how to fix it

$ SDL_AUDIODRIVER="esd" ./itedemo
for esd,

$ SDL_AUDIODRIVER="artsc" ./itedemo
for arts (and yes that is supposed to be artsc, i don't know why really but thats what makes SDL use arts)
« Last Edit: October 01, 2004, 07:46:06 AM by simcop2387 » Logged
WyrmMaster
Administrator
Sr. Member
*****
Offline Offline

Posts: 478



View Profile
« Reply #4 on: October 01, 2004, 09:41:49 AM »

We will have to digest all the information you have provided.

If we come up with some test compiles of the game, would you be willing to give them a try?

For the suggested fix of changing the SDL audio driver, was that with our compile of SDL?
 
Logged
simcop2387
Newbie
*
Offline Offline

Posts: 3



View Profile
« Reply #5 on: October 01, 2004, 10:52:22 AM »

that was with mine, but it should work with any SDL that has the other audio drivers built into them
Logged
WyrmMaster
Administrator
Sr. Member
*****
Offline Offline

Posts: 478



View Profile
« Reply #6 on: October 03, 2004, 10:55:45 AM »

simcop2387, I would like to send you a test version of the demo with an SDL_Delay(10) added. Can you give me your e-mail address? You can use the forum e-mail -- click the E-Mail button below this message. Or send it to techsupport@wyrmkeep.com.

Thanks in advance.
 
Logged
eriktorbjorn
Newbie
*
Offline Offline

Posts: 12



View Profile
« Reply #7 on: October 15, 2004, 11:43:05 PM »

Just out of curiosity, was a solution ever found to this? It doesn't matter much to me personally, since I never saw the bug in action, but still...
Logged
WyrmMaster
Administrator
Sr. Member
*****
Offline Offline

Posts: 478



View Profile
« Reply #8 on: October 16, 2004, 01:40:51 PM »

We were unable to reproduce the problem here. We took a wild shot at a fix by adding some SDL_Delay calls. Also, we try to use any existing copy of libSDL 1.2 that might be on a system instead of our compile. The current version of the demo has these changes.

Another person reported that the configuration screen plays sounds and music correctly, but the main demo just plays high frequency beeps. This is odd because the Linux demo using the same code and data for both purposes. (This isn't true of the Windows and Mac OS X demos, which use alternate data files).


 smiley  
Logged
WyrmMaster
Administrator
Sr. Member
*****
Offline Offline

Posts: 478



View Profile
« Reply #9 on: October 22, 2004, 02:29:48 PM »

With the assistance of a couple of Linux users, we appear to have resolved the choppy audio playback on some systems. An updated demo has been posted in the downloads area.

Thanks for everyone's help!
 
Logged
eriktorbjorn
Newbie
*
Offline Offline

Posts: 12



View Profile
« Reply #10 on: October 26, 2004, 09:07:45 AM »

Quote
With the assistance of a couple of Linux users, we appear to have resolved the choppy audio playback on some systems. An updated demo has been posted in the downloads area.

Great! I assume that once things have settled down a bit, there will be a similar update for the full game as well. (No need to hurry on my account, though. It's worked fine for me so far.)
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!