Fast user switching causes broken sound

Bug #498082 reported by Tristan Schmelcher on 2009-12-18
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
pulseaudio (Ubuntu)
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/sounds/purple/send.wav
Playing WAVE '/usr/share/sounds/purple/send.wav' : Signed 16 bit Little Endian, Rate 22050 Hz, Stereo
ALSA lib pcm_pulse.c:724:(pulse_prepare) PulseAudio: Unable to create stream: Too large

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/sounds/purple/send.wav
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-fuse-daemon file system /home/tristan/.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://us.archive.ubuntu.com karmic/main Packages
        100 /var/lib/dpkg/status
$

ProblemType: Bug
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: kateryna 3144 F.... pulseaudio
 /dev/snd/controlC1: kateryna 3144 F.... pulseaudio
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,80860022,00100004'
   Controls : 41
   Simple ctrls : 23
Date: Thu Dec 17 21:06:09 2009
DistroRelease: Ubuntu 9.10
ExecutablePath: /usr/bin/pulseaudio
NonfreeKernelModules: nvidia
Package: pulseaudio 1:0.9.19-0ubuntu4
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-16.53-generic
SourcePackage: pulseaudio
Uname: Linux 2.6.31-16-generic x86_64

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

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

Other bug subscribers