Bug 623837

Summary: Lacking Alsa configuration for PulseAudio ($ALSA_CONFIG_PATH not set for user)
Product: [openSUSE] openSUSE 11.3 Reporter: Rafał Miłecki <zajec5>
Component: SoundAssignee: Takashi Iwai <tiwai>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: openSUSE 11.3   
Whiteboard: pulseaudio
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Deadline: 2010-09-08   
Attachments: setup-pulseaudio patch to remove /etc/environment setting
pulse.sh to be added into /etc/profile.d/

Description Rafał Miłecki 2010-07-20 11:16:51 UTC
User-Agent:       Opera/9.80 (X11; Linux i686; U; pl) Presto/2.6.30 Version/10.60

I installed openSUSE 11.3 and decided to enable PulseAudio support in it.

So I installed some packages:
1) pulseaudio
2) alsa-plugins-pulse
3) Dependencies like: libpulse0, libpulse-mainloop-glib0, libxine1-pulse, ...

Then enabled PulseAudio using: "yast2 sound" → Other → Configure PulseAudio → Enable PulseAudio.

Finally rebooted my machine, just for sure.

The result is that PulseAudio works great now, I can do "mplayer -ao pulse file.flac", Amarok works fine as well.

The problem is that alsa is not configured properly and it sill tries to play using direct access to sound card, not PulseAudio with it's plugin.

There exists /etc/alsa-pulse.conf pointing to /etc/asound-pulse.conf (which also exists), however /etc/alsa-pulse.conf *is not used for non-root user*.

========================================

Following explains everything:


> amixer -Dpulse
ALSA lib control.c:902:(snd_ctl_open_noupdate) Invalid CTL pulse
amixer: Mixer attach pulse error: No such file or directory


> echo $ALSA_CONFIG_PATH
[no output]


> su -c 'echo $ALSA_CONFIG_PATH'
Password:
/etc/alsa-pulse.conf


> export ALSA_CONFIG_PATH=/etc/alsa-pulse.conf


> echo $ALSA_CONFIG_PATH
/etc/alsa-pulse.conf


> amixer -Dpulse
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 25237 [39%] [on]
  Front Right: Playback 25237 [39%] [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch cswitch-joined penum
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 65536
  Front Left: Capture 65536 [100%] [on]
  Front Right: Capture 65536 [100%] [on]


Reproducible: Always
Comment 1 Rafał Miłecki 2010-07-20 11:35:06 UTC
Is rodrigo still PA maintainer? Should we reassign to him?

(Filled whiteboard).
Comment 2 Rafał Miłecki 2010-07-20 11:42:56 UTC
This is weird...

> cat /etc/environment 
#
# This file is parsed by pam_env module
#
# Syntax: simple "KEY=VAL" pairs on seperate lines
#
ALSA_CONFIG_PATH=/etc/alsa-pulse.conf
SDL_AUDIODRIVER=pulse

> echo $ALSA_CONFIG_PATH
[empty output]

> su zajec -c "echo $ALSA_CONFIG_PATH"
Password: 
[empty output]

> su zajec
Password: 

> echo $ALSA_CONFIG_PATH
/etc/alsa-pulse.conf


Maybe I'll try to reboot once more... :|
Comment 3 Rafał Miłecki 2010-07-20 12:19:36 UTC
Rebooted once more and it's still here. Performed more tests however.

1) I can see $ALSA_CONFIG_PATH in VT1 after logging as normal user
2) I don't see $ALSA_CONFIG_PATH in "konsole" (KDE4's app)
3) [In Konsole] If I type "su zajec" and give password, I can see $ALSA_CONFIG_PATH



So I made some "browsers" tests:

1) If I stop all "visible" applications in KDE (like Amarok, SMPlayer) and start Firefox from menu, I can hear sound from YouTube then. However alsaplugin is not visible in PulseAudio streams, so it's pure ALSA playback.

2) Same result as in #1 when I start firefox from konsole

3) If I start some app using PulseAudio (like SMPlayer) and then start Firefox, I won't get sound

4) If I start some app using PulseAudio and then Firefox from konsole, I can see many:
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave

5) If I start some app using PulseAudio, set $ALSA_CONFIG_PATH in konsole and run Firefox from that konsole, YouTube works fine, I can see it as "ALSA plug-in" in PulseAudio streams.

So it's clear to me that $ALSA_CONFIG_PATH is not visible for browsers just like for default "konsole".
Comment 4 Takashi Iwai 2010-07-20 16:09:45 UTC
I guess /etc/environment isn't always evaluated but it depends on the login way.
Perhaps this is no good place to put variables.  We should put files in /etc/profile.d, instead.
Comment 5 Rafał Miłecki 2010-07-20 18:03:32 UTC
Created attachment 377259 [details]
setup-pulseaudio patch to remove /etc/environment setting
Comment 6 Rafał Miłecki 2010-07-20 18:04:07 UTC
Created attachment 377260 [details]
pulse.sh to be added into /etc/profile.d/
Comment 7 Rafał Miłecki 2010-07-20 18:10:38 UTC
Thanks for tip Takashi! I attached patch and new file which make my system works great with PulseAudio!

Can you commit that as fix for openSUSE 11.3?

My two doubts about proposed solution:
1) I added myself as author of pulse.sh as I'm ready to get bug reports PA-configuration related. However you can drop that if you wish, not a problem for me.
2) I copied this weird comparison from /etc/setup-pulseaudio:
if [ "x$STATUS" = "xyes" ];
AFAIK bash, there is not any need to use that "x" prefix. Using quote symbol should be enough. However I don't want to hear any regressions in *released* version, so decided to copy this code.
Comment 8 Takashi Iwai 2010-07-21 10:25:31 UTC
Thanks for patches.  But I don't think we should run grep or such in a profile.

I fixed setup-pulseaudio itself to write *.sh and *.csh profiles, and updated OBS multimedia:libs/pulseaudio.  Could you give it a try?
Comment 9 Takashi Iwai 2010-07-29 15:07:54 UTC
The fix was submitted to FACTORY.
Comment 10 Rafał Miłecki 2010-07-30 15:24:46 UTC
I can confirm fix works fine here.

What about backporting it to 11.3 by update repository?

Currently PulseAudio is unusable in 11.3 because of this bug. After enabling PA half of applications use PA and the rest keep trying to use ALSA (not as PA plugin) which simply can not work.
Comment 11 Rafał Miłecki 2010-08-08 20:34:24 UTC
Reopening and waiting for decision/answer.
Comment 13 Christian Dengler 2010-08-09 16:48:20 UTC
Set the correct needinfo

minor bug, but I think we can provide an update +1
Comment 14 Marcus Meissner 2010-08-10 06:33:19 UTC
STATUS=`grep PULSEAUDIO_ENABLE /etc/sysconfig/sound | cut -f2 -d= | cut -f2 -d\"`

seems horribly ineffective to have 3 binaries executed when you can do:

. /etc/sysconfig/sound
if [ "x$PULSEAUDIO_ENABLE" = "xyes" ] ; then
else
fi
Comment 15 Takashi Iwai 2010-08-10 06:39:40 UTC
Yeah, but it's irrelevant with this bug itself.  If any, open another bugzilla entry, or do submitreq a fix :)
Comment 16 Swamp Workflow Management 2010-08-11 15:47:43 UTC
The SWAMPID for this issue is 35103.
This issue was rated as low.
Please submit fixed packages until 2010-09-08.
Also create a patchinfo file using this link:
https://swamp.suse.de/webswamp/wf/35103
Comment 17 Christian Dengler 2010-08-11 15:48:27 UTC
Be so kind and submit the fixed sources and a patchinfo.
Comment 18 Takashi Iwai 2010-08-12 10:46:48 UTC
Did minor fixes for setup-pulseaudio (remove left-over files, and change the lines in comment 14).

Submitted now.  SRID 45467.
Comment 19 Christian Dengler 2010-08-12 12:37:46 UTC
Be so kind and submit also a patchinfo.
Comment 21 Swamp Workflow Management 2010-08-23 11:41:01 UTC
Update released for: libpulse-browse0, libpulse-browse0-debuginfo, libpulse-devel, libpulse-mainloop-glib0, libpulse-mainloop-glib0-debuginfo, libpulse0, libpulse0-debuginfo, pulseaudio, pulseaudio-debuginfo, pulseaudio-debugsource, pulseaudio-esound-compat, pulseaudio-gdm-hooks, pulseaudio-lang, pulseaudio-module-bluetooth, pulseaudio-module-bluetooth-debuginfo, pulseaudio-module-gconf, pulseaudio-module-gconf-debuginfo, pulseaudio-module-jack, pulseaudio-module-jack-debuginfo, pulseaudio-module-lirc, pulseaudio-module-lirc-debuginfo, pulseaudio-module-x11, pulseaudio-module-x11-debuginfo, pulseaudio-module-zeroconf, pulseaudio-module-zeroconf-debuginfo, pulseaudio-utils, pulseaudio-utils-debuginfo
Products:
openSUSE 11.3 (debug, i586, x86_64)
Comment 22 Takashi Iwai 2012-10-17 05:52:09 UTC
Fixed.
Comment 23 Bernhard Wiedemann 2016-04-15 12:49:55 UTC
This is an autogenerated message for OBS integration:
This bug (623837) was mentioned in
https://build.opensuse.org/request/show/45467 11.3:Test / pulseaudio