View previous topic :: View next topic |
Author |
Message |
bzabc n00b
Joined: 09 Sep 2012 Posts: 3
|
Posted: Sun Apr 14, 2013 12:09 pm Post subject: How do ALSA and PulseAudio work? |
|
|
hi,
i install pulseaudio according to the gentoo wiki (no "system-wide" USE), sound can be played
but i want to know how it is started?
$ mplayer2 test.mp3
$ ps aux | grep pulseaudio
........................................../usr/bin/pulseaudio --start --log-target=syslog
i don't have to manually start it (pulseaudio), how it is started? |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Sun Apr 14, 2013 12:32 pm Post subject: |
|
|
From a quick look at the alsa-plugins code, it calls pa_context_new (from alsa-plugins' pulse/conf_pulse.c and pulse/pulse.c), which would start up pulse, if I understand that terse documentation correctly. _________________ Improve your font rendering and ALSA sound |
|
Back to top |
|
|
yngwin Retired Dev
Joined: 19 Dec 2002 Posts: 4572 Location: Suzhou, China
|
Posted: Sun Apr 14, 2013 2:25 pm Post subject: |
|
|
In my personal experience, pulseaudio more often than not, doesn't work. _________________ "Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF |
|
Back to top |
|
|
Logicien Veteran
Joined: 16 Sep 2005 Posts: 1555 Location: Montréal
|
Posted: Sun Apr 14, 2013 4:00 pm Post subject: |
|
|
If you look at the output of Code: | equery d pulseaudio |
you will see which packages depends on Pulseaudio. Pulseaudio install a file pulseaudio.desktop in severals places like /etc/xdg/ausostart/pulseaudio.desktop. Xdg is a freedesktop.org standard I guess and more than one desktop environment depends on it. So it is start by default most of the time.
As a sound server, Pulseaudio take the control of the sound card. You can disable Pulseaudio with an appropriate /etc/asound.conf and give back the hand to Alsa and Dmix sound server. it can be disable to from Pulseaudio Volume Control (pavucontrol).
You can prevent Pulseaudio form being installed if you use the -pulseaudio USE flag in the make.conf USE variable. _________________ Paul |
|
Back to top |
|
|
thens n00b
Joined: 07 Apr 2012 Posts: 12
|
Posted: Fri Apr 19, 2013 7:02 pm Post subject: |
|
|
I had several problems with PA in the past as well, but nowadays everything works ootb.
Not sure what problems you guys still have with PA, would be interesting |
|
Back to top |
|
|
GFCCAE6xF Apprentice
Joined: 06 Aug 2012 Posts: 295
|
Posted: Fri Apr 19, 2013 7:12 pm Post subject: |
|
|
thens wrote: | I had several problems with PA in the past as well, but nowadays everything works ootb.
Not sure what problems you guys still have with PA, would be interesting |
Same here, it works great. Finally gave me something to replace the great control that OSSv4 and its mixer gave me.
Also I would like to echo what Logicien said.
Before I decided to try it out a while ago I was reading up beforehand, and after installing I was looking for information on some sort of service or daemon I may need to enable, I cant remember where it was I read it but it said that pulse gets started when it first needs to be (or even when x starts? (this could just be in my head though)) and if you try start it manually it will error telling you it has already been started, which is the case. |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9713 Location: almost Mile High in the USA
|
Posted: Thu Apr 25, 2013 7:55 pm Post subject: |
|
|
I've also seen annoying issues with Pulseaudio. Really PA is the mixer in userspace, then PA will send audio off to ALSA in the kernel - which then sounds off.
The conflict is with the PA daemon and ALSA apps that don't deal with Pulseaudio.
If you have all your apps use PA then it should work fine, PA is nice - you can do a lot with individual streams - separate volume controls/mute per app outside the application's control, and redirecting audio to different speakers - including sending the stream over the internet...
But that's not a usage model I need (though the per-stream mute is really nice...), and using ALSA directly seems to work better, especially since apps like wine doesn't support PA properly (it seems to connect and disconnect from the audio device a lot, enough to confuse the pulseaudio daemon after a while.)
I do have PA working on some machines, mostly these machines do not run or infrequently run wine. Need make sure all apps can deal with pulse properly...
(and removing pulseaudio from my n900 is out of the question...) _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
VoidMage Watchman
Joined: 14 Oct 2006 Posts: 6196
|
Posted: Thu Apr 25, 2013 8:13 pm Post subject: |
|
|
eccerr0r wrote: | I do have PA working on some machines, mostly these machines do not run or infrequently run wine. |
I've been wondering about this for quite awhile.
I haven't been using wine much, but while I do recall some major problems between its alsa driver and pulseaudio, I haven't noticed those noticed those in quite awhile (about a year at least, IIRC). Is it a matter of me not using wine much, having an odd (very old) hardware setup, or perhaps something else ? |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9713 Location: almost Mile High in the USA
|
Posted: Thu Apr 25, 2013 8:20 pm Post subject: |
|
|
I admit that I think I've been PA-free on my wine machine for about that long so I don't know :D
I'll have to wine around my remaining PA machines ... maybe they did finally fix it (one or the other...) _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
simon_irl Guru
Joined: 07 Oct 2004 Posts: 403 Location: New Zealand
|
Posted: Thu Apr 25, 2013 9:32 pm Post subject: |
|
|
thens wrote: | I had several problems with PA in the past as well, but nowadays everything works ootb.
Not sure what problems you guys still have with PA, would be interesting |
the problem i have with it is roughly the same problem i'd have with a pair of mechanical cutlery-holders for working my knife and fork. alsa works nicely on all my systems, including those with multiple soundcards etc...why on earth would i want to install a bunch of other stuff to complicate things and waste resources and add to the list of stuff to troubleshoot if audio stops working? i'm sure it does amazing, valuable things for the (more and more) people who are using it...but for me, i've never noticed any practical advantage (i.e. i use my audio apps exactly the same way whether they're sitting on pulseaudio or alsa), so pure alsa sucks less. |
|
Back to top |
|
|
ulenrich Veteran
Joined: 10 Oct 2010 Posts: 1480
|
Posted: Thu Apr 25, 2013 10:05 pm Post subject: |
|
|
If you want PA
most likely because
you have problems with alsa.
To solve your issues most likely you have
played a while with different configurations in asound.conf.
Alsa sound is restored by openrc on every boot. Might not be easy to get rid of ... |
|
Back to top |
|
|
salahx Guru
Joined: 12 Mar 2005 Posts: 534
|
Posted: Fri Apr 26, 2013 8:16 am Post subject: |
|
|
PulseAudio itself is a D-Bus service, so it can be activated via d-bus service activation as well (you can deactivate the auto-activation if desired). Note that PulseAudio is a session (user) service, not a system one.
PulseAudio users can see it with: Code: | dbus-send --session --dest=org.freedesktop.DBus --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListName |
There is an PulseAudio plugin for ALSA as well, thus it is possible (even recommended) to create an ALSA "pulse" virtual device. Legacy ALSA-only (in particular, Wine) applications then get routed to PulseAudio (activating the service as above) - which ultimately routes it back to ALSA again.
If you use the above setup PulseAudio should "just work". |
|
Back to top |
|
|
rickj Guru
Joined: 06 Feb 2003 Posts: 427 Location: Calgary, Alberta, Canada
|
Posted: Wed Jun 12, 2013 5:52 pm Post subject: |
|
|
Pulseaudio does not "just work" for me
I came by pulseaudio because it became a default, and was installed on an update. It does not seem to offer anything positive for me.
Regrettably it has taken over the sound cards in alsa with a virtual "Pulseaudio" card. This means the settings on the real card are not saved on shutdown. As a result, after each reboot, I have to enter alsamixer, press f6, select the real card, unmute it, and raise its volume.
Is there any way to configure things so that the settings of the real card are saved, as previously was the case? |
|
Back to top |
|
|
666threesixes666 Veteran
Joined: 31 May 2011 Posts: 1248 Location: 42.68n 85.41w
|
Posted: Wed Jun 12, 2013 6:17 pm Post subject: |
|
|
pulse audio is a gem on my system i love it
once the devs put xfce4-volumed-pulse in portage for me that is.... i had problems with unmuting hidden channels. dont build gnome-media with pulseaudio use flag or you'll lose your mixer in the systray |
|
Back to top |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Wed Jun 12, 2013 7:10 pm Post subject: |
|
|
rickj wrote: | Is there any way to configure things so that the settings of the real card are saved, as previously was the case? |
Manually edit the media-sound/pulseaudio ebuild to remove the forced dependency on alsa-plugins[pulseaudio], then reinstall the latter with that use flag disabled. Doing so removes the config files that make the virtual pulseaudio sound card take over your system.
There are no other negative side-effects to doing this, it's purely a GnomeOS "we know better than you" thing from upstream. |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9713 Location: almost Mile High in the USA
|
Posted: Fri Jun 14, 2013 4:22 pm Post subject: |
|
|
Pulseaudio snuck back up on me on my x86-64 install. I had PA installed because I had forgotten about the USE=-pulseaudio flag while reinstalling over my x86 (32-bit) install. But surprisingly, it actually seems to work allright on this recent install - with wine-1.5.?? (with its non-Wine supported PulseAudio patch.)
The same caveat still exists: all PA aware or die in a flaming pile of <skip><beep><hiss><skip><silence>... _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Sat Jun 15, 2013 1:24 am Post subject: |
|
|
To be fair I should add that PA works great on one of my systems; the one with a real hardware-mixing sound card, where it serves no actual purpose other than as a hack to avoid a desync bug in ffmpeg. |
|
Back to top |
|
|
666threesixes666 Veteran
Joined: 31 May 2011 Posts: 1248 Location: 42.68n 85.41w
|
Posted: Sat Jun 15, 2013 6:44 am Post subject: |
|
|
eccerr0r, i had those problems before pulse 3, and 4... that is to say me too |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9713 Location: almost Mile High in the USA
|
Posted: Sun Jun 16, 2013 12:30 am Post subject: |
|
|
The machine that was borked in x86 and now seemingly working in x86-64 is an Intel HDA chipset audio (Gigabyte EP43-UD3H), oddly enough. And another thing that seems to have started working correctly was suspend/resume with recent kernels. I am quite shocked (at least the machine has been able to not crash after eleven S3 suspend/resume cycles so far). Perhaps it's the 64-bit kernel and 32 is just broken... Alas that's off topic...
I don't have any machines with high end audio codecs... |
|
Back to top |
|
|
666threesixes666 Veteran
Joined: 31 May 2011 Posts: 1248 Location: 42.68n 85.41w
|
Posted: Sun Jun 16, 2013 12:57 am Post subject: |
|
|
"How do ALSA and PulseAudio work?" ok you asked for it... electricity... and magnets... and woofer cones.... and linux kernels.... and sound cards... i wish i knew how pulse audio worked, and where settings were to set things like buffers and latency. as far as i know its automatically determined by gnome, probably somewhere deep in the gconf editor.
i remember this being a very useful resource when i was linux from scratching over 4 years ago.... http://www.alsa-project.org/main/index.php/Documentation if you find the pulse audio version of that site, link me please lol id like to know pulse in depth like that. |
|
Back to top |
|
|
dark-wulf n00b
Joined: 02 Feb 2006 Posts: 40
|
Posted: Mon Jun 17, 2013 8:55 pm Post subject: |
|
|
sorry if i am wrong but is pulse not just an audio server and still depends on alsa drivers?
And yes and i don't like PA only trouble.... _________________ Gentoo rulez!!!
Gentoo for every one!!!
Gentoo for president!!! |
|
Back to top |
|
|
ulenrich Veteran
Joined: 10 Oct 2010 Posts: 1480
|
Posted: Mon Jun 17, 2013 11:58 pm Post subject: |
|
|
Quote: | And yes and i don't like PA only trouble.... | The most of the herd comes in when they misconfigured their alsa already. Which is why pulseaudio has problems then ... |
|
Back to top |
|
|
|