Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: mpd as mpd user pulseaudio and dbus problem

  1. #11
    Join Date
    Nov 2007
    Beans
    8

    Re: mpd as mpd user pulseaudio and dbus problem

    I was having the same problem after upgrading from Debian Squeeze to Wheezy on a headless armel SBC that I've been using as a sound server. Purging the configs doesn't do anything.

    It seems a per-session D-Bus daemon must be running for the user trying to start pulseaudio. This is normally started automatically when you start X, but that doesn't happen if you're going headless.

    Here's the answer:
    http://ubuntuforums.org/showthread.php?t=1743072

    I had to install the dbus-x11 package, but I'd imagine you'd already have that if you have a headful setup.

    I wrote a quick script to handle starting a D-Bus daemon and exporting the required variables, and call it to start a pulseaudio daemon. It could probably use some better fault handling and clean up, but it works fine for my use case. You will need to manually cleanup though, otherwise you'll have a new D-Bus daemon started every time you run this script.

    Code:
    #!/bin/bash
    
    dbusinfo=( $(dbus-launch) )
    DBUS_SESSION_BUS_ADDRESS=${dbusinfo[0]#DBUS_SESSION_BUS_ADDRESS=}
    DBUS_SESSION_BUS_PID=${dbusinfo[1]#DBUS_SESSION_BUS_PID=}
    
    export DBUS_SESSION_BUS_ADDRESS
    export DBUS_SESSION_BUS_PID
    
    pulseaudio --start

  2. #12
    Join Date
    Apr 2006
    Beans
    132

    Re: mpd as mpd user pulseaudio and dbus problem

    Wow thanks limaxray, this seems to work. At least pulse audio is running now. Strange thing is that there still is no sound. I have already checked if the sink was not muted or that alsamixer was muted... Well at least one step further.

    For some reason I didn't have dbus-x11 package installed. That is weird because xbmc is working with pulse audio and has x installed.

  3. #13
    Join Date
    Nov 2007
    Beans
    8

    Re: mpd as mpd user pulseaudio and dbus problem

    No problem. I only use pulseaudio as a sound server sink and can confirm this works fine playing networked audio.

    Now if you're trying to play audio from local sources from different users, you're going to have some problems. You will need to start pulseaudio from the user you intend to use it with. So, if your running mpd system wide, you need to run that script as mpd before starting mpd. You also need to make sure pulseaudio isn't running for any other users since pulseaudio will hog the audio device.

    See if this works:

    Code:
    $ sudo killall pulseaudio
    $ sudo -u mpd ./startpulse
    $ sudo /etc/init.d/mpd start
    Of course this may not be ideal since it only allows you to play audio from one user. If you need audio from multiple users, you could start pulseaudio in system mode (which would probably be the easiest way to go if you don't mind the security implications) or do something like this, starting a new dbus and pulseaudio session for each user.

Page 2 of 2 FirstFirst 12

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •