<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Custom xbmc.service starts x-session and xbmc before pulseaudio is fully initialized"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=82447">82447</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Custom xbmc.service starts x-session and xbmc before pulseaudio is fully initialized
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>da_audiophile@yahoo.com
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>systemd
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=104408" name="attach_104408" title="proposed xbmc.service">attachment 104408</a> <a href="attachment.cgi?id=104408&action=edit" title="proposed xbmc.service">[details]</a></span>
proposed xbmc.service

Overview: Using the attached service file on an Arch Linux system running
pulseaudio, the xsession starts, but xbmc is started before pulseaudio is fully
initialized which causes it to miss seeing all audio devices.  I do not believe
that the 'After = systemd-user-sessions.service network.target sound.target'
line is adequate and am soliciting some feedback from the gurus :)

As a proof of concept, I modified /usr/bin/xbmc-standalone (which is simply a
wrapper script) by adding a `sleep 6s` line before it calls the executable. 
This is a dirty hack and not broadly applicable to all systems.

Steps to reproduce: 
1) Install Arch Linux with pulseaudio and xbmc.

2) Pull down the AUR package "xbmc-standalone-service" which provides this
xbmc.service as well as creates the needed user/groups[1].

3) Start xbmc.service and attempt to change audio sources.

1. <a href="https://aur.archlinux.org/packages/xbmc-standalone-service">https://aur.archlinux.org/packages/xbmc-standalone-service</a>

Actual result: None of the audio sources (system>system>audioAudio output
device) are available; the option is simply grayed out.

Expected result: All available outputs should be present and selectiable by the
user, eg, [HDMI,Analog,Digital,Optical].

Build date and platform: Verified on two different Arch Linux x86_64 machines. 
Both running systemd 215-4.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>