SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2011-03-08 03:02:04

hardran3
#! Junkie
From: forest town, lake land
Registered: 2011-02-26
Posts: 360

Pulseaudio and #! - A How To

Pulseaudio is a sound server for linux. It lets you do fun things like easily piping your audio to other machines on your network, having a system wide equalizer, or switching from internal analog to hdmi audio with 1 click. Pulseaudio has earned a bad reputation, mostly due to a bad implementation in several versions of Ubuntu. I have installed it on a couple of #! installs and the Debian implementation seems to be solid.

First we need to install the following packages. Note that this is a light install of pulseaudio, no bluetooth, no plugins for any programs, though this is easy to fix by opening synaptic and searching for pulse, and checking your audio application settings. For a heavier install check the links at the end of this post.

sudo apt-get install pulseaudio paprefs pavucontrol pulseaudio-module-hal pulseaudio-module-x11 pulseaudio-utils libasound2-plugins paman pavumeter  pulseaudio-esound-compat libpulse0 libsdl1.2debian-pulseaudio

Now save the following into /etc/asound.conf

pcm.pulse {
    type pulse
}

ctl.pulse {
    type pulse
}

pcm.!default {
    type pulse
}

ctl.!default {
    type pulse
}

You should be able to run pulseaudio -D in a terminal now and have a running Pulseaudio setup. Execute pavucontrol to see if things are working. If not try rebooting your machine.

Now we need to apply one tweak to make volumeicon work better with Pulseaudio. If you click on Open Mixer in the menu it will still launch the alsa mixer. To make it launch the Pulseaudio mixer open $HOME/.config/volumeicon/volumeicon in your favorite text editor. Find the onclick= line and change it to read as follows:

onclick=pavucontrol

If your keyboard has media keys, your volume controls may not work. I was able to fix this by putting the following code into the <keyboard> section of $HOME/.config/openbox/rc.xml.

    <keybind key="XF86AudioRaiseVolume">
      <action name="Execute">
        <command>amixer set Master 5%+</command>
      </action>
    </keybind>
    <keybind key="XF86AudioLowerVolume">
      <action name="Execute">
        <command>amixer set Master 5%-</command>
      </action>
    </keybind>
    <keybind key="XF86AudioMute">
      <action name="Execute">
        <command>amixer set Master toggle</command>
      </action>
    </keybind>

Enjoy your new pulseaudio setup!


UPDATE March 23 2011:
SDL programs need a change to work with pulseaudio. This is included in the how to now, but if you need it here is how.

sudo apt-get install libsdl1.2debian-pulseaudio

UPDATE April 30 2011:
Removed the pulseaudio -d added to autostart.sh as it was not needed, and to add a note about possibly needing to restart your machine to get things working. Thanks @ceph for pointing this out.


These instructions were largely stolen from the following sources:
Pulseaudio : The Perfect Setup
Debian Sid and Pulseaudio
Debian Forums - How-to:Pulseaudio

Last edited by hardran3 (2011-04-30 23:58:31)

Offline

Help fund CrunchBang, donate to the project!

#2 2011-03-12 18:53:12

Banger
Member
Registered: 2009-04-19
Posts: 13

Re: Pulseaudio and #! - A How To

Worked like a charm (after reboot), thanks for this!

Offline

#3 2011-03-12 19:26:58

Unia
#! Octo-portal-pussy
From: The Netherlands
Registered: 2010-07-17
Posts: 3,881

Re: Pulseaudio and #! - A How To

What is the advantage of running pulseaudio over alsa?


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Github

I am a #! forum moderator. Feel free to send me a PM with any question you have!

Offline

#4 2011-03-12 22:41:57

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 12,155

Re: Pulseaudio and #! - A How To

@unia: hardran3 mentioned a few of the benefits in the first paragraph...basically alsa works more like a basic mixing board with a single main output channel; PuleaAudio is more complex, allowing for multiple output channels, send/return loops, yada.


I'm a moderator here.  How are we doing?  Feedback is encouraged.

Offline

#5 2011-03-12 22:50:55

Unia
#! Octo-portal-pussy
From: The Netherlands
Registered: 2010-07-17
Posts: 3,881

Re: Pulseaudio and #! - A How To

Yes but other than that, there's little to gain from using pulseaudio? I mean, I only play music/videos on my own laptop, so a simple alsa would suffice. Or is there something I´m missing?


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Github

I am a #! forum moderator. Feel free to send me a PM with any question you have!

Offline

#6 2011-03-12 23:15:44

mahatman2
#! Die Hard
From: Chattanooga TN
Registered: 2009-09-13
Posts: 550

Re: Pulseaudio and #! - A How To

afaik Pulse has per-app volume control. Which is almost enough to get me to switch.. cool


Punch all your friends.

Offline

#7 2011-03-12 23:32:00

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 12,155

Re: Pulseaudio and #! - A How To

^ But don't most media apps have their own internal volume controls anyway?  Is that redundant, or just redundant?

@Unia:  I agree, for your usage (as well as mine wink ) alsa is more than adequate.


I'm a moderator here.  How are we doing?  Feedback is encouraged.

Offline

#8 2011-03-13 00:41:03

omns
#! wanderer
From: ~/
Registered: 2008-11-25
Posts: 5,131

Re: Pulseaudio and #! - A How To

I'm not inclined to use pulse either but none the less this is a nice howto smile

Offline

#9 2011-03-13 01:05:12

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 12,155

Re: Pulseaudio and #! - A How To

One possible advantage to having PulseAudio on a laptop, if you frequently use the laptop with external speakers, would be to (for example) send your music player's output to the external speaker jack, but have audio from Youtube videos go to the internal speakers.  I haven't been able to do this with alsa.


I'm a moderator here.  How are we doing?  Feedback is encouraged.

Offline

#10 2011-03-13 01:21:01

mahatman2
#! Die Hard
From: Chattanooga TN
Registered: 2009-09-13
Posts: 550

Re: Pulseaudio and #! - A How To

@pvsage, I hadn't thought of that.. yikes but maybe it's like a new paradigm someone's trying to setup...of course I don't really know, this is all just relayed from blog posts! tongue


Punch all your friends.

Offline

#11 2011-03-13 07:07:23

hardran3
#! Junkie
From: forest town, lake land
Registered: 2011-02-26
Posts: 360

Re: Pulseaudio and #! - A How To

omns wrote:

I'm not inclined to use pulse either but none the less this is a nice howto smile

Thanks omns! All my threads will come in handy when I have to reinstall smile

@Unia
ALSA will probably suffice in your situation. In fact most people will not need pulseaudio, but it has some nice features. I use it to send my audio to an Airport Express, and my netbook has HDMI so being able to switch outputs easily is nice.

Offline

#12 2011-03-13 07:18:45

mahatman2
#! Die Hard
From: Chattanooga TN
Registered: 2009-09-13
Posts: 550

Re: Pulseaudio and #! - A How To

So hadran3, would you say that as long as I have a single laptop with one set of speakers, I wouldn't need pulse? b/c I was thinking about switching but I have a knack for screwing things up tongue


Punch all your friends.

Offline

#13 2011-03-13 07:42:32

hardran3
#! Junkie
From: forest town, lake land
Registered: 2011-02-26
Posts: 360

Re: Pulseaudio and #! - A How To

mahatman2 wrote:

So hadran3, would you say that as long as I have a single laptop with one set of speakers, I wouldn't need pulse? b/c I was thinking about switching but I have a knack for screwing things up tongue

hadran3 hmm No, you probably don't need pulse, and where I come from, screwing things up is called learning. Take whatever you want from that smile

Offline

#14 2011-03-19 04:41:44

mahatman2
#! Die Hard
From: Chattanooga TN
Registered: 2009-09-13
Posts: 550

Re: Pulseaudio and #! - A How To

hardran3 wrote:

screwing things up is called learning

Hah, I forgot about that! tongue Thanks smile


Punch all your friends.

Offline

#15 2011-03-19 15:41:32

suf3r
Member
Registered: 2011-03-19
Posts: 18

Re: Pulseaudio and #! - A How To

Hi, very good tutorial, but after this i cannot set up multimedia keys work properly.
alsamixer shows: card: pulseaudio and only one channel: Master. For me that incorrect and cannot adjust volume.
So, my suggestion:
Run killall pulseaudio  -- Kills pulseaudio
In /etc/asound.conf change to your sound card:

pcm.V8237 {
    type pulse
}

ctl.V8237 {
    type pulse
}

pcm.V8237 {
    type pulse
}

ctl.V8237 {
    type pulse
}

To get sound card:

cat /proc/asound/cards

Mines says:

 0 [V8237          ]: VIA8237 - VIA 8237
                      VIA 8237 with CMI9761A+ at 0xd000, irq 22

So in .conf i use V8237
And make sure irq exist, that's your real card !
In terminal type pulseaudio -D
After this i can set PCM channel work with multimedia keys

And other issue witch i figured out how to fix: then using multimedia keys than master channel 0% others channels go to 0% too. More info about that + properly explained: http://askubuntu.com/questions/15069/ho … xer-levels

Issue two may not exist in your system so fix doesn't needed.

Last edited by suf3r (2011-03-19 15:42:22)

Offline

#16 2011-04-05 22:10:20

pioniere
Member
From: Parksville, BC, Canada
Registered: 2009-11-23
Posts: 20

Re: Pulseaudio and #! - A How To

Thanks for this, works great!!

Offline

#17 2011-04-16 07:01:53

ceph
Member
From: Auckland, NZ
Registered: 2011-04-14
Posts: 43
Website

Re: Pulseaudio and #! - A How To

Just for others doing this, I had to restart my machine to get pulseaudio to work. I also didn't need to add it to my autostart.sh, the pulseaudio daemon was initialised on startup automatically.


If you have noticed this notice you may have noticed that this notice is not worth noticing

Offline

#18 2011-04-25 17:06:51

popslee
#! Member
From: so cal
Registered: 2011-02-11
Posts: 51

Re: Pulseaudio and #! - A How To

Nice tut hardran3

Does pulse work better with Intel hd audio? Alsa seems to be lacking when it comes to audio output.

Offline

#19 2011-05-19 00:57:51

chillicampari
Pinball Wizard
Registered: 2009-10-09
Posts: 1,878

Re: Pulseaudio and #! - A How To

This came in handy today, thanks for doing it, hardran3! I've installed Pulseaudio a couple of times before but this made it go really quick on a new install. It was pretty helpful on cleanup for an existing install also. I switched the audio card back to onboard to move the good one to the newer PC so what I did was refresh PA using your apt-get string (it pulled in a couple of things that were missing even though PA ran anyway, if a bit quirky at times) and replaced my existing asound.conf with the one you posted.

In case anyone else runs into this if they switch cards, if you get "connection refused" errors, what worked for me was removing the .pulse directory (off home) and deleting .pulse-cookie

PA has gotten better than it used to be (or it could be the difference in implementation). I need it for LiVES on one box and to get xbmc to play nice with everything else on another and even though it had a really rough start (I got bit by the Ubuntu/Hardy implementation good so after that switched to OSSv4 for a long time) it seems pretty much alright now. 

Thanks again for posting this!

Last edited by chillicampari (2011-05-19 01:02:37)


#! forum moderator

Offline

#20 2011-07-29 09:30:09

el_koraco
#!/loony/bun
From: inside Ed
Registered: 2011-07-25
Posts: 4,749

Re: Pulseaudio and #! - A How To

nvm, reverted to alsa, pulse gives out horrible choppy sound in videos.

Last edited by el_koraco (2011-07-30 09:45:04)

Offline

#21 2012-02-11 04:12:35

an0nym0u5
New Member
Registered: 2012-02-09
Posts: 2

Re: Pulseaudio and #! - A How To

Thanx Hardran3 worked like a charm ... Even got my Macally 2.1 usb speaker/cooling fan thumpin...kewl beanz!

Offline

#22 2012-05-26 04:26:56

Kandid
Member
From: New York City
Registered: 2012-05-21
Posts: 15

Re: Pulseaudio and #! - A How To

Helped SO much, learned a bit too smile
sound glitches i'v been getting with my attempt to install pulse audio are gone
Thanks!

Offline

#23 2012-06-17 21:06:54

frankob
#! CrunchBanger
From: Croatia
Registered: 2012-06-08
Posts: 204
Website

Re: Pulseaudio and #! - A How To

Thanks! This helped a lot me too.

I have dist-upgraded my Waldorf from Statler, and in Waldorf repos, there are no libsdl1.2debian-pulseaudio and pulseaudio-module-hal packages, but it seems like they are not needed. Just libsdl1.2debian instead of libsdl1.2debian-pulseaudio seems to do the trick. The other packages are the same.

I have also noticed that on my system this works fine also WITHOUT the /etc/asound.conf file.

I only had problems with my mute/unmute button on keyboard, which muted, but couldn't unmute back...
hardran3's suggestion on multimedia buttons helped too.
Now, the only remaining issue is that unmuting from the Volume Icon doesn't work (muting does). And I think that, at least on my system, this is connected to the multimedia buttons issue. Because before the hardran3's fix they were acting the same way the Volume Icon acts stil now...
But (un)muting from the Icon is something I almost never do, so I probably just shouldn't bother...


Omnia sunt communia.

Offline

#24 2014-04-13 19:10:08

bzzzzz
New Member
Registered: 2012-01-14
Posts: 2

Re: Pulseaudio and #! - A How To

I've been trying to use my airport express using a linux box for years.

I've had varying degrees of success, but I've got it working as good as ever using this thread.  I'm running crunchbang 10 Statler

I followed all the instructions from the original poster.  My problem was that my computer wasn't able to discover the airport express.

Then I installed avahi-discover using

sudo apt-get install avahi-discover 

I'm not sure if that made any difference but then after I did this I discovered this thread http://westmarch.sjsoft.com/2014/04/str … o-raspbmc/

The problem was that when I typed paprefs into a terminal the dialogue box for detecting apple devices was greyed out

I followed the instruction

sudo apt-get install pulseaudio-module-raop

And the dialogue box can then be ticked.

Finally wooohooo I fiddled with the pavucontrol and bobs your uncle

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo