Wednesday, May 21, 2008

PulseAudio

This is a how-to/tips to getting PulseAudio working in Kubuntu 8.04.
I, like a lot of people, had issues with PulseAudio (PA) in our new flavor of Ubuntu. Though I had sound, I could not get the Volume Manger which allows you to adjust the volume of specific streams to work. My error specifically was a general "Connection Refused" so, here's what I did.
The following step may not be nessearry, I have isolated the problem, but only after I followed the instructions here. If you want to try to get PA working without making the configuration edit or downloads in the following post, got to Step2, but imo, I suggest following the link first. YMMV.

Step 1:
The (almost) Perfect Pulse Audio Setup
This link leads you to a Ubuntu Forums post. I highly suggest downloading the packages listed here. One note: the How-to talks about editting /etc/asound.conf - this file didn't exist for me, but I found out its ok to just go ahead and create it.

Step 2:

This is one of those rare times when you have restart your computer in Linux, and I mean your whole system.. not just your GUI. Go ahead and do so, and once you're logged back in before you play any sound or music open up a console session and type in
pulseaudio -D

PA should restart, and voilĂ , you should be able to start the Volume Manger and control your streams no problem. Lastly, to make the command "pulseaudio -D" run at start up, every start up, navigate to ~/.kde/Autostart in terminal, and type in
sudo nano pulseaudio

then put this into the text file:
#!/bin/bash
pulseaudio -D

save and quit

8 comments:

Unknown said...

thanks, this is what I needed to get my skype working. Now I have skype sound

Anonymous said...

You could probably put that line in /etc/rc.local and have the daemon start before you login. That way, KDE can play your login sound if you have one.

(The commands in /etc/rc.local are the last commands run before the login screen starts up. They are run as root.)

Anonymous said...

Good article. Thanks. Created a small tutorial linking to here:
http://portablejim.site-hosts.net/Problems-and-Solutions/pulseaudio-connection-refused.html

Anonymous said...

Very helpfull. I GOT MY PULSE BACK! Thank you!!

Anonymous said...

Oh, I forgot... chmod the pulseaudio file in Autostart to executable or it will bring up an editor and not run.

Anonymous said...

Newest Instructions: update to Ubuntu 9.04 or Kubuntu 9.04. It works.

Unknown said...

when I try to run the "pulseaudio -D" command in terminal I get a message

I: caps.c: Limited capabilities successfully to CAP_SYS_NICE.
I: caps.c: Dropping root privileges.
I: caps.c: Limited capabilities successfully to CAP_SYS_NICE.
N: main.c: Called SUID root and real-time and/or high-priority scheduling was requested in the configuration. However, we lack the necessary privileges:
N: main.c: We are not in group 'pulse-rt', PolicyKit refuse to grant us the requested privileges and we have no increase RLIMIT_NICE/RLIMIT_RTPRIO resource limits.
N: main.c: For enabling real-time/high-priority scheduling please acquire the appropriate PolicyKit privileges, or become a member of 'pulse-rt', or increase the RLIMIT_NICE/RLIMIT_RTPRIO resource limits for this user.
E: main.c: Daemon startup failed.

Any ideas?

John said...

Ben,

Sorry for the very late response, I created a new, better way, for me to handle my experiances in Ubuntu and have since forgotten to check this blog.

That being said, your problem is unique in that I've never seen it myself, or through any others posts before. The problem seems to be caused by a lack of permissions, are you sure you're part of the group "pulse"? You could try adding yourself to 'pulse-rt' but I'm not sure of the consequences of that.