Jump to content
The Dark Mod Forums

(linux) launching TDM with pasuspender


shazzner

Recommended Posts

I'm on Ubuntu 10.10, I unfortunately have problems with the common pulseaudio sound delay bug. I can run Doom 3 fine, but I have to prepend pasuspender (which suspends pulseaudio for the application) before doom3. With TDM it seems to launch the doom3 engine differently.

 

Just running:

 

pasuspender -- ./tdmlauncher.linux

doesn't work unfortunately, and dmargs are only appended to the doom3 engine.

 

Any ideas on this? Besides just removing pulseaudio.

 

 

Link to comment
Share on other sites

Have you tried to swap between ALSA and OSS? From what I remember of the last time we had questions about this, some people have success doing that (args passed to the launcher will be passed to doom3 too, might be handy to remember)

 

Setting it to OSS just crashes for me.

 

 

I can get it to work* by closing every other sound device and running it, but this is kind of a sloppy work around. I was thinking I could add pasuspender to dmargs and it would prepend that when TDM goes to launch doom3.

* In alsa

 

 

Edited by shazzner
Link to comment
Share on other sites

Going to the audio settings and toggling surround sound a few times will clear the delay, but it's tedious.

 

I use the wrapper script below to disable pulseaudio for the duration of the game. It also disables repeating keys to make leaning reliable.

 

(Attachment removed - update posted below.)

Edited by snobel
Link to comment
Share on other sites

Going to the audio settings and toggling surround sound a few times will clear the delay, but it's tedious.

 

I use the wrapper script below to disable pulseaudio for the duration of the game. It also disables repeating keys to make leaning reliable.

 

(Attached because even within CODE tags, the forum software would break it.)

 

Awesome, I'll try this out an report back later today.

Link to comment
Share on other sites

As a bonus, the game is portable instead of having to be in the ~/.doom3 folder.

 

Would a portable game possible with symlinks, anyway?

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Just with hardlinks, though it would have to be done for all files (doesn't work on dirs) and wouldn't work across filesystems (drives either).

 

(hardlinks point to the real physical file data, not it's mapping on the filesystem. SO if you delete the original, the "file" remains. If you move the "original" it doesn't matter either, you just moved pointers pointing to a location on the drive, not the location itself, etc)

 

If you had the original source i guess this limitation wouldn't happen right?

Edited by i30817
Link to comment
Share on other sites

Going to the audio settings and toggling surround sound a few times will clear the delay, but it's tedious.

 

I use the wrapper script below to disable pulseaudio for the duration of the game. It also disables repeating keys to make leaning reliable.

 

(Attached because even within CODE tags, the forum software would break it.)

 

Just posting that this worked perfectly, thanks!

 

 

This should probably be added to the wiki for anyone else with pulseaudio problems.

 

 

Link to comment
Share on other sites

Just with hardlinks, though it would have to be done for all files (doesn't work on dirs) and wouldn't work across filesystems (drives either).

 

(hardlinks point to the real physical file data, not it's mapping on the filesystem. SO if you delete the original, the "file" remains. If you move the "original" it doesn't matter either, you just moved pointers pointing to a location on the drive, not the location itself, etc)

 

I wonder why softlinks don't work?

 

If you had the original source i guess this limitation wouldn't happen right?

 

Probably :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Just posting that this worked perfectly, thanks!

You're welcome. I forgot to mention that the key-repeat fix is GNOME specific.

 

Hopefully in a year or so, when the Doom3 source is released, this bug (and quite a few other Linux issues) can be fixed the right way.

Link to comment
Share on other sites

You're welcome. I forgot to mention that the key-repeat fix is GNOME specific.

 

Hopefully in a year or so, when the Doom3 source is released, this bug (and quite a few other Linux issues) can be fixed the right way.

Hopefully soon, yeah. People get on PA's case all the time, but it really seems to be a bug specific with Id Tech4.

 

 

 

Link to comment
Share on other sites

  • 4 weeks later...

Good news: since 1.04 I can run TDM on Linux again. :)

 

Bad news: I "upgraded" to Ubuntu 10.10 (Maverick) in the meantime which will just break my working sound in the mod forever as it seems. :angry:

 

Like others I am experiencing the "sound lags behind the picture" issue on my hardware. Workaround was to set s_driver to oss and make sure there is a /dev/dsp (udev occasionally named it dsp1; not willing to learn udev rules i "fixed" it with sudo ln /dev/dsp1 /dev/dsp).

 

In Maverick some keen ubuntu devs decided to give things a little push towards PulseAudio -- by removing backwards compatibility, burning the bridges and setting up a minefield between OSS and Ubuntu. Looksie ("bug"-report in launchpad).

 

Getting back to a 10.4-like solution involves compiling a kernel myself -- DO NOT WANT.

Snobel's script (above) does not work for me -- it results in no sound at all (thanks for sharing, anyway B)).

Pasuspender never seemed to make any difference anywhere for me.

 

I tried using padsp -- a PA command that emulates /dev/dsp for the applications you run with it (but is considered deprecated). Didn't help much.

 

:wacko:

 

Ideas?

Link to comment
Share on other sites

Same problem, here: strong sound lag using standard default ALSA driver (i'm Ubuntu 10.10 32bit).

 

In the past versions, toggling on/off from surround setting in the menu few times, solved the problem (very annoying indeed), but now with the 1.04 sound it's not working anymore also if i try switching on/off in surround settings on the the game menu GUI, the sound start in sync but it stops after half a second :-(

 

And if I switch to OSS and start with this driver, the game crash on start.

 

Any suggestion or workaround?

Link to comment
Share on other sites

10.10, 32 bit, just like my system.

 

Toggling surround still works on my machine with 1.04, behaves like an (unreliable) switch to force the sound back in sync after dropouts causing the lag. But it has been mentioned this is not even a workaround.

 

It is strange using OSS crashes your game. Usually doom simply disables its sound-subsystem when the configured sound device is absent.

Link to comment
Share on other sites

10.10, 32 bit, just like my system.

 

Toggling surround still works on my machine with 1.04, behaves like an (unreliable) switch to force the sound back in sync after dropouts causing the lag. But it has been mentioned this is not even a workaround.

 

It is strange using OSS crashes your game. Usually doom simply disables its sound-subsystem when the configured sound device is absent.

 

I solved killing pulseaudio manually before launching TDM :-D

 

BTW:

 

To stop pulseaudio, type: sudo killall pulseaudio

To restart pulseaudo (if needed): pulseaudio --start

 

Now it works :-)

 

Maybe i'll do a little script to run the game with my settings (e to restore my right resolution and mouse sensibility on exit).

Link to comment
Share on other sites

Snobel's script (above) does not work for me -- it results in no sound at all (thanks for sharing, anyway B)).

Are you sure TDM is set to use alsa? If I set it to use oss, I get no sound at all...

 

Do you have sound if you shut down pulseaudio manually with 'pulseaudio --kill' from the terminal? (Remember to stick 'autospawn=no' in ~/.pulse/client.conf or it will pop up again like a zombie...)

 

Btw. the version of the script posted above does not take into account that the doom3 process relaunches on mission install, that is corrected in the attached version

tdmlauncher.txt

Edited by snobel
Link to comment
Share on other sites

When I kill PA doom finds ALSA at startup, tries to open the "default" device and fails. The device is set via a cvar, so it is propably fixable once I have an idea about the way ALSA is set up on my machine.

 

But there is a pizza waiting for me now.

Link to comment
Share on other sites

  • 4 months later...

I used to have s_driver set to 'oss', and TDM worked well for a long time like that. On occasion I would start the game and have no audio (/dev/dsp not found) and have to switch the driver to alsa, but then have to deal with the audio delays and turn surround on and off several times during an FM to fix it.

Recently, after several updates to Mandriva Cooker (2012 early-alpha right now), I ended up with no OSS and the delays with alsa could not be fixed with turning surround on and off.

 

I'm glad I came to read this thread, because I was unaware of the 'padsp' command, which allowed me to use 's_driver oss' again, and fix the audio. What I wonder is... what had been happening before with pulseaudio which enabled oss (/dev/dsp) emulation to allow me to use OSS in TDM? Imean, before I knew of the ''padsp' command, what application would have made use of it and made oss available to TDM?

 

In any case, I was about to create a new topic to complain about my broken audio but running padsp did the trick.

System: Mageia Linux Cauldron, aka Mageia 8

Link to comment
Share on other sites

  • 4 weeks later...

Picking up where I left:

 

I got it working, no lagging on Ubuntu 10.10 via ALSA and without suspending pulse audio. It is like they say on id's doom on linux site: "A lot of Alsa installations have a misconfigured default device." There is a cvar called s_alsa_pcm with the default value default. Instead of default, which seems to be error prone, you can put the ALSA playback device of your choice there. Make sure s_driver is set to "best", s_numberofspeakers to "2" (for stereo).

 

To determine your playback devices, open a terminal and type

 

aplay -L

 

should give you something like this:

 

[ . . . ]

dsnoop:CARD=Live,DEV=3

SB Live! 5.1 [sB0220], Multichannel Playback

Direct sample snooping device

hw:CARD=Live,DEV=0

SB Live! 5.1 [sB0220], ADC Capture/Standard PCM Playback

Direct hardware device without any conversions

hw:CARD=Live,DEV=2

SB Live! 5.1 [sB0220], Multichannel Capture/PT Playback

Direct hardware device without any conversions

hw:CARD=Live,DEV=3

SB Live! 5.1 [sB0220], Multichannel Playback

Direct hardware device without any conversions

plughw:CARD=Live,DEV=0

SB Live! 5.1 [sB0220], ADC Capture/Standard PCM Playback

Hardware device with all software conversions

[ . . . ]

 

This is the name of the device (1st line) followed by a description (lines 2 and 3). The complete list contains all the audio stuff on your system, so it can get pretty long (on-board-sound, soundcard, hdstuff from the videocard etc.). From the ones above on my system I can use plughw:CARD=Live,DEV=0 or hw:CARD=Live,DEV=0, which is because PCM Playback is what we want to do. :)

 

You can pass these unconvenient device names via the command line, in TDM I added

 

+set s_alsa_pcm hw:CARD=Live,DEV=0

 

to my dmargs.txt.

 

This seems the preferred solution to the problem since it avoids OSS in the first place, so there is no need to rely on an OSS-compatible kernel (which are soon to be extinct) or emulations like padsp, aoss or ossp.

 

Linux and audio. It's a real mess.

:wacko:

Link to comment
Share on other sites

Picking up where I left:

 

I got it working, no lagging on Ubuntu 10.10 via ALSA and without suspending pulse audio.

 

Thanx for figuring that out, it should be added to our FAQ on the wiki.

 

Linux and audio. It's a real mess.

:wacko:

 

Oh yeah :( Video playback isn't much better...

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

You'd be surprised how many things work absolutely perfectly if you only build in support for OSS :)

 

My moms box even runs skype-oss via a linux emulation layer to native oss, zero configuration and it works perfectly. I used to use the current alsa/linuxsound version, oh what a nightmare.

 

If only common components would avoid all this retarded feature creep, I mean look at some of the audio backend capabilities when you're bored and try figure out a reason to even use some of the stuff. The video stuff is just as bad, gotta get some more backends, never enough I WANT THEM ALL.

Link to comment
Share on other sites

I needed a good laugh, so I checked out the bug that Plasticman linked to. My personal favorite: "This is unfortunate, but the solution is to fix the programs to use the new configuration."

 

Hey id, stop working on Rage and fix Doom's sound code for me! :) Hey 3D Realms, would you mind fixing... oh wait you don't exist anymore.

 

If you switch to Debian, you don't have these problems. Pulseaudio is optional and is not installed by default. Same goes for Arch I believe.

Edited by lost_soul

--- War does not decide who is right, war decides who is left.

Link to comment
Share on other sites

I updated the linux sound lags part in the FAQ. It's based on what it looks like on my system and some reading about Pulse, OSS and ALSA I did in the last few days.

 

I do not recommend to "simply" uninstall PulseAudio, since it is not exactly the elegant way of doing things. Changing the defaults your distribution ships with will likely cause issues, like "Cool, I can play DarkMod now, but where went that volume control on me desktop?"

 

For the major distributions it looks like OSS is the past, ALSA in conjunction with PulseAudio the future -- It's not going away anytime soon, so we'd better explore strange new ways of dealing with it . . .

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
×
×
  • Create New...