Fast user switching causes broken sound
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pulseaudio (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: pulseaudio
I'm using Karmic 64-bit on a system with two desktop users that are typically both logged-in and use fast user switching to go back and forth without logging out. I have multiple times observed that this leads to broken sound. Today it happened and I decided to gather some data.
The problem at first manifested as one user getting an error when trying to play anything:
$ aplay /usr/share/
Playing WAVE '/usr/share/
ALSA lib pcm_pulse.
aplay: set_params:1041: Unable to install hw params:
ACCESS: RW_INTERLEAVED
FORMAT: S16_LE
SUBFORMAT: STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 22050
PERIOD_TIME: 125000
PERIOD_SIZE: (2756 2757)
PERIOD_BYTES: 11025
PERIODS: 4
BUFFER_TIME: 500000
BUFFER_SIZE: 11025
BUFFER_BYTES: 44100
TICK_TIME: [0 0]
$
Or, with paplay:
$ paplay /usr/share/
Stream error: Too large
In both cases they produced this in the syslog:
Dec 17 21:11:21 tinygod4 pulseaudio[3144]: alsa-sink.c: Error opening PCM device iec958:0: Device or resource busy
Dec 17 21:11:21 tinygod4 pulseaudio[3144]: sink-input.c: Failed to create sink input: too many inputs per sink.
(iec958:0 is my default device for PulseAudio)
According to pavucontrol there were no streams playing. According to lsof, the PA instance for this user was the only thing with any sound devices open:
$ lsof | grep /dev/snd
lsof: WARNING: can't stat() fuse.gvfs-
Output information may be incomplete.
pulseaudi 3144 kateryna 22u CHR 116,10 0t0 4928 /dev/snd/controlC1
pulseaudi 3144 kateryna 29u CHR 116,10 0t0 4928 /dev/snd/controlC1
pulseaudi 3144 kateryna 40u CHR 116,14 0t0 5097 /dev/snd/controlC0
I hadn't really been doing anything with the sound at the time the problem occurred, but I was switching back and forth a lot and there were a couple media-based web pages open (Hulu, Rotten Tomatoes).
I tried restarting PA multiple times for the affected user but it no longer detected my default sound card, only the other one.
I then tried switching to the other user, restarting that PA, and then switching back and restarting the broken PA. It then came back with both cards detected and working.
The expected behaviour is that switching users should not break sound.
$ lsb_release -rd
Description: Ubuntu 9.10
Release: 9.10
$ apt-cache policy pulseaudio
pulseaudio:
Installed: 1:0.9.19-0ubuntu4
Candidate: 1:0.9.19-0ubuntu4
Version table:
*** 1:0.9.19-0ubuntu4 0
400 http://
100 /var/lib/
$
ProblemType: Bug
Architecture: amd64
AudioDevicesInUse:
USER PID ACCESS COMMAND
/dev/snd/
/dev/snd/
Card0.Amixer.info:
Card hw:0 'D1'/'Asus Virtuoso 100 (rev 2) at 0x1000, irq 18'
Mixer name : 'AV200'
Components : 'CS4398 CS4362A CS5361 AV200'
Controls : 16
Simple ctrls : 9
Card1.Amixer.info:
Card hw:1 'Intel'/'HDA Intel at 0xf0000000 irq 22'
Mixer name : 'Realtek ALC889'
Components : 'HDA:10ec0889,
Controls : 41
Simple ctrls : 23
Date: Thu Dec 17 21:06:09 2009
DistroRelease: Ubuntu 9.10
ExecutablePath: /usr/bin/pulseaudio
NonfreeKernelMo
Package: pulseaudio 1:0.9.19-0ubuntu4
ProcEnviron:
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcVersionSign
SourcePackage: pulseaudio
Uname: Linux 2.6.31-16-generic x86_64
Status changed to 'Confirmed' because the bug affects multiple users.