Steve's blog
   


Steve About
Steve's blog,
The Words of the Sledge
steve@einval.com

Subscribe
Subscribe to the RSS feed.

Links

  • Home
  • Debian
  • PlanetDebian
  • Search PlanetDebian
  • Friends

  • Matthew Garrett
  • Jonathan McDowell
  • Jo McIntyre
  • Martin Michlmayr
  • Andrew Mobbs
  • Mike Pitt
  • Daniel Silverstone
  • Andy Simpkins
  • Neil Williams

  •        

    Friday, 12 November 2010

    Using pulseaudio in a chroot

    (Mainly for my own information, so I can find this again later!)

    I'm running Debian Squeeze on my Lenovo Thinkpad X200 laptop, using the amd64 version so that I can make the most of the 64-bit CPU. However, I also need a range of 32-bit apps too for now, typically proprietary rubbish like the Flash plug-in for Firefox^WIceweasel. So I set up a 32-bit chroot with a small Debian installation in there too. (Roll on multi-arch!) That's been working ok for a while, except that I couldn't get working audio in my browser. I didn't really pay much attention to that until recently: I wanted to watch some videos on YouTube and the sound mattered!

    After some digging, it became clear that Iceweasel inside the chroot just wasn't talking to the currently-running pulseaudio server outside the chroot. I had installed all the required libs in the chroot too, but still no joy. After some searching (thanks to the folks on the Archlinux wiki for this!) I've now been able to configure my chroot correctly. 2 bits needed:

    1. Configure alsa in the chroot to use pulse by default by creating/editing /etc/asound.conf:

    pcm.pulse {
        type pulse
    }
    ctl.pulse {
        type pulse
    }
    pcm.!default {
        type pulse
    }
    ctl.!default {
        type pulse
    }
    

    2. The dbus machine ID in the chroot needs to be the same as that of the main host, which it wasn't for me. That caused audio apps to report "connection refused" when I tested them. The machine ID is stored in /var/lib/dbus/machine-id. Either copy that file from the host system into the chroot, or add /var/lib/dbus as a bind-mount along with the usual suspects like /home and /tmp.

    Job done, I can watch movie trailers etc. with sound in my browser. Yay! :-)

    17:46 :: # :: /debian/misc :: 5 comments

    Comments

    Re: Using pulseaudio in a chroot
    Daniel wrote on Fri, 12 Nov 2010 18:22

    A bit offtopic of the pulse issue, but the 64-bit flash plugin beta works very well. http://labs.adobe.com/downloads/flashplayer10.html Way more stable on 64-bit.


    Reply
      Re: Re: Using pulseaudio in a chroot
      Steve wrote on Sun, 14 Nov 2010 14:23

      Meh, I gave up on the 64-bit flash player a while back when Adobe arbitrarily dropped it. Security "support" seems to be totally ad-hoc.

      Plus, I've got other apps that work better in 32-bit like Skype *spit*


      Reply
    Re: Using pulseaudio in a chroot
    Henrik Jess wrote on Fri, 04 Jan 2013 13:06

    I've have a ubuntu in chroot on a Debian host (LMDE) to get NetFlix working on linux. To have sound simultaneously I had to put the follow in /etc/rc.local (could be fstab).

    mount -o bind /proc /var/chroot/quantal/proc mount -o bind /sys /var/chroot/quantal/sys mount -o bind /dev /var/chroot/quantal/dev mount -o bind /dev/pts /var/chroot/quantal/pts mount -o bind /dev/shm /var/chroot/quantal/dev/shm mount -o bind /proc /var/chroot/quantal/proc mount -o bind /proc/bus/usb /var/chroot/quantal/proc/bus/usb mount -o bind /sys /var/chroot/quantal/sys mount -o bind /tmp /var/chroot/quantal/tmp mount -o bind /var/run /var/chroot/quantal/var/run mount -o bind /var/lib/dbus /var/chroot/quanta /var/lib/dbus ## Sound issue

    Might be helpfull for others... Thanks for sharing this.


    Reply
    Re: Using pulseaudio in a chroot
    Henrik Jess wrote on Fri, 04 Jan 2013 13:08

    mount -o bind /proc /var/chroot/quantal/proc

    mount -o bind /sys /var/chroot/quantal/sys

    mount -o bind /dev /var/chroot/quantal/dev

    mount -o bind /dev/pts /var/chroot/quantal/pts

    mount -o bind /dev/shm /var/chroot/quantal/dev/shm

    mount -o bind /proc /var/chroot/quantal/proc

    mount -o bind /proc/bus/usb /var/chroot/quantal/proc/bus/usb

    mount -o bind /sys /var/chroot/quantal/sys

    mount -o bind /tmp /var/chroot/quantal/tmp

    mount -o bind /var/run /var/chroot/quantal/var/run

    mount -o bind /var/lib/dbus /var/chroot/quantal /var/lib/dbus ## Sound issue

    (Repost - might be with CR this one.. Copy/paste)


    Reply
    Re: Using pulseaudio in a chroot
    Divick wrote on Tue, 14 May 2013 02:53

    Hey, this worked like a charm for me. I had been hunting around to get it working on my system. Thanks a lot Steve!


    Reply

    Your Comment

     
    Name:
    URL/Email: [http://... or mailto:you@wherever] (optional)
    Title: (optional)
    Comment:
    Anti-spam:Select the first of the following words and enter it in the "Human" box
    eiders elongate espy ensnare eulogy emigrate equating energy eviller excludes
    Human:
    Save my Name and URL/Email for next time