pulseaudio as root (?)

Hi everybody !
Back to OpenSUSE and back to sound problems. You won’t like to hear that, but I only have sound issues with openSUSE, never with Unix (all BSDs), nor with other Linux distros.

I’m starting to accept the fact that I have no choice but using pulseaudio (but if you hear about a petition to abolish it, please tell me!)
Here’s what’s driving me crazy at the moment:
I can access pulseaudio and so have sound while loging in as user from a session manager (xdm or gdm). root connection to the sound server is denied. It always was. In fact, I don’t know how to use pulseaudio as root. Adding root to the pulse-access group and running pulseaudio as daemon instead on a per-user basis doesn’t help. But at least, on other systems, if pulseaudio doesn’t answer - whenever it is the default -, applications (like mplayer) can switch to alsa (or oss on Unix) and use it directly. It used to work on OpenSUSE 11.1 too. It doesn’t seem to be possible on 11.2. alsamixer (as user) shows that pulse faked device and simply refused to start as root :

ALSA lib pulse.c:229: (pulse_connect) PulseAudio: Unable to connect: Connection refused

cannot open mixer: Connection refused

Particularly strange is that when starting X with startx, even as normal user, pulseaudio seems to work but outputs to nowhere, since the sound devices are gone. They don’t appear in pavucontrol. I compared the running processes while starting X from startx and from xdm and could not find any noticeable difference.

I also tryed to disable pulseaudio using
PULSEAUDIO_ENABLE=“no” in /etc/sysconfig/sound (that option wasn’t there in 11.1) and “autospawn = no” in /etc/pulse/client.conf. It didn’t help. Neither did deinstalling alsa-plugins-pulse.

What I’m trying to accomplish is getting sound to everybody (including root) in any circumstance (including while starting X with startx), back to the way it was (in 11.1) and I guess it would be possible if pulseaudio wouldn’t arbitrarly lock the sound device. Maybe it does make sense and I missed the point … but all we need is sound.

Lucky for you others have;
Results 1 - 10 of about 5,460,000 for sound issues linux -opensuse -suse. (0.26 seconds)
so I won’t feel so bad about that one.

Anyway, first question is; are you using GNOME or KDE?

Sorry, I don’t understand your post, other than to note you have problems with Gnome using pulse audio in 11.2. I know you won’t like this, but I believe for all KDE desktop’s in 11.2, pulse is disabled by default. Hence sound is mostly working very well for KDE users.

However from what I have read, Gnome developers are trying to hand as much of the audio as they can to the Pulse Audio developers, and hence Gnome is very dependent on Pulse Audio, while KDE is not.

With respect to finding out what application is using the sound device, I recommend this command:

lsof /dev/dsp* /dev/audio* /dev/mixer* /dev/snd/*

run that under different circumstances, and save the output and label what multimedia apps you have playing when run. Eventually it will start making sense.

An example as to how it was used is here: sound stop working after updating on asus k50in - openSUSE Forums

I wasn’t running Gnome or KDE at this point but still in the process of setting up different environments in 11.2 (and booting in runlevel 3). So I usually start with a light weight WM, like icewm (even twm!). But finally starting Gnome and comparing the processes before and after gave me the explanation: pulseaudio is not running until Gnome is started once. I haven’t started KDE yet. After leaving Gnome and exiting X, I restarted X and was able to get sound in icewm. Then I rebooted and started pulseaudio manually before starting X :

/usr/bin/pulseaudio --start

I guess I will put this command in my xinitrc for WMs other than Gnome.

Glad to read you found a solution.

As a counter-point, what you encountered may be specific to your PC’s hardware. I can boot all 6 PCs in our place to run level 3 (4 of these PCs are running 11.2) and I can play sound with pulse audio NOT running in all 6 PCs. The audio hardware is different in all 6 PCs. In the case of the 4 openSUSE-11.2 PCs, pulse has NEVER run on those PCs. Yet sound will play in run level 3 .

As to why your PC needs pulse, I do not know.

This is my first 11.2 install, but I will install it on a couple other PCs and pay extra attention. Maybe I will install it on an IMac too, which currently runs 11.1 without sound (no alsa support for the IMac internal speakers. I don’t know if it has changed.) Did you install pulseaudio at all, even if you’re not running it? It might have been installed by some dependencies. I wasn’t - and I’m still not - able to see my soundcard with alsaconf, whether pulse is running or not. The reason why is unclear, but it wouldn’t suprise me that much if pulseaudio would put a lock on the audio device and never release it for other direct uses (like alsa). That would explain the need of an alsa pulse plugin in some cases. Despite that, among other things I don’t understand, I’m glad that I got pulseaudio to work.

I’ve helped various mac users get their sound working, but I’m not so sure about an iMac. I do not believe the autoprobe by alsa to configure the sound works as well with a Mac (under Linux) and it may be necessary to do hand edits to the /etc/modprobe.d/50-sound.conf file based on the hardware audio codec in the Mac.

Pulse is still installed. Its just disabled. Thus far, less than a week after install, I have had no reason to want to enable pulse on KDE. But having typed that, in 11.1 where pulse was enabled by default on my PCs, I had no problems with it (none under 11.1 with KDE-3.5.10 nor under 11.1 with an updated KDE-4.3.2).

The problem on the iMac is not with the sound chip. It is supported (at least mine), detected by alsaconf and configured as expected. But the sound cannot go through the iMac internal speakers because those are NOT (at least on 11.1) supported.

That makes me think that headsets may work thou? I recall a comment by noted in a bug report I once raised on openSUSE sound (which by the way, the SuSE-GmbH sound packager, who is also an alsa developer, fixed for me). The comment was from the SuSE-GmbH packager who noted that it is much easier for an alsa developer to get sound working in headsets, than it is to drive speakers.

Yes. But the iMac doesn’t have a sound output for regular headsets, even if it shows a headsets icon on the back. It might work with usb headsets. It didn’t for me as I tried (not very long), but it should work in theory.