Pulse audo in 1.3.25+

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
dardack
Level 3
Level 3
Posts: 98
Joined: Mon Sep 05, 2011 3:24 pm

Post by dardack »

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: Select all

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: Select all

load-module module-udev-detect
line and comment it out:

Code: Select all

#load-module module-udev-detect
then scroll to bottom of the file and add:

Code: Select all

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: Select all

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: Select all

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 ... -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: Select all

! /bin/bash
export LD_LIBRARY_PATH=/home/macnean/Programs/pulseaudio-0.9.23/build/src/.libs
I open terminal and run:

Code: Select all

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

pulseSecondlib.sh

Code: Select all

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: Select all

#! /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.[
Atroxus
Newbie
Newbie
Posts: 2
Joined: Tue Jul 26, 2011 6:14 pm

Post by Atroxus »

I tried out dardack's guide. I got as far as using alsareg.reg and that gave me what I wanted for sound (mostly).

Wine(?) still seems to have trouble recognizing multiple sound cards though.

Card 1: hw:0 internal audio (ALC892)
Card 2: hw:1 Logitech USB headset (USB Audio)

I duplicated the asoundrc config and the registry entries for my second sound card but Wine will only use whatever is specified as PCM1 (but only sometimes)

Pulse works with both cards no prob with and without wine running.

I can switch which sound card wine is using with the registry. Works with WoW, Portal 2, Civ V, Oblivion (but not the launcher oddly) and Doom 3.

Bioshock was kinda weird on the main menu, menu sounds were from my internal sound card and ambient noise was from my Logitech headset (hw:1). In game it was using my internal sound card which it should not have been. Same with Super Meat Boy.

Ubuntu 10.04 Wine 1.3.27 Pulse 0.9.22
dardack
Level 3
Level 3
Posts: 98
Joined: Mon Sep 05, 2011 3:24 pm

Pulse audo in 1.3.25+

Post by dardack »

The reg will if Pulse doesn't want to grab sound later. Maybe with 2 sound
cards it works better. But on mine if Pulse has grabed the Soundcard at
this point, wine won't be able to use it for some reason. (at least 1.3.27
wine, 1.3.24 worked fine at this point).

Did you change the name pcm.dmixed/mixin for the second card, they can't
have the same name, you also have to change the HW#. It could be why you're
having sound go across multiple sound cards. Then create duplex2 or
something.

BTW you using 1.3.27 wine?

On Thu, Sep 8, 2011 at 12:17 PM, Atroxus <[email protected]> wrote:
I tried out dardack's guide. I got as far as using alsareg.reg and that
gave me what I wanted for sound (mostly).

Wine(?) still seems to have trouble recognizing multiple sound cards
though.

Card 1: hw:0 internal audio (ALC892)
Card 2: hw:1 Logitech USB headset (USB Audio)

I duplicated the asoundrc config and the registry entries for my second
sound card but Wine will only use whatever is specified as PCM1 (but only
sometimes)

Pulse works with both cards no prob with and without wine running.

I can switch which sound card wine is using with the registry. Works with
WoW, Portal 2, Civ V, Oblivion (but not the launcher oddly) and Doom 3.

Bioshock was kinda weird on the main menu, menu sounds were from my
internal sound card and ambient noise was from my Logitech headset (hw:1).
In game it was using my internal sound card which it should not have been.
Same with Super Meat Boy.

Ubuntu 10.04 Wine 1.3.27 Pulse 0.9.22





--
Sincerely,

MacNean C. Tyrrell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-us ... hment.html>
Atroxus
Newbie
Newbie
Posts: 2
Joined: Tue Jul 26, 2011 6:14 pm

Re: Pulse audo in 1.3.25+

Post by Atroxus »

dardack wrote:The reg will if Pulse doesn't want to grab sound later. Maybe with 2 sound
cards it works better. But on mine if Pulse has grabed the Soundcard at
this point, wine won't be able to use it for some reason. (at least 1.3.27
wine, 1.3.24 worked fine at this point).
I am not having this issue on 1.3.27. There's no conflict between wine and pulse that I have seen. I could just be lucky though. I don't think I was having near as many issues with sound after 1.3.25 came out as some other people though.
dardack wrote: Did you change the name pcm.dmixed/mixin for the second card, they can't
have the same name, you also have to change the HW#. It could be why you're
having sound go across multiple sound cards. Then create duplex2 or
something.
I suffixed everything with 0 or 1 depending if it was hw:0 or hw:1. Works great except in the few circumstances I noted.
dardack wrote: BTW you using 1.3.27 wine?
Yup. I had to download the 1.3.27 deb from the natty repo though since there is no 1.3.27 build for lucid yet.

Also many thanks for putting that little guide together!
dardack
Level 3
Level 3
Posts: 98
Joined: Mon Sep 05, 2011 3:24 pm

Pulse audo in 1.3.25+

Post by dardack »

You can thank Jorl17, that dude helped me a ton with the Alsa
settings/.asoundrc/default.pa stuff.

Ahh your on lucid? hmmm, i'm on maverick. Wodering if updated pulse or
alsa causes the conflict grabbing of the HW. I know there were some bugs in
the pulse code /alsa pulse plugin.

Yea I was using wine-pulse patches in 1.3.24 so was a shock when .25/26 came
out. Since I haven't overridden permantly my built in pulse, I'm gonna do
testing once .28 comes out to see if all the pulseaudio stuff is needed. I
really hope not, pita.


Also, the multimedia-git with pulse sound compiled in I believe is coming
along, so waiting to see where that goes. For now I have sound everywhere,
just everytime I reboot I gotta do some funky stuff if I want to play games
(which has been decent amoutn lately when I'm not messing with the
sound/compiling stuff).



--
Sincerely,

MacNean C. Tyrrell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-us ... hment.html>
Locked