[Wine] Re: Pulse audo in 1.3.25+

jorl17 wineforum-user at winehq.org
Mon Sep 5 12:28:23 CDT 2011

Let me try to make this clear.

Pulseaudio talks to ALSA. However, it is usually setup to talk to the ALSA device hw:0, which is the hardware. So, Pulseaudio hogs the hardware device and no other app can access it. This is ok, because ALSA is setup to route every other application (if that app is well configured) to another ALSA "device" called pulse, which, in turn, sends it to Pulseaudio. So when an application that uses ALSA directly runs, it goes like this:

App -> ALSA -> ALSA pulse device -> Pulseaudio -> ALSA hw:0 device (hardware).

Before Pulseaudio, as you may know, people used dmix to do software mixing. Sure, Pulseaudio offers a range of other features, but you can still use dmix today. The idea here is to have Wine "bypass" Pulseaudio completely, and talk to ALSA directly. To do this, Pulseaudio must stop "hogging" the hw:0 device, so it must go through another device we create called, for instance, dmixed. This dmixed device supports software mixing through dmix and, thus, can be accessed by Pulseaudio and other applications as well. It would still default to sending applications to Pulseaudio, but if you configured your application to request the dmixed device, you'd be bypassing the whole Pulseaudio "mess". So this is what would happen:

Regular App -> ALSA -> ALSA pulse device -> Pulseaudio -> ALSA dmixed -> hw:0 device (hardware).

Wine -> ALSA -> ALSA dmixed device -> hw:0 device (hardware)

Wine can be configured to do this with registry keys. The devices can be fairly easy created by editing the $HOME/.asoundrc file. The question here is how to redirect Pulseaudio to the ALSA dmixed device instead of the hw:0 one.

To be honest, since I moved to Gentoo I've left Pulseaudio completely. The only feature I missed was recording the PC sound and I've fixed that on my own with plain ALSA. However, I still remember doing something similar to this in ubuntu, so if it hasn't changed, you can change the default Pulseaudio alsa device from hw:0 by editing the /etc/pulse/default.pa file and adding the following at the end:
load-module module-alsa-source device=dsnoop:0
load-module module-alsa-sink device=dmixed:0

Of course this assumes that you have created a dsnoop device and a dmix device (in $HOME/.asoundrc). dsnoop allows for record software mixing and dmix for playback software mixing.

If you'd like to try this, do say, as it *might* help you solve your problems...let's just hope it doesn't add any other.


More information about the wine-users mailing list