[Wine] Re: Pulse audo in 1.3.25+

dardack wineforum-user at winehq.org
Wed Sep 7 21:10:29 CDT 2011


OK posting this in case someone else wants to do this.  This is for people on Ubuntu mainly, and who don't want to upgrade to 11.10 (fixes the pulse alsa plugin) on wine 1.3.27 (wine may fix it'self with the sound server rewrite, ubuntu has stated the plugin fix will not be backported because of new pulse API).

First create a ~/.asoundrc that has this:
(Edit the hw, or other options as needed for your card)

Code:
pcm.dsnooped {
       type dsnoop
       ipc_key 2048 #Any value at random. Really, any value.
       slave {
               pcm "hw:0" #Or whatever your card # is
       }
}

pcm.dmixed {
       type dmix
               ipc_key 5678293 #Any value at random. Really, any value.
               slave {
                       pcm "hw:0" #Or whatever your card # is
               }
}
ctl.dmixed {
	type hw
	card 0
	device 0
}

pcm.duplex_for_pulse {
       type plug
       slave {
               pcm {
                       type asym
                       playback.pcm "dmixed"
                       capture.pcm  "dsnooped"
               }
       }
}
ctl.duplex_for_pulse {
	type hw
	card 0
}




next edit /etc/pulse/default.pa  find the 

Code:
load-module module-udev-detect


line and comment it out:

Code:
#load-module module-udev-detect



then scroll to bottom of the file and add:

Code:
load-module module-alsa-sink device=duplex_for_pulse
load-module module-alsa-source device=duplex_for_pulse




then make a alsareg.reg file (or manually edit the registry of your wineprefix):

Code:
REGEDIT4
[HKEY_CURRENT_USER\Software\Wine\Alsa Driver] 1315011634
"AutoScanCards"="N"
"AutoScanDevices"="N"
"DeviceCount"="1"
"DeviceCTL1"="duplex_for_pulse"
"DevicePCM1"="duplex_for_pulse"
"UseDirectHW"="Y"




then in terminal:

Code:
WINEPREFIX="your prefix path here" regedit alsareg.reg




Open winecfg go to audio tab and make sure Alsa is checked and Emulation is selected.


now the next part are a few ways you can do.  You want updated alsa-plugins/alsa-lib but not alsa-driver/alsa-utils/linux-sound-base.  I used the ppa from these guys:
https://launchpad.net/~team-iquik/+archive/alsa
updated everything but alsa-base/alsa-utils/linux-sound-base, then removed the ppa.  You can also download the source code, compile/install it.

I rebooted at this point.  If your using 1.3.24 at least (I tested that), wine should use alsa directly, and regular apps should use pulse now.  1.3.27 will not get sound if something is using pulse, and if wine is using the soundcard pulse apps won't get sound.  So now comes the hackish part.

Follow the steps to compiling pulseaudio here:
http://colin.guthr.ie/2010/09/compiling-and-running-pulseaudio-from-git/

DO NOT DO sudo make install , you will probably mess up your whole sound if you do, and will prolly have to reinstall OS (happened to me, no amount of purges/reinstalls got my sound back).

Once you have it compilled, I rebooted.  I then have 3 scripts:

pulseAudiolib.sh

Code:
! /bin/bash
export LD_LIBRARY_PATH=/home/macnean/Programs/pulseaudio-0.9.23/build/src/.libs




I open terminal and run:

Code:
. pulseAudiolib.sh




Be mindful of the .<space> it allows the exported path to escape the single session

pulseSecondlib.sh

Code:
rm /home/macnean/.pulse/client.conf
echo "autospawn=no" >> /home/macnean/.pulse/client.conf
pulseaudio -k
~/Programs/pulseaudio-0.9.23/build/src/pulseaudio -n -F ~/Programs/pulseaudio-0.9.23/build/src/default.pa -p $LD_LIBRARY_PATH -vvv




run this script, and now you need to run something that uses pulse (vlc/totem/mumble/whatever) and pause it.
in that terminal hit CTRL C to end this local pulse

pulseThirdlib.sh

Code:
#! /bin/bash
rm /home/macnean/.pulse/client.conf
pulseaudio




And that's it.  1.3.27 will now use ALSA straight up, and all pulse items can use the sound card.  Not sure anyone else cares, but posting it here for documentation sake incase my HD crashes or something.[







More information about the wine-users mailing list