synergy with sound over ssh

There are two computers on my desk. And I wanted to use both screens, but neither of the desktops have an extra vga port.

So, first I started with synergy http://synergy-foss.org/

This allows me to share a a single keyboard + mouse across multiple computers. This also shares the clipboard. With the only minor disadvantage of not being able to move windows across the two screens, I was running two desktops. And it is super responsive. I am also tunneling it via ssh as described in
http://synergy2.sourceforge.net/security.html. In this setup I have a synergy-server whose kbd and mouse are shared and clients.

Second, I wanted all apps on the client-desktop to forward their sound to the server desktop. To do that, I captured the alsa output on the client and pipe it to the server via ssh, where it is

On the client, I did
amixer set ‘Mix’ cap 1>/dev/null 2>/dev/null

amixer set ‘Capture’ cap 1>/dev/null 2>/dev/null

amixer set ‘Capture’ 10% 1>/dev/null 2>/dev/null

amixer set ‘Master’ mute 1>/dev/null 2>/dev/null

amixer set ‘PCM’ 72% 1>/dev/null 2>/dev/null

arecord -f cd 2>/dev/null | \
ssh -c blowfish server “aplay -f cd – 1>/dev/null 2>/dev/null” &

This works perfectly, and after I am done, I kill the ssh process and set back the controls to old values

A single ssh command can also be used to pipe both the audio stream and tunnel synergy data.
arecord -f cd 2>/dev/null | \
ssh -c blowfish -L localhost:24800:server:24800 server \ “aplay -f cd – 1>/dev/null 2>/dev/null” &

I also used a few tricks to sync screen-lock etc, but those are too ugly and specific to my setup.

Advertisement
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s