如何在切换用户时继续在 Ubuntu 上播放音乐?

如何在切换用户时继续在 Ubuntu 上播放音乐?

我安装了 ubuntu 12.04。如果我开始通过内置 rhythmbox 音乐播放器播放音乐并切换用户 - 音乐会停止,直到我切换回来 :(。是否可以在切换到其他用户时继续播放音乐?

答案1

有一个发射台有关此问题的错误建议的补救措施是将“SYSTEM_START”选项0的更改为:1/etc/default/pulseaudio

# 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=1

这实际上不是一个错误,而是一个功能。对于大多数人来说,这是预期的行为。他们不想让其他用户的声音盖过他们自己的声音。此外,它符合标准。

答案2

我不相信这是可能的。

就你正在做的“切换用户”的本质而言,你实际上是在注销,以便从具有不同权限和另一个用户值的环境进行转换

答案3

您可以打开一个屏幕会话(使用“screen”命令,“screen”包可能默认安装,但我不确定)然后,您可以从命令行使用类似 mplayer(没有 gui)的东西。由于注销时不会终止屏幕会话,因此 mplayer 将继续播放。顺便说一句,这应该适用于每个命令行应用程序。

相关内容