Thursday Night

Paul Betts’s personal website / blog / what-have-you

Make Wine and PulseAudio get along

19 comments

I got a Joost invite the other day, and I tried to get the client program working with Wine, the Linux implementation of the Win32 API. Sadly, it was a no-go; I couldn’t get it to work without skipping. However, it’s not all lost: here’s what I learned, the “best” way to get sounds working in Wine, at least until a native PulseAudio driver gets written.

First, we need to set up Wine correctly. Run this command to set up Wine:

padsp winecfg

The padsp part is important, it makes a virtual OSS device that will talk to the PulseAudio daemon. Next, go to the Audio tab and make sure the settings look like this:

Update: It seems I’ve lost this picture, go to the Audio tab and set the OSS device.

While my initial leaning was to use the ALSA or ESound driver as they would both theoretically work better, ALSA wouldn’t work at all and ESound had issues with skipping (either it’s naively coded or difficult to do in Wine, not sure; I’d guess the latter). So we can use the OSS driver, yet have full mixing and no weirdness due to using the virtual device. Next, to run the program (in this example, we’ll use Starcraft ;) )

padsp wine ~/.wine/drive_c/Program\ Files/Starcraft/starcraft.exe

You should have sound playing without any problems – I don’t know if this method would stand up to a lot of stress though, it uses emulated DirectSound but I had no problem with SC.

Written by Paul Betts

May 27th, 2007 at 7:42 pm

Posted in Linux, Microsoft

19 Responses to 'Make Wine and PulseAudio get along'

Subscribe to comments with RSS or TrackBack to 'Make Wine and PulseAudio get along'.

  1. Ah joost. I wanted to try it but none of my friends has account there!
    Sorry, but can you give me an invitation so that i can try it? please.. :)

    Many thanks!

    Galuh

    28 May 07 at 5:09 am

  2. I think the picture for winecfg is missing.

    Thanks for this post.

    Irq5213

    15 Apr 08 at 4:55 am

  3. Adding yourself to the pulse-rt and pulse-access groups might help with the sound skipping. Or running the game with nice.

    hellork

    25 Apr 08 at 4:07 am

  4. @irq5123: Appears to be lost – sorry about that!

    Paul Betts

    27 Apr 08 at 12:14 am

  5. following these directions, I could not get Dragon NaturallySpeaking to run. I think I need to know what the winecfg settings were. Was it just that oss was checked, or was there more?

    susan cragin

    18 May 08 at 12:06 pm

  6. @susan: I believe that’s it, though you could also try the ALSA or esound driver, though getting NaturallySpeaking to run probably won’t be useful as it’s pretty integrated into the Windows environment (i.e. you couldn’t start GEdit from NaturallySpeaking for example).

    Paul Betts

    18 May 08 at 1:41 pm

  7. Thanks! :)

    Mullwar

    29 Jun 08 at 4:24 am

  8. I successfully used pulseaudio through alsa with wine:

    $ cat /etc/asound.conf
    pcm.pulse {
    type pulse
    }

    ctl.pulse {
    type pulse
    }

    #pulse as default:
    pcm.!default {
    type pulse
    }

    ctl.!default {
    type pulse
    }

    You need pulseaudio alsa plugin (in alsa-plugins package on gentoo)

    In winecfg set alsa as device and set 8 bit sound. Done =)

    (OSS works with your method but I always gets a too high volume as Ive maxxed my card volumes to let pulseaudio control the volume (its weird it doesnt respect pulseaudios config though as it is padsp..))

    Thomas A

    17 Jul 08 at 5:21 am

  9. @Thomas A: I used to use this method too, but the problem is everything is completely hosed if PA crashes – since PA hooks the ALSA libraries already, you don’t need to do this.

    I’d actually set the native card volumes to ~80%, because at maximum the audio will start to clip (it’ll sound like crackling)

    Paul Betts

    17 Jul 08 at 11:19 am

  10. “… at least until a native PulseAudio driver gets written.” Done.

    Arthur Taylor

    6 Dec 08 at 9:23 am

  11. Arthur Taylor

    6 Dec 08 at 9:26 am

  12. [...] managed to hack spotify to work with pulse audio and wine so thanks to the admin at that link for their post! Thats amazing, all my music is on their so [...]

  13. thanx!!

    NiV

    3 Dec 09 at 7:48 am

  14. Thanks for this tip. Solved my laggy audio with Wine/Spotify in Ubuntu. Merry x-mas.

    Nils

    18 Dec 09 at 4:19 am

  15. Thank you very uch! Now I can finally use spotify under linux :D

    Simon

    22 Dec 09 at 9:43 am

  16. It looks like it fixed my problem when running WoW under wine :)

    Andrea Grandi

    12 Jan 10 at 9:09 am

  17. [...] Luckily the massive wisdom of teh intarwebs came to the rescue again, this time through an almost three year old post by Paul Betts: “Make Wine and PulseAudio Get Along“. [...]

  18. Worked! cheers!

    dominic

    20 Jan 10 at 9:15 am

  19. Thanks, that resolved my sound problems (Ubuntu 9.10 x64, Wine 1.0.1)!

    Thomas

    27 Feb 10 at 12:56 pm

Leave a Reply