Bug 433675

Summary: Unable to play sound on the second X-server (e.g. started on TV)
Product: [Fedora] Fedora Reporter: Marcin Zajaczkowski <mszpak>
Component: ConsoleKitAssignee: David Zeuthen <davidz>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: medium    
Version: 8CC: mclasen
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-02-21 22:35:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marcin Zajaczkowski 2008-02-20 19:45:43 UTC
Description of problem:
It's unable to play sound on another X-server. I use second X-server to watch
movies on tv. I use following command (worked fine with FC1 to (at least) FC6):
xinit <real script calling mplayer on display :1> $@ -- /usr/bin/X -layout tv :1
An application (like mplayer) hangs on start reporting problem with playing
sound. Switching back to the primary X-server resuming application, but it's not
a workaround when you try to watch a movie...
The same situation occurs when a sound application is started directly from
xterm running on the secondary X-server.

Version-Release number of selected component (if applicable):
ConsoleKit-libs-0.2.3-1.fc8
ConsoleKit-0.2.3-1.fc8
ConsoleKit-x11-0.2.3-1.fc8

How reproducible:
Always

Steps to Reproduce:
1. Create file /tmp/xterm1.sh with fallowing content:
<CONTENT>
#!/bin/sh
DISPLAY=:1 /usr/bin/xterm
</CONTENT>
2. Add executable bit: chmod u+x /tmp/xterm.sh
3. Call:
xinit /tmp/xterm1.sh -- /usr/bin/X -layout "Default Layout" :1
Note: Proper layout should be taken from /etc/X11/xorg.conf (section ServerLayout).
4. Try to play some sound (mpg123, aplay, mplayer, ...)

Actual results:
An application hangs on start. Switch back to primary screen (ALT-CTRL-F7) to
hear sound. Switch again to the new X-server (ALT-CTRL-F9) to hang (suspend)
sound once more.

Expected results:
Sound plays on the second X-server at least when an application was started from
that second X-server.

Additional info:
In Fedora 8 using connected TV is completely broken (sound is an essential).

It seems sound is suspended when X-server become inactive. It's similar to bug
432399 and bug 402671, but not the same.

In /var/log/messages I see:
Feb 16 18:08:09 szpak acpid: client connected from 26769[0:500]
Feb 16 18:08:16 szpak pulseaudio[2330]: module-alsa-sink.c: Error opening PCM
device front:0: Invalid argument
Feb 16 18:08:46 szpak acpid: client connected from 2218[0:0]
Feb 16 18:08:53 szpak acpid: client connected from 26832[0:500]
Feb 16 18:09:00 szpak pulseaudio[2330]: module-alsa-sink.c: Error opening PCM
device front:0: Invalid argument
Feb 16 18:09:01 szpak acpid: client connected from 2218[0:0]

Comment 1 Matthias Clasen 2008-02-20 23:40:12 UTC
try running your command under ck-xinit-session:

#!/bin/sh
DISPLAY=:1 /usr/bin/ck-xinit-session /usr/bin/xterm


That should work. Right, Jon ?

Comment 2 Marcin Zajaczkowski 2008-02-21 22:35:50 UTC
It works great, but without your help I wouldn't be able to find it. It could be
write somewhere down. Google returns only 3 hits related to "ck-xinit-session"
(completely unhelpful).

Thank you a lot!