D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Commandeering X


On 25/01/14 11:21, Philip Hudson wrote:
> On 24 January 2014 19:53, Philip Hudson <phil.hudson@xxxxxxxxx> wrote:
>> Bingo. That works.
> Spoke too soon. I get my X session, but no sound. Pulseaudio barfs when I
> run VLC:
> [0x7f950c006ba8] pulse audio output error: overflow, flushing
> (repeated)
> Executing 'pulseaudio --start' does not cure it.

Hmm, there is some deeply weird stuff going on in the background here:
sound is massively broken on both my Mint and Ubuntu VM when I test them
with trying to do this as well. My Mint box (I wasn't as ambitious as
you and just tried to play back a MP3 with mpg123 rather than trying
VLC) issues all kind of diabolical warnings about permissions on
sockets, jackd failures and eventually a segfault from mpg123.

You'd probably want to do "service pulseaudio restart" rather than
"pulseaudio --start" as it was running already... experience suggests to
me that this is because pulseaudio is running by default in per-user
mode rather than as a single system-wide service. Ok, this is going to
be a pain in the ass...

*five minutes later*

That wasn't as bad as I thought actually: as I suspected, it's damn
Lennart's fault again.

First, on the Mint box, add yourself to the pulse and pulse-access
groups if you haven't already:

sudo usermod -aG pulse ghost
sudo usermod -aG pulse-access ghost

And now fiddle with pulseaudio so we can have it running a single
system-wide instance (this may well cause other problems though, be
warned): invoke an editor on /etc/pulse/daemon.conf and make sure the
following two lines aren't commented out and are set to "yes".

daemonize = yes
system-instance = yes

Restart pulseaudio (properly this time) with:

sudo service pulseaudio restart

You'll also need to log out and back in for your new group memberships
to take effect. After doing this, now I can SSH to my Mint VM, kill MDM,
"startx &" to initialize awesome DM and finally type:

mpg123 Rolling_Stones-Sympathy_for_the_Devil.mp3

And lovely music comes out the speakers as expected, hooray. I just
tried using cvlc/vlc to play back an anime mkv I SCP'ed to the Mint VM
and was rewarded with a really cool, but really broken, rainbowing of
pixels in my SSH terminal on the host box as lacking a proper $DISPLAY
variable, vlc faithfully tried to pipe a cartoon into ascii mode for me.

Now, at this point, I can flip over to my VM and manually control it,
including starting up vlc and playing back my anime (this would be the
equivalent of you using SSH to remotely start up your LDME session, and
then getting up and walking over to it) but what's the fun in that?
After coming this far, we want to remain sat on our remote machine and
use SSH to bring up a video window on the LDME box without physically
touching it. Obviously, I forgot the most obvious thing:

export DISPLAY=:0.0

At this point, all the pieces of the puzzle are in place and either:

mplayer \[Live-eviL\]\ Yadamon\ -\ Ep\ 01.mkv
vlc \[Live-eviL\]\ Yadamon\ -\ Ep\ 01.mkv

Works as expected, bringing up the video (with sound) on the remote Mint
machine, all without actually touching it once. Obviously you can pass
either program fullscreen options, geometry or anything else you like.
With mplayer, I can continue to use standard shortcut keys on the remote
machine to pause/volume up/stop/etc over SSH, which is surprisingly cool
actually. I *can* actually see some use for this - as long as any given
remote box is configured correctly, I can effectively commandeer it as a
fullscreen video playback device. With tinkering and a TV card, I'm sure
DVB could be brought to life as well.

Ok, let me know how you get on with that - decidedly one of the weirder
things I've looked into recently, and bizarrely interesting bludgeoning
Linux once again into doing what I want it to regardless of received
wisdom. That's what I like about Linux best: if you're bloody minded
enough, you can make it do almost anything you want. Even weird stuff
that nobody in their right mind should ever want to do (yes Phil, I'm
looking at you here - commandeering X indeed)...


The Mailing List for the Devon & Cornwall LUG
FAQ: http://www.dcglug.org.uk/listfaq