patch: pulseaudio backend

Forums:

I wrote a pulseaudio backend for MOC, mainly just to see if I could. Given how widespread pulseaudio is these days you might like to add this, as it gives slightly nicer integration with pulseaudio's mixer, and maybe some efficiency improvements. So I figured I'd upload it somewhere.

As it looks like I cannot attach files here I've put the patch up on http://marienz.net/m/moc-pulse.patch . This should apply to current svn MOC (I'm running a checkout from 2012-05-01, revision 2425).

The code seems to be stable (I've been using it for months), regular playback works fine, but the UI and seeking behave a little oddly because this backend has a much higher latency than MOC is used to. There are some workarounds in the code to counter this (explained in the comments). The user-visible problem is that small seeks do not work right.

I'll try to keep an eye on this forum for feedback/bug reports/etc.

http://marienz.net/m/moc-pulse-v2.patch has better pulseaudio connection properties and volume control naming, thanks to http://moc.daper.net/node/766 .

Could you provide with the patch for current revision (r2586)?

Thank a lot

Links to both patches seem to be dead and patches itself are slightly out-of-date.
So, I'm posting:

Mirrored patch v2

and

Updated patch for latest trunk version

I haven't reviewed It yet, but It seem to work fine.

Thanks for updating! The links should work again, but your updated version actually applies to current versions of MOC. I haven't added anything interesting since I posted v2 here, so people interested in this should just use your version.

hello, how to add this to MOC?

To add this to MOC, you (currently) have to build it from source with eoranged's updated patch applied.

Note I generally do not recommend running "make install" as root. Avoiding that (by installing into a location non-root can write into, or using a package manager) is left as an exercise to the reader :)

It goes roughly like this:

  1. Grab MOC's sources from this website (I'd use the current stable version 2.5.0) and eoranged's "Updated patch for latest trunk version" posted below (thanks eoranged!).
  2. untar the source and apply the patch (tar jxf moc-2.5.0.tar.bz2 && cd moc-2.5.0 && patch -p1 < ../moc-pulse-v2-updated.patch). Patch will complain about offset lines, but that's ok.
  3. Run "autoreconf" to update the build system.
  4. Configure, build and install MOC as you normally would, making sure configure lists "PULSE" as an enabled sound driver. You might want to run configure --with-pulse to make sure the build system changes took.
  5. Make sure SoundDriver is not included in your ~/.moc/config, or that "PulseAudio" is included in it.
  6. Start moc (if the daemon is still running make sure you exit and restart), and it should use PulseAudio

Good luck!