Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] pulseaudio and alsa fighting
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
musasabi
Tux's lil' helper
Tux's lil' helper


Joined: 09 Sep 2005
Posts: 137
Location: Chicago, IL, USA

PostPosted: Sat Feb 12, 2011 9:36 pm    Post subject: [SOLVED] pulseaudio and alsa fighting Reply with quote

so, after much turmoil and reading, i've gotten pulseaudio, alsa, and skype (amongst other apps) to play nice together... mostly.

for the time being, i can't figure out how to set volumes so both systems will respect them. take this example:

i'm listening to music via the pandora|one desktop app. if i go to play an .mp4 via totem, it'll max out the PCM levels in alsamixer. of course, that makes everything sound like garbage. even if i'm only doing one auditory thing at a time, each new program will tinker with the volume levels somehow. if i've got alsamixer and pulseaudio volume control open, sliding one will make the others spazz out, jumping up and down rapidly in tiny intervals.

then, pulseaudio can't decide which profile sounds the best. haha. well maybe i cant, but i'm blaming the program, because things are certainly changing without my input. haha. anyway, i was originally on "analog stereo output". once i stumbled on the profile selector, i tinkered. every time i choose a new profile, it resets the volume levels (most importantly, pcm again). then if i lower the pcm volume, it might sound ok, or it might sound digitally distorted (as if the input signal is too amplified again), but i can't reproduce consistently. right now i'm sitting on the analog 5.1 profile, and 10 minutes ago it sounded awful.

next issue: pidgin plays it's sounds when i'm in the preferences/sound tab. it'll play through "default" or "alsa", but not "esd" (which is odd, since i have esdcompat symlinked to replace esd). however, no sound will play on events. that seems a little ridiculous. o.O

so, three questions.

one, how can i set the alsamixer values so they're unalterable? or at least so pulse and the applications that are presumably using it don't always mess with the mixer levels?

two, is there a piece of pulse's config that i missed for this profile schizophrenia? i left all three config files unmodified because HAL does the work when i force alsa to use it's pulse plugin.

three, why is pidgin playing sounds in configuration but not during events? that's just wacky.

here's some info that might be relevant; if you can think of any you'd like to see, feel free to ask.
Code:
blackbox patrick # cat /proc/asound/cards
 0 [NVidia         ]: HDA-Intel - HDA NVidia
                      HDA NVidia at 0xf3e78000 irq 21
 1 [NVidia_1       ]: HDA-Intel - HDA NVidia
                      HDA NVidia at 0xf7ffc000 irq 19
 2 [U0x46d0x804    ]: USB-Audio - USB Device 0x46d:0x804
                      USB Device 0x46d:0x804 at usb-0000:00:04.1-2, high speed
 3 [NVidia_2       ]: HDA-Intel - HDA NVidia
                      HDA NVidia at 0xfbffc000 irq 18
blackbox patrick # cat /etc/asound.conf
pcm.pulse {
    type pulse
}
ctl.pulse {
    type pulse
}
pcm.!default {
    type pulse
    hint.description "Default Audio Device"
}
ctl.!default {
    type pulse
}


Last edited by musasabi on Sun Feb 13, 2011 9:02 pm; edited 1 time in total
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6196

PostPosted: Sat Feb 12, 2011 10:29 pm    Post subject: Reply with quote

Honestly, I wouldn't bother with esd - it's plain dead.
I would even consider disabling its compatibility layer in pulseaudio.

Looking at the ebuild, pidgin part seem to be a gstreamer problem.

As for alsamixer, as you adjust master pulseaudio volume control, it adjusts the lower level controls for you.
So, your problem sounds more like either a problem with totem touching settings it shouldn't or totem's audio stream gets an additional amplification - see something like pavucontrol or Gnome's volume applet: pulseaudio stores volume of named streams, so it can adjust them to their previous values once they reappear.
Back to top
View user's profile Send private message
musasabi
Tux's lil' helper
Tux's lil' helper


Joined: 09 Sep 2005
Posts: 137
Location: Chicago, IL, USA

PostPosted: Sat Feb 12, 2011 10:48 pm    Post subject: Reply with quote

first, thanks for the response. i'll look into pidgin/gstreamer.

the thing with pulseaudio/alsa though, is that pulseaudio likes to reset the mixer levels when anything plays a new sound. firefox, totem, or anything i've tried. but when i adjust the main volume (on the gnome panel or in pavucontrol), it cranks the PCM as well. then there's really no pulse control i've found for PCM, so i have to go into alsa to fix it. then alsa's PCM mixer tosses pulse's about, and so on.

i know this is terribly vague and kind of awkward to describe, but i hope i'm coming across clearly.
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6196

PostPosted: Sat Feb 12, 2011 11:28 pm    Post subject: Reply with quote

As far as I can understand you, you're going wrong way about it.
You should set a generally acceptable volume level on main control, then just adjust individual streams
- as I mentioned, pulseaudio stores the values for named streams.
Back to top
View user's profile Send private message
musasabi
Tux's lil' helper
Tux's lil' helper


Joined: 09 Sep 2005
Posts: 137
Location: Chicago, IL, USA

PostPosted: Sat Feb 12, 2011 11:34 pm    Post subject: Reply with quote

yes, i imagine i am going about it the wrong way. ;)

my thing is that i can set an acceptable level just fine, leave it sit, etc. but when pulse turns around and maxes out the pcm, i instantly get distortion at any level. i dont know what to do about that.

with the named streams bit i'm not taking your full meaning. so, pulse relies on names to determine which mixers it's toying with? if so, where might those be stored? i imagine i could convince pulse to not touch the pcm if it was just a config thing.
Back to top
View user's profile Send private message
musasabi
Tux's lil' helper
Tux's lil' helper


Joined: 09 Sep 2005
Posts: 137
Location: Chicago, IL, USA

PostPosted: Sun Feb 13, 2011 9:01 pm    Post subject: Reply with quote

ok, well... i sort of solved it. haha. my only issue now is that i'm sure there's something more logical i could've done to solve it, but i don't know the system well enough to guess what that might be.

anyway in /etc/pulse/default.pa, i changed
Code:
load-module module-udev-detect

to
Code:
load-module module-udev-detect ignore_dB=1


and now pulse only controls the "front" alsa channel. i want it to control the master levels, but when i tried passing "control=Master Front" to "load-module module-alsa-sink" and uncommenting that line in default.pa, pulse would just crash when it tried to run, claiming it couldnt initialize the parameters. the same effect occurred when i tried loading the alsa sink module with no parameters, so i wound up following the advice of the config file and modifying the udev lines. though it took some ridiculous searching and i _still_ have no idea what that parameter does.

so, it works well enough that i can say it works, but i know i haven't solved the problem.

anyone interested in explaining it to me...? haha.
Back to top
View user's profile Send private message
musasabi
Tux's lil' helper
Tux's lil' helper


Joined: 09 Sep 2005
Posts: 137
Location: Chicago, IL, USA

PostPosted: Sun Feb 13, 2011 9:03 pm    Post subject: Reply with quote

oh, and i was just being dumb with pidgin. i accidentally set it to "only when not available". that's an odd option, and it looks a lot like "only when available", which is what i normally set pidgin to. so... that works too. =P
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6196

PostPosted: Sun Feb 13, 2011 9:41 pm    Post subject: Reply with quote

There's a chance that this old blog post may play a role.
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