1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[How to] Fix WINE underrun occurred problem

Discussion in 'Linux Guides (Generic)' started by allenskd, Feb 7, 2014.

  1. booman

    booman Grand High Exalted Mystic Emperor of Linux Gaming Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    7,497
    Likes Received:
    542
    Trophy Points:
    113
    Location:
    Linux, Arizona
    Home page:
    I may try this one time, but I won't expect new gamers to do stuff like this...
    It will be that one time support where someone can't get their audio to work with any game...
  2. allenskd

    allenskd Active Member

    Joined:
    Feb 5, 2014
    Messages:
    510
    Likes Received:
    51
    Trophy Points:
    28
    @booman:

    It's kinda impossible[1] to stay without audio in GNU/Linux :). If PulseAudio doesn't work and it's not running then WINE will use the one true driver (as in, without getting rerouted to PulseAudio/JACK), ALSA. So even if you remove PulseAudio you will still have audio, but you will need to change plenty of applications to ALSA backend (which isn't hard at all).

    Just wanted to mention this in case people fear getting their audio system screwed up. Take it from me at least who have toyed with PA plenty of times :). Even desktop environments like KDE will automatically change to ALSA if PA isn't running.

    For example, if audio is screwed up with WINE, another workaround is suspending PulseAudio.

    pasuspender -- wine [PATH_TO_GAME]

    [1]: As long as your audio devices works with ALSA then you will have audio. PulseAudio is a commodity, kinda, I can't live without the volume per application feature because more than often I'm running several audio streams.
  3. booman

    booman Grand High Exalted Mystic Emperor of Linux Gaming Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    7,497
    Likes Received:
    542
    Trophy Points:
    113
    Location:
    Linux, Arizona
    Home page:
    Gotcha, so if I remove Pulseaudio I will still have audio for my games in Wine/PlayOnLinux.
    I was just hoping that installing an old Pulseaudio would be like installing Wine or PlayOnLinux.
  4. allenskd

    allenskd Active Member

    Joined:
    Feb 5, 2014
    Messages:
    510
    Likes Received:
    51
    Trophy Points:
    28
    Well, usually you would just do a sudo apt-get install build-dep pulseaudio and it will install all the dependencies it requires to build it, making it easier for the user to compile the source.

    You could go for it... I still need to see down and check the Debian package. What if something goes wrong? Simply do this:

    In case you never removed pulseaudio, install the package back from the repos:
    sudo apt-get install pulseaudio --reinstall

    or if you did remove it, install it again.

    Compiling it is pretty easy as you just do ./configure --prefix=/usr

    If you leave pulseaudio installed (as in you never did sudo apt-get remove pulseaudio), follow ThunderRD instructions on holding packages because any update will override it.

    It make look a little complex at first if you are new to it. Once you get the hang of it it's really a straightforward process.
  5. booman

    booman Grand High Exalted Mystic Emperor of Linux Gaming Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    7,497
    Likes Received:
    542
    Trophy Points:
    113
    Location:
    Linux, Arizona
    Home page:
    Not to bad for me cause I've been using Linux for years (monthly) and every day for the last year.
    But its those beginners who fear the command line.... ;)

    Sounds pretty easy... so this will install an older version of Pulseaudio? I have a feeling Mint won't support it in case I have problems.
  6. allenskd

    allenskd Active Member

    Joined:
    Feb 5, 2014
    Messages:
    510
    Likes Received:
    51
    Trophy Points:
    28
    I'm currently compiling PulseAudio 5.0 on my Debian Wheezy. By definition Debian stable has plenty old packages :) I hope that answer your question that sometimes, unless the library of the project changes and they are forced to do a version bump in its dependencies then it does not matter. :)

    It's a pain in the ass. I just finished compiling/installing it and I couldn't make it work completely make it work. I don't think I'll be taking a deeper look anytime soon though, sorry. :(
  7. booman

    booman Grand High Exalted Mystic Emperor of Linux Gaming Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    7,497
    Likes Received:
    542
    Trophy Points:
    113
    Location:
    Linux, Arizona
    Home page:
    Not a problem. I'm currently not having a lot of issues with audio. Just certain games.
  8. Izberion

    Izberion New Member

    Joined:
    Aug 10, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Hey just signed up to comment here. I remember you mentioning the underrun problems on PoL forums a little while ago Booman, and I've been trying to find some solutions related to it I've been lately, leading me to this thread.

    I fixed my underrun errors some months ago by installing jackd and running it with pulseaudio. That however, has it audio balance problems and it seems like I'm the only person on the internet with that particular issue. Though it is fixed by manually adjusting the audio of every single application to balance it.

    Occasionally I look for a solution, but there isn't just a basic balance slider in kwin. After I give up with that, I look for underrun solutions, thinking maybe I won't need to use jackd and I can get my balance back. But I never find a solution that works. The method in OP I've tried to no success.

    My next attempt is trying to attack the problem though Wine, as that's the only time I get underrun errors. It's easy to ignore the audio problems in Hearthstone, but not League of Legends.

    If you're looking for a quick solution to the underrun errors, try installing jackd. Hopefully you won't be getting the balance problems I get.
  9. allenskd

    allenskd Active Member

    Joined:
    Feb 5, 2014
    Messages:
    510
    Likes Received:
    51
    Trophy Points:
    28
    I was preparing a guide for JACK setup. There's a reason why I haven't though, it's not stable.

    There are situations where JACK/ALSA may lose the connections on each side. In Guild Wars 2, which is the game I've been testing audio setup, it would so happen that either JACK or ALSA could "disconnect" from each other. I still don't know why.

    The best setup that worked for me was the PulseAudio bridge with JACK.
  10. booman

    booman Grand High Exalted Mystic Emperor of Linux Gaming Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    7,497
    Likes Received:
    542
    Trophy Points:
    113
    Location:
    Linux, Arizona
    Home page:
    Thanks for posting your experience Izberion!
    I have read a lot of good things about JACK, but haven't experimented with it yet.
    Seems like a lot to troubleshoot, Alsa, Pulseaudio and JACK.
    Right now I'm not having a lot of audio problems. It seems to be only a few select games.
    Otherwise, most of my tests run very nice.
  11. Izberion

    Izberion New Member

    Joined:
    Aug 10, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    I didn't try to get the alsa jackd bridge working because pulseaudio with jackd is so much easier to set up. And because I'm constantly on Skype, removing pulseaudio is no longer an option just because it's required with the latest (forced) update.
  12. ThunderRd

    ThunderRd Irreverent Query Chairman Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    1,877
    Likes Received:
    65
    Trophy Points:
    48
    Location:
    Northern Thailand, the Land of Smiles
    Home page:
    I've been trying to break my jack/alsa duo and can't. Seems it is quite stable on my box but then, I'm probably not doing anything fancy.
  13. allenskd

    allenskd Active Member

    Joined:
    Feb 5, 2014
    Messages:
    510
    Likes Received:
    51
    Trophy Points:
    28
    Well the good news is that I also use Skype and I had the headset working just fine with the Pulseaudio and JACK bridge. The thing about it is that it doesn't resolves the real issue. If you have multiple soundcards then you will have to load each of them in JACK and well.... let's just say I wasn't willing to accept it.

    I forgot to mention something important about the JACK/ALSA setup. I don't know if this applies for all users but it breaks your Steam linux environment in the sense that even if you have set up an .asoundrc file, it still misses libraries that supports JACK. (This is because Steam ships its own libraries to create the environment)

    I created a ticket a month ago. I'm still waiting for official word. There was a user that ran into the same issue and posted a solution to get it working but I'm waiting for an official fix.

    Note:
    I really haven't tested anything related to audio for quite a while. Honestly I need a break, I spent too much time with JACK setup and testing it with other games. The setup works correctly 99% but like I said above it could sometime create this weird conflict and lose audio.
  14. Izberion

    Izberion New Member

    Joined:
    Aug 10, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    So I might have broken my audio completely with Wine. Did a little fiddling after finding this and now KDE crashes every time a program in Wine makes a sound. Undoing the changes hasn't helped. But that's the point of running Debian testing and experimenting with the system. Break and repair.
  15. Izberion

    Izberion New Member

    Joined:
    Aug 10, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Turns out I just had to reinstall my video drivers. After I went and purged everything down to ALSA to rebuild it too.
  16. allenskd

    allenskd Active Member

    Joined:
    Feb 5, 2014
    Messages:
    510
    Likes Received:
    51
    Trophy Points:
    28
    What files did you exactly tweak?

    Although it won't matter but I moved to Kubuntu (by far one of the best KDE experience ever, I'm hoping Debian jessie provides the same experience but I'm not holding my breath on it). I'm using pulseaudio 4.0 and I took a leap of faith and did the Arch Linux wiki solution of altering fragments buffer/size and it worked. (it didn't before)

    open your /etc/pulse/daemon.conf

    default-sample-rate = 48000
    default-fragments = 5
    default-fragment-size-msec = 2

    Those are my settings. You still WILL run into underruns but the difference now is that PulseAudio will catch up and normalize eventually. I still had better experience with PulseAudio 2.0 though...

    After altering the settings in daemon.conf

    do $ pulseaudio -k

    Kill the server and it will automatically spawn again with the new settings.

    Now if you did a mess in pulseaudio configurations then simply do this

    apt-get purge pulseaudio; apt-get install pulseaudio -y

    Purging the files should remove all the configurations you have tweaked regarding pulseaudio. Installing will bring back stock configurations in place.
  17. booman

    booman Grand High Exalted Mystic Emperor of Linux Gaming Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    7,497
    Likes Received:
    542
    Trophy Points:
    113
    Location:
    Linux, Arizona
    Home page:
    this worked for me as well in Mint 17 64-bit
    I wasn't getting a lot of buffer underrun errors, but after a few, I tried it.
  18. Izberion

    Izberion New Member

    Joined:
    Aug 10, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    I only edited the daemon and default files. Shouldn't have broken my video drivers.

    After I reinstalled Pulseaudio and Jackd, and configured Pulse to detect Jackd and load the modules for it, my sound wasn't unbalanced and it ran perfectly. Literally perfect. My mic doesn't have much white noise anymore either (it's a problem the Razer Megalodon has on all systems). The only thing I didn't purge was qjackctl, though it only starts the Jackd server and points Jackd to use my Megalodon for input and output. But the rest of the configurations were default with the exception of loading the Jackd modules in Pulseaudio.

    I'm not sure how my video drivers broke, but it happens enough to me with pretty frequent mesa and xorg updates on Debian Jessie that I should have known KDE was crashing because of the video drivers. But it's not a problem since sgfxi is a thing.
  19. allenskd

    allenskd Active Member

    Joined:
    Feb 5, 2014
    Messages:
    510
    Likes Received:
    51
    Trophy Points:
    28
    Yea, the Pulseaudio/Jackd combination is probably one of the best things. I only ran into problems with Guild Wars 2 where ALSA/Jack kept losing connection. That said, it's an incredibly solid setup.

Share This Page