The user cannot select sound card

Bug #229137 reported by Mikko Ohtamaa
32
This bug affects 3 people
Affects Status Importance Assigned to Milestone
pulseaudio (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Binary package hint: pulseaudio

On systems where there are several sound cards available, pulseaudio seems to choose arbitrary sound card (not default ALSA sound card).

My board has integrated ICH5 and SB Live PCI installed. ALSA is set to use SB Live.

moo@rousku:~$ cat .asoundrc.asoundconf
# ALSA library configuration file managed by asoundconf(1).
#
# MANUAL CHANGES TO THIS FILE WILL BE OVERWRITTEN!
#
# Manual changes to the ALSA library configuration should be implemented
# by editing the ~/.asoundrc file, not by editing this file.
!defaults.pcm.card Live
defaults.ctl.card Live

I had the following sinks available (clean Ubuntu 8.04 Hardy Heron install).

>>> list-sinks
2 sink(s) available.
    index: 0
 name: <alsa_output.pci_8086_24d5_sound_card_0_alsa_playback_0>
 driver: <modules/module-alsa-sink.c>
 flags: HW_VOLUME_CTRL LATENCY HARDWARE
 state: SUSPENDED
 volume: <0: 100% 1: 100%>
 mute: <0>
 latency: <0 usec>
 monitor source: <0>
 sample spec: <s16le 2ch 48000Hz>
 channel map: <front-left,front-right>
 used by: <0>
 linked by: <0>
 module: <0>
 description: <ALSA PCM on front:1 (Intel ICH5) via DMA>
    index: 1
 name: <alsa_output.pci_1102_2_sound_card_0_alsa_playback_0>
 driver: <modules/module-alsa-sink.c>
 flags: HW_VOLUME_CTRL LATENCY HARDWARE
 state: SUSPENDED
 volume: <0: 32% 1: 32%>
 mute: <0>
 latency: <0 usec>
 monitor source: <2>
 sample spec: <s16le 2ch 44100Hz>
 channel map: <front-left,front-right>
 used by: <0>
 linked by: <0>
 module: <2>
 description: <ALSA PCM on front:0 (ADC Capture/Standard PCM Playback) via DMA>

I want to use sink 1 (my sound card, not the integrated ICH5). However, there is no user interface to choose this anywhere. Preferences > Sounds do not have option to choose PulseAudio sink. For some reason, PulseAudio prefers ICH5. Thus, I cannot play any sounds (except by changing my wiring and using ICH5 plug, but that's not what I want due to suboptimal sound quality).

Workaround:

Edit /etc/pulse/default.pa

sudo pico /etc/pulse/default.pa

Add line:

set-default-sink alsa_output.pci_1102_2_sound_card_0_alsa_playback_0

(You can get available sinks with pulseaudio -C and list-sinks commands)

Restart PulseAudio:

sudo /etc/init.d/pulseaudio restart

Revision history for this message
Aleksi Nurmi (aleksi-nurmi) wrote :

I'm having the same problem, but even the workaround did not work for me in every application. Notably flashplugin-nonfree (with libflashsupport) and gnome-sound-properties PulseAudio test beep (!) still use the wrong sound card. To my knowledge, they use PulseAudio natively.

$ cat ~/.pulse/default-sink
alsa_output.pci_1412_1724_sound_card_0_alsa_playback_0
$ cat /etc/pulse/default.pa | grep default-sink
set-default-sink alsa_output.pci_1412_1724_sound_card_0_alsa_playback_0

Both are correct. I think the problem is:
$ pulseaudio -C
>>> list-sinks
index: 0
    name: <alsa_output.pci_10de_371_sound_card_0_alsa_playback_0>
    ....
index: 1
    name: <alsa_output.pci_1412_1724_sound_card_0_alsa_playback_0>
    ....

It seems that PulseAudio has the same age-old problem like ALSA. Applications just use index 0 while they should be fetching the default device. I consider this a bug in PulseAudio because it lets this happen; set-default-sink should either force the device to index 0, or for the very least there should be big warning signs in the documentation for developers.

I've been able to set indices manually in ALSA by editing /etc/modprobe.d/alsa-base, but I haven't found similiar solution to PulseAudio. My workaround for the moment is killall pulseaudio.

Revision history for this message
jplien (jolien) wrote :

I have a related problem. I have an SB Live, which supports 4 channel output.

Pulseaudio chooses the output device "ALSA PCM on front:0 (ADC Capture/Standard PCM Playback) via DMA"

The "front:0" means that it will only play only on the front pair of speakers. If it used "default:0", it would play on all four. I've had to change all of my common apps to use ALSA output instead, which works around the problem.

I've installed all the pulseaudio configuration tools from the repositories, but none give me the option to change this. I edited ~/.pulse/default.pa, and restarted, but nothing seems to have changed.

I tried to run `pulseaudio -C`, to do "list-sinks", but it spits me back to the shell.

Revision history for this message
Andreas Berger (andi-berger) wrote :

Ubuntu ships with pulseaudio and at the same time does not offer any (gui, at least) configuration tool to choose your sound card. This affects any user who has more than one sound device.

The easiest solution at the moment seems to be the following:
-install pavucontrol
-go to the "Output Devices" Tab in pavucontrol, click on the arrow next to your preferred card and check "Default"
-if you still cannot hear your stream, go to "Playback" Tab, click on the arrow next to your stream and "Move Stream..." to your preferred output device

So the current situation requires everyone with more than one soundcard to research and install extra packages.
Since Pulseaudio has become default, i guess the solution would be something like integrating or linking "gnome-sound-properties" and "pavucontrol" in a way that naive users (like me) can deal with ;-)

Revision history for this message
Vasya Pupkin (shadowlmd) wrote :

Thank you, Andreas. That's the best solution to this problem I've seen on the net.

Revision history for this message
Arie Skliarouk (skliarie) wrote :

Probably this is not the best place to ask the question, but I have related issue:

I have set up multiseat (two seats for now) configuration according to the following howto:

http://netpatia.blogspot.com/2009/06/multiseat-in-ubuntu-904.html

The machine has two sound cards, with each card to be used by a particular seat.
On login it is pretty easy to see the seat the login was done on, using DISPLAY variable. Thus I need a way to direct pulseaudio to use a specific sound card depending on the DISPLAY variable.

Can the aforementioned pavucontrol program be used from command line to direct pulseaudio to use a specific card?

Which login scripts should I change (all users use gnome) for that?

Revision history for this message
Daniel Richard G. (skunk) wrote :

This remains an issue on Jaunty. I have much the same setup as the original reporter: via82xx onboard audio, and a separate SBLive card. I want to use the latter, ALSA defaults to the latter, Pulseaudio insists on using the former. pavucontrol(1), as Andreas suggested, mostly straightened the problem out for me---who would have ever thought that a *volume control* utility, with a default-device checkbox widget almost purposely hidden behind a drop-down arrow, would do the trick?

This bug *seriously* needs the importance set high. Pulseaudio has turned a hardware setup on which plain-ALSA Linux "just works" into one where the sound infrastructure does dumb things that require either significant expertise or hours of forum/Launchpad-trolling to straighten it out. Can you imagine a non-technical user running into this? In 2009??

Pulseaudio needs to default to the same device(s) that ALSA does (what earthly reason does it have to do otherwise?) and a means of selecting the output device needs to be in the default GUI. This is precisely the sort of bug that gives Linux's usability a bad name. I'm only glad I ran into this on my own system, and not that of a penguin-skeptical friend.

Revision history for this message
Mikko Ohtamaa (mikko-red-innovation) wrote :

It doesn't affect lots of users since rarely there is more than one sound card.

However, I suggest this bug should be nominated to hundred paper cuts or put through similar usability process, since the fix is probably relatively simple.

Changed in pulseaudio (Ubuntu):
status: New → Confirmed
Revision history for this message
Daniel Richard G. (skunk) wrote :

The combination of on-board sound hardware, and a more full-featured sound card, isn't that unusual. It's not in the same "only a gearhead" category as, say, having two distinct (non-SLI) video cards. (And even then there's on-board video...)

Hundredpapercuts is looking very apropos.

(Oh, and Arie: I think one way to do what you're after is to put a shell-script-let in /etc/X11/Xsession.d/, somewhere after 70pulseaudio, that invokes "pacmd set-default-sink ..." as appropriate based on the value of DISPLAY. Don't bother with pavucontrol(1), as it has no script-compatible interface.)

Revision history for this message
Mikko Ohtamaa (mikko-red-innovation) wrote :

Does anyone know how to get this bug nominated to hundred papercuts? Do they still accept new bugs?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thank you for reporting this bug to Ubuntu. Ubuntu 8.04 (hardy) reached end-of-life on May 12, 2011.

See this document for currently supported Ubuntu releases:
https://wiki.ubuntu.com/Releases

Please upgrade to the latest version and re-test.

Changed in pulseaudio (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for pulseaudio (Ubuntu) because there has been no activity for 60 days.]

Changed in pulseaudio (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.