pulse4kill: bash script to kill pulseaudio temporarely and use ALSA
PulseAudio is a nice thing but has some issues.
My soundcard can’t use the passthrough if pulseaudio is enabled. All i can do is as a 2 channel downmix (too bad for a Media Center).
Since pasuspender don’t work for me, i could not find a better solution than create a script witch kills PA, add a flag to .pulse/client.conf to disable autorespawn, opens a specified program and wait until you close it. Than remove autorespawn flag and relaunch Pulseaudio.
Now my HTPC says thanks and me too: i can finally play wine games without audio lag.
sooo..
You can get it here:
wget http://www.takethesecoins.it/projects/p4k/0.1/p4k
than move to /usr/bin
sudo mv p4k /usr/bin/p4k
sudo chmod +x /usr/bin/p4k
Usage (example with xbmc):
p4k -n xbmc
or
p4k
to write in a popup the name of the application you wish to launch (like playonlinux).
Options:
-h print helps
-n <BINARY>
-i <NOTIFICATION_TYPE/INFO_LEVEL>
- notify = uses notify-send for notifications
- zenity = uses zenity for notifications
- quiet = system out with echo
- silent = no system out
-f application selection via file dialog instead of a text input (if no name [-n] is provided)
Remember that while active you cannot use pulseaudio mixer. Go with alsamixer or equivalent.
