Jump to content
The Dark Mod Forums

Recommended Posts

Posted

I've created a patch to fix the problem where audio would sometimes start popping/crackling when the game starts. And in the cosole this would be seen repeated:

snd_pcm_writei 4096 frames failed: Broken pipe

preparing audio device for output

I have a feeling that this fix is more of a kludge that works around the issue, rather than fixes it at the source. However, it does appear to work well enough to mask the problem.

Changes:
-If a call to snd_pcm_writei() returns an EPIPE error it will re-prepare the connection and then try to send the audio data again, but it will also try to send a partial duplicate. The number of frames duplicated is set by 's_alsa_underrun_extrafill'.


I've only tested it on Linux Mint 17.2, 64 bit.

 

tdm-linux-sound-fix.txt

  • Like 2
Posted

Is there any chance this is related to #4148 do you think? That happened a lot at map start, and randomly at other times. The bug is still in the current TDM 2.03 release, but it'll be fixed in the next version.

 

The bug was in the calculation of 3d sound propagation, so only happened during play. If your bug happens on menu screens, that'd be different. What the bug does is cause the result of a division-by-zero (a NaN) to be fed into the sound card.

Posted

Good to see somebody working on the Linux issues. I suppose the "gold standard" solution to this issue would be to add full PulseAudio support (for better or worse, PA is now the standard on Linux desktops), but obviously that would require somebody with a lot of time and familiarity with PulseAudio client development.

  • 2 weeks later...
Posted

In the patch, the CVAR added should be some sort of integer and capped to some sabe values, like mininum 256 (or something > 0) and maximum (4096?). Otherwise a wrong setting of that variable could cause havoc.

"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

Posted

I forgot the specifics, but it is possible to declare CVARS as int (so nobody can set it to "4.5" or even "abc" :) and add min/max values.

"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

Posted

I forgot the specifics, but it is possible to declare CVARS as int (so nobody can set it to "4.5" or even "abc" :) and add min/max values.

CVAR_INTEGER in the flags. But I see from the tracker update that NagaHuntress got to it already.
Posted

Thanks again for another patch. Committed at rev 6529.

 

I can't test-compile code hidden from my MS system by compiler switches, but I'll ask grayman for the release packaging software so I can check the build works with any changes. I'm a bit clueless around OSes.

Posted

I've figured out how to set the CVar as an integer and how to clamp it's range. I've uploaded a new patch to the bug tracker.

 

Thank you kindly. :)

"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

  • 2 years later...
Posted

Thanx for your fix! Unfortunately I do not know how implement it (copy it somewhere I gues?!). Fortunately I found out that I have to switch my card to 44.1 Khz before starting the game. There're diferent ways to do that on Linux, so maybe that might help someone.

 

I use an E-MU1212m with a creative chipset and the emu10k1 driver, btw.

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

    • JackFarmer

      "The Year of the Rat." 
      😄

      Al Stewart must be proud of you!
      Happy testing!
      @MirceaKitsune
      · 1 reply
    • datiswous

      I posted about it before, but I think the default tdm logo video looks outdated. For a (i.m.o.) better looking version, you can download the pk4 attached to this post and plonk it in your tdm root folder. Every mission that starts with the tdm logo then starts with the better looking one. Try for example mission COS1 Pearls and Swine.
      tdm_logo_video.pk4
      · 2 replies
    • JackFarmer

      Kill the bots! (see the "Who is online" bar)
      · 3 replies
    • STiFU

      I finished DOOM - The Dark Ages the other day. It is a decent shooter, but not as great as its predecessors, especially because of the soundtrack.
      · 5 replies
    • JackFarmer

      What do you know about a 40 degree day?
      @demagogue
      · 4 replies
×
×
  • Create New...