Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Limit Pulseaudio to Skype or USB Headset
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
larophel
n00b
n00b


Joined: 19 Mar 2005
Posts: 54

PostPosted: Tue Sep 30, 2014 1:44 pm    Post subject: [SOLVED] Limit Pulseaudio to Skype or USB Headset Reply with quote

I followed a howto, to get Skype running with minimal Pulseaudio.
However, it seems Pulseaudio is still messing with non-Skype applications. For example, if I try to listen to a word on dictionary.com, the sound now comes from the device specified by pavucontrol instead of the speakers as before.
Further, I used to be able to toggle mute for my speakers using "amixer set Master toggle". Now, I have to toggle both "Master" and "Headphone". Also, playing sound via HDMI using "mplayer -ao alsa:device=hw=1.7" does not work well after installing Pulseaudio.

Is there any way I can restrict Pulseaudio to only run for Skype, or at least only for my USB headset?


Last edited by larophel on Fri Oct 03, 2014 4:53 am; edited 1 time in total
Back to top
View user's profile Send private message
BT
Guru
Guru


Joined: 13 Jun 2004
Posts: 318

PostPosted: Thu Oct 02, 2014 2:32 am    Post subject: Reply with quote

If you only have PulseAudio installed because of Skype, then you might want to try apulse. apulse provides PulseAudio emulation for ALSA. This is a much simpler solution than minimal PulseAudio. Currently there is a bug preventing apulse being install simultaneously with Skype on multilib systems, so apulse might not be a solution for you right now.
Back to top
View user's profile Send private message
larophel
n00b
n00b


Joined: 19 Mar 2005
Posts: 54

PostPosted: Thu Oct 02, 2014 9:12 pm    Post subject: Reply with quote

Thanks for the suggestion, BT.
I tried apulse. I had to compile it myself, since the ebuilds from the jauhien overlay did not really work well.
However, I ran into two problems: First, I could not use my USB headset, since Skype does not allow you anymore to choose the device from the UI. Instead, it forces you to use pavucontrol, which does not work with apulse. While playing around with some settings to see if I could get Skype to use my USB headset, Skype stopped working correctly, it would not show my contacts anymore after log in and I could not even call the Skype test service.

So, I guess, for now I am back at PulseAudio. Do you have any ideas / hints how I could go about installing a minimal PulseAudio environment?
Back to top
View user's profile Send private message
BT
Guru
Guru


Joined: 13 Jun 2004
Posts: 318

PostPosted: Fri Oct 03, 2014 12:07 am    Post subject: Reply with quote

I would like to help you with PulseAudio but I don't know much about. I have never installed it on any of my systems. Sorry. :(
Back to top
View user's profile Send private message
larophel
n00b
n00b


Joined: 19 Mar 2005
Posts: 54

PostPosted: Fri Oct 03, 2014 4:53 am    Post subject: Reply with quote

I have solved this by disabling PulseAudio for my normal user and creating a separate user just for Skype.
Seems to work great so far.
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3509

PostPosted: Fri Oct 03, 2014 12:49 pm    Post subject: Reply with quote

larophel wrote:
I have solved this by disabling PulseAudio for my normal user and creating a separate user just for Skype.
Seems to work great so far.


This sounds like a fascinating option. Do you have a scripted wrapper around it so it still looks like a simple command, or do you manually su, etc?
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
larophel
n00b
n00b


Joined: 19 Mar 2005
Posts: 54

PostPosted: Fri Oct 03, 2014 2:23 pm    Post subject: Reply with quote

Yes, I made a script.
I will describe my complete solution: First, disable PulseAudio auto restart by adding the line "autospawn = no" to "~/.config/pulse/client.conf". Kill PulseAudio, if it is running. Then, create a new user to run Skype.
Next, we will create two scripts, which will allow starting Skype as the special Skype user. I use "sudo" to allow me to run Skype as the special Skype user without having to enter a password, so I added the following line to "/etc/sudoers":

Code:

larophel ALL = (larophel_skype) NOPASSWD: /opt/bin/skype_runas, /usr/bin/xauth


Then, create the script "/opt/bin/skype_launch", which prepares the environment so that the special Skype user can launch Skype:

Code:

xauth extract - "$DISPLAY" | sudo -u larophel_skype xauth -f /home/larophel_skype/.Xauthority merge -
sudo -u larophel_skype /opt/bin/skype_runas


Afterwards, create the script "/opt/bin/skype_runas", which is called by the previous script:

Code:

export XAUTHORITY=$HOME/.Xauthority 
pax11publish -r
/opt/bin/skype


I added the "pax11publish -r" line today, since after a reboot PulseAudio did not want to start up for the special Skype user. It should help, but I have not performed a reboot yet to confirm.

And that's it. You can simply call the "/opt/bin/skype_launch" script as the normal user to run Skype as the special Skype user.
Potentially, you need to disable PulseAudio from being auto started by your desktop environment for your normal user. I had to do so in XFCE, but I have not checked yet if it indeed after a reboot PulseAudio will not auto start up.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum