pulseaudio breaks on switching from tty7 to tty [1-6] (in and out of Gnome)

Bug #213149 reported by Peter Garrett
102
This bug affects 12 people
Affects Status Importance Assigned to Milestone
pulseaudio (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

Binary package hint: pulseaudio

lsb_release -rd
Description: Ubuntu hardy (development branch)
Release: 8.04

$ apt-cache policy pulseaudio
pulseaudio:
  Installed: 0.9.9-1ubuntu4
  Candidate: 0.9.9-1ubuntu4
  Version table:
 *** 0.9.9-1ubuntu4 0
        500 http://archive.ubuntu.com hardy/main Packages
        100 /var/lib/dpkg/status

On switching for example to tty1 from X on tty7, sound drops out when using pulseaudio ( for example in mplayer ). Using alsa as default does not produce this issue.

Changing the audio output to alsa produces the expected behaviour: namely, that sound is not muted or interrupted on vt change.

This bug occurs when switching in and out of X with ctrl+alt+F7, ctrl+alt+F[1-6]
If sound is played from the prompt in a Vt and a switch is made to another Vt it appears not to happen.

For instance, starting playback mplayer (using pulse) sound is muted on change to tty1, and returns on switching back to X on tty7. The same issue occurs with Totem and the Firefox Totem plugin.

Revision history for this message
Peter Garrett (peter-garrett) wrote :
Revision history for this message
Daniel T Chen (crimsun) wrote :

This is an intentional feature. PulseAudio, in esd compat, supports the foreground user.

Changed in pulseaudio:
status: New → Won't Fix
Revision history for this message
Peter Garrett (peter-garrett) wrote : Re: [Bug 213149] Re: pulseaudio breaks on switching from tty7 to tty [1-6] (in and out of Gnome)

On Sat, 19 Apr 2008 15:41:35 -0000
Daniel T Chen <email address hidden> wrote:

> This is an intentional feature. PulseAudio, in esd compat, supports the
> foreground user.

Wow, what a great feature... :|

Revision history for this message
Anakin Starkiller (sunrider) wrote :

This is a real bug !!
The main goal of MPD is to play local music even if X server is down !

Revision history for this message
Anakin Starkiller (sunrider) wrote :

I've found one solution. Open PolicyKit. And let the main user access sound device (in hal section).
Now, switching between tty works, but restarting X server still cause pulseaudio to stop...

Revision history for this message
Anakin Starkiller (sunrider) wrote :

For Peter Garrett :
I've found at last the solution for using pulseaudio even if X is down.
Well, everything was actually explained in the /etc/default/pulseaudio file :

---------------------------------------------------------------------
# Start the PulseAudio sound server in system mode.
# (enables the pulseaudio init script)
# System mode is not the recommended way to run PulseAudio as it has some
# limitations (such as no shared memory access) and could potentially allow
# users to disconnect or redirect each others audio streams. The
# recommend way to run PulseAudio is as a per-session daemon. For GNOME
# sessions you can install pulseaudio-esound-compat and GNOME will
# automatically start PulseAudio on login (if ESD is enabled in
# System->Preferences->Sound). For other sessions, you can simply start
# PulseAudio with "pulseaudio --daemonize".
# 0 = don't start, 1 = start
PULSEAUDIO_SYSTEM_START=0

# Prevent users from dynamically loading modules into the PulseAudio sound
# server. Dynamic module loading enhances the flexibilty of the PulseAudio
# system, but may pose a security risk.
# 0 = no, 1 = yes
DISALLOW_MODULE_LOADING=1
---------------------------------------------------------------

You have to make PulseAudio act as a Daemon instead as an esd instance of gnome-session.
So change PULSEAUDIO_SYSTEM_START=0 to PULSEAUDIO_SYSTEM_START=1
Everything works fine now ;)

Revision history for this message
Peter Garrett (peter-garrett) wrote :

On Tue, 06 May 2008 17:30:59 -0000
Anakin Starkiller <email address hidden> wrote:

> You have to make PulseAudio act as a Daemon instead as an esd instance of gnome-session.
> So change PULSEAUDIO_SYSTEM_START=0 to PULSEAUDIO_SYSTEM_START=1
> Everything works fine now ;)

Nice catch :) Thanks.

Revision history for this message
Lauri Niskanen (ape3000) wrote :

On Tue, 06 May 2008 17:30:59 -0000
Anakin Starkiller <email address hidden> wrote:

> You have to make PulseAudio act as a Daemon instead as an esd instance of gnome-session.
> So change PULSEAUDIO_SYSTEM_START=0 to PULSEAUDIO_SYSTEM_START=1
> Everything works fine now ;)

That doesn't do anything.. The problem is still here. Does my output for pulseaudio --daemonize say anything?

ape@ape-linux:~$ pulseaudio --daemonize
E: main.c: daemon startup failed.

Revision history for this message
Michael Nagel (nailor) wrote :

still the same with intrepid...
i dont know what advantages this behaviour offers...

Revision history for this message
Michael Nagel (nailor) wrote :

could this be reopened as a wishlist item? so you can easily switch between the two possibilities?

Revision history for this message
Juaco (kankito) wrote :

Policykit workaround had success on my machine, running intrepid. Thank you!!!

Revision history for this message
Lee Boynton (lboynton) wrote :

Sorry, how exactly do you open PolicyKit? Or does this only work with MPD? I would like to continue playing music from Banshee when switching user.

Revision history for this message
Lee Boynton (lboynton) wrote :

Ah, polkit-gnome-authorization :)

Revision history for this message
Sébastien Bertrand (damocles) wrote :

I think this bug is fixed under Jaunty :
- When I switch to tty1-tty6 : Sound playback continue if/when I'm logged in ;
- When I start another X server (with xinit for example) : Sound playback continue if I run 'ck-launch-session'.

Maybe 'ck-launch-session' will work for tty1-tty6 for intrepid.

Changed in pulseaudio (Ubuntu):
status: Won't Fix → Fix Released
Revision history for this message
Anakin Starkiller (sunrider) wrote : Re: [Bug 213149] Re: pulseaudio breaks on switching from tty7 to tty [1-6] (in and out of Gnome)

And what is exactly ck-launch-session ? There is no manual page for it...

In Jaunty, even when PulseAudio is started in daemon mode, when I restart
the computer with mpd music player playing some music, it does not resume
after reboot...

2009/5/5 Sébastien Bertrand
<<email address hidden><thedamocles%<email address hidden>>
>

>
> I think this bug is fixed under Jaunty :
> - When I switch to tty1-tty6 : Sound playback continue if/when I'm logged
> in ;
> - When I start another X server (with xinit for example) : Sound playback
> continue if I run 'ck-launch-session'.
>
> Maybe 'ck-launch-session' will work for tty1-tty6 for intrepid.
>
> ** Changed in: pulseaudio (Ubuntu)
> Status: Won't Fix => Fix Released
>
> --
> pulseaudio breaks on switching from tty7 to tty [1-6] (in and out of Gnome)
> https://bugs.launchpad.net/bugs/213149
> You received this bug notification because you are a direct subscriber
> of the bug.
>
>

Revision history for this message
Sébastien Bertrand (damocles) wrote :

The best page I've found to explain what is 'ck-launch-session' is :
- http://wiki.archlinux.fr/systeme:consolekit (in French)
- http://translate.google.fr/translate?u=http%3A%2F%2Fwiki.archlinux.fr%2Fsysteme%3Aconsolekit&sl=fr&tl=en&hl=fr&ie=UTF-8 (in English)

I do not understand what you are saying about MPD.
The original description of this bug do not talk about MPD but about the fact that sound isn't shared between sessions of the same user (tty7 and tty1-6).

Revision history for this message
m.k. (mk7gas) wrote :

got the same problem here on Ubuntu 11.04.

Revision history for this message
Ivan Zorin (iaz) wrote :

I can confirm this bug also - exactly the same problem using Ubuntu 11.10

Revision history for this message
KernelPanic (jfrusciante) wrote :

The policy might be desired, but the way it is implemented is IMHO buggy.

Scenario on my computer:

1. X running, tty7. Everything's ok.
2. Switch to tty1: no sound.
3. Login in tty1: sound comes back.
4. Switch back to X: everything's ok

Now, this is nonsense to me. X *is* running when I switch to tty1. There is no authentication required when I switch back to it. All my user processes keep running within my authenticated session; they are not stopped, they do not require another authentication when I switch back to it. So why only Pulseaudio stops?

I could understand if sound stopped after I quit/lock the session (annoying but, ok, safer). But I do not.
I am sure there is some technical reason for it but IMHO the overall behavior is buggy.

Revision history for this message
Krzysztof Pawłowicz (striepan) wrote :

Ah, the classic "it's not a bug, it's a feature"

But it a new and unexpected behavior.
Maybe it should be left as an option not default.

Revision history for this message
yossarian_uk (morgancoxuk) wrote :

This effects me in Kubuntu 15.04.

Its really annoying losing sound if you go to a virtual terminal.

If this is intentional design I would argue its a bad design.

Revision history for this message
Ronald Portier (Therp) (rportier1962) wrote :

Actually I have the same annoying behavior on Debian. Really annoying. Seems pulseaudio is broken by design if a bug is marked as a feature.

Revision history for this message
Mathew Hodson (mhodson) wrote :

There was never a change released for pulseaudio. Resetting back to previous status.

Changed in pulseaudio (Ubuntu):
status: Fix Released → Won't Fix
Revision history for this message
Flittermice (flittermice) wrote :

To clarify at first: It's 2019 and I am running Arch Linux with systemd...

... but I had exactly the same problem. My goal was simply to switch to another user (by Ctrl-Alt-Fx or by means of the display manager) and to keep my sound running.

I finally got it to work without having to play with system mode (dangerous, unsupported) or PolicyKit (don't know anything about that).

Steps:
1. Add the $USER whose PulseAudio should keep playing to the "audio" group (usermod -aG audio $USER).
2. Enable lingering for the user, so that PulseAudio starts without being logged in (loginctl enable-linger $USER).

Should this work you can optionally share this user's PA to other users on the net by adding something to ~/.config/pulse/default.pa. For example:
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;192.168.0.0/24

For the "client users" just add to ~/.config/pulse/client.conf:
default-server = 127.0.0.1

Maybe this works with Ubuntu, too?

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

This bug is closed. I suggest if there is any problem you want fixed in current or future Ubuntu releases then please create a fresh bug by running:

  ubuntu-bug pulseaudio

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.