ViewSync decimating ... playing around with viewsync packets/strings

51 views
Skip to first unread message

Andrew Leahy

unread,
Jan 30, 2012, 7:43:45 AM1/30/12
to liquid-galaxy
G'day, I've been mucking about with LiquidGalaxy ViewSync packets, as this year I want to spend some time on getting multiple rigs talking to each other.


I was interested in seeing what I could "get away with" as far as crunching the crap out of the packets.
It seems we can about halve the number of packets being sent, and each packet can itself by shrunk up to about half.

BTW so far this hasn't had a perceivable benefit on the Liquid Galaxy experience on the rig.
I was maybe hoping this would free up some extra frames-per-second in Google Earth... but alas no.

But I'd like to get feedback from people like Jason & Dan to see if any of this sounds crazy.

I've made changes to the little Perl viewsync relayer that I use between our viewsync 'master/sender' instance and the LG rig.

This is what I'm doing:

A-C remove packets, C-E just make the packets a bit shorter.

A. set a maximum update rate (in packets per second), simply drop packets coming faster than this.
(note: i've seen packets broadcast at over 140fps, which seems excessive! GE renderer tops out at 60fps)

B. don't resend exact duplicates
(note: happens more than I thought, particularly with keyboard control for some reason.. lot's of long streams of dups).

C. reduce the resolution of some of the fields, and again don't resend duplicates.
(note: initially noticed some packets where the last digit in one or two fields simply toggles between two numbers in alternating packets... again just noisy dups. Also some of the fields are pretty long and can be shortened a far bit without losing apparent accuracy/control)

D. remove extraneous "-", "0." strings.
E. take over the counter field, because now it should be increasing a slower rate.


Example of C & D:

Source ViewSync string:
"671,-33.87365100000000,151.20688999999996,2442.76662135082006,-0.00000000000001,0.00000000000000,0.00000000000000,-31574016,-31574016,"

Becomes this crunched ViewSync string:
"671,-33.873651,151.20689,2442.766621,0,0,0,-31574016,-31574016,"

Example of below is from startup and fly-to Sydney.
256 input viewsync packets becomes 107 output, at max rate of 40/second.
And each packet is about half the original size.

$ ./viewsync-rate.pl
Listening for UDP ViewSync messages on port 21566
Sending ViewSync messages to 192.168.1.255:21567 (udp broadcast)
Maximum rate is set at 40 per second, between_usecs = 25000
Found View Master on 192.168.1.50
2.903452 OKAY (0 of 0)
0.791647 OKAY (1 of 10)
0.050971 OKAY (2 of 12)
...
0.033829 OKAY (105 of 250)
0.050261 OKAY (106 of 253)
0.049443 OKAY (107 of 256)
[interval_secs FLAG (sent_count of total_recvd_count)]


PS I don't expect to use "ViewSync packets" to inter-connect far-apart rigs, will most likely have local receivers and generaters of viewsync that get updates at far lower rates. This exercise is mainly about understanding ViewSync.


Any questions, ideas?


Cheers, Andrew
eResearch / Uni of Western Sydney

eggyknap

unread,
Jan 30, 2012, 6:12:16 PM1/30/12
to liquid-galaxy
On Jan 30, 5:43 am, Andrew Leahy <alf...@gmail.com> wrote:> G'day,
I've been mucking about with LiquidGalaxy ViewSync packets, as this>
year I want to spend some time on getting multiple rigs talking to
each> other.
I've been messing with viewsyncrelay, too, though with a different
goal in mind. Since our Liquid Galaxies run on Linux, and neither
Flash nor audio works in Google Earth on Linux, and further since I've
had a tour to build that had lots of video content, I've been
expanding on the idea of triggering mplayer when the ViewSync packets
indicate Earth has been navigated to a particular position. The code
is available in my liquid-galaxy repository clone [1], in
"newviewsyncrelay.pl", with a sample config file in config.yml.
There have been a few overriding goals of this development.
Principally, of course, was getting viewsyncrelay to run actions
reliably when the master Earth instance navigated to the right place,
and to be able to configure those actions without writing lots of
code. Hence the config file. This has worked quite well in practice,
though some modification to mp-control and/or launchmplayer are
planned, to allow greater flexibility with things like mplayer's
window size. In the sample tour I've been working on, various
configurable "actions" start mplayer videos at the right place, and
other "exit_actions" forcibly close mplayer if the user leaves the
placemark in question before the video finishes. This could stand to
be better documented, but it's all a work in progress.
I was encouraged to make sure packets were relayed very quickly from
place to place, so the script is heavily multi-process. One process
accepts packets from one or more configurable sources, and then
distributes them to various process which are in charge of spawning
mplayer or other processes, or forwarding packets to other
destinations. RIght now it hasn't been tested with multicast or
broadcast addresses; that's a definite must for future development.
Another goal has been to allow transformation of viewsync packets
before they're relayed. This is only outlined in the code, but the
details need to be filled in. We've talked about making the code
source-agnostic, so it can relay ViewSync packets as well as, for
instance, mplayer's synchronization traffic. That's just a gleam in
our eyes right now, though.
In the meantime, however, this works quite well to trigger external
actions. It's helpful to realize that (at least in my experience)
navigating to a placemark at a particular latitude / longitude creates
viewsync packets that approximate, but don't necessarily exactly
duplicate, that latitude and longitude. So when defining circumstances
under which an action should fire, it's important to allow for some
fudging of the numbers. I hope to add syntactic sugar in the config
file to make that easy; in the meantime, users simply specify a range
of coordinates within which an action should be triggered. Users can
also indicate how they'd like the action re-triggered when subsequent
packets match the conditions. Conditions can depend on latitude and
longitude, as well as altitude, roll, tilt, and heading.
[1] http://code.google.com/r/eggyknap-lgstuff/
--Josh Tolle...@endpoint.com / eggy...@gmail.com

Jason Holt

unread,
Jan 30, 2012, 6:46:40 PM1/30/12
to liquid...@googlegroups.com
Cool!  Removing duplicate viewsync messages in particular seems like an elegant thing to do.  The protocol is chatty, although on a local wired ethernet I don't think it really moves the needle much for either bandwidth or CPU load.  But it could indeed be useful when syncing galaxies over the internet, especially over a dodgy link.

Andrew Leahy

unread,
Jan 30, 2012, 7:20:50 PM1/30/12
to liquid...@googlegroups.com
Hi Josh, i bow to superior perl coder !

Triggering "things" based on viewsync has heaps of potential for Liquid Galaxy, especially as it can be done without touching Google Earth one little bit! Just need someone with the time, inclination & motivation.

Some of these are on the LG Ideas Page - http://code.google.com/p/liquid-galaxy/wiki/IdeasPage

An obvious one for me is SOUND!
Sound is an "immersive effect" completely missing in Liquid Galaxy!!

The first demo I setup on my Liquid Galaxy was PlanetInAction's 3DSound demo http://www.planetinaction.com/earthsound/


So possible examples:

--  I've always wanted is a "splosh" sound effect when diving into (or out of?) the ocean surface!

the simple approach is to just trigger a sfx when alt=0.

but would probably need a global water surface location and altitude map. some oceans are below alt=0.

if we had a sense of the view moving "up" or "down" then trigger different sfx for diving into and coming out of water.

-- bubbles /diving type noises when under water, simple case alt  < 0. whale song?

-- sounds of waves and surf when at a coast line.

-- wind rushing sfx when flying thru the atmosphere at great speed, would need a velocity indication. probably some sound of 'sfx engine' rather than a loop?

-- rain sound effect when cloud layer is on and the rain is falling. would need to tap into either the weather radar map... or maybe can get flag out of google earth itself??

-- satellite beeps and boops and other "space chatter" when outside the atmosphere.

-- streaming local radio station web streams when close to their geolocation. Imagine flying over different parts of the world and hearing local languages, music, news, etc.

-- stream in geo-located sound sources.
eg. "UK Sound Map" http://sounds.bl.uk/uksoundmap/index.aspx
http://geo.waveshot.com/

, I'm sure there's scientific outreach-based geo-located sound sources out there?? Imagine "live" sounds of the Amazon rainforest.. especially with GE Tree Layer enabled.

-- other geotagged/geolocated sounds sources include -
--
"Those who know, do not speak. Those who speak, do not know." (Lao Tzu)

My household GHG emissions from energy & transport ~4kg CO2e/day or ~1.4tonnes/year
Household daily use of Water 110L, Electricity 3.9kWh, Petrol 1.2L, Gas 0MJ

Jason Holt

unread,
Jan 30, 2012, 7:23:41 PM1/30/12
to liquid...@googlegroups.com
Yes!  I've always wanted sound effects like that.

Andrew Leahy

unread,
Jan 30, 2012, 7:27:02 PM1/30/12
to liquid...@googlegroups.com
arggh. accidentally hit send before completing my train of thought.

-- other geolocated/geotagged sound projects:"London Sound Map" http://www.soundsurvey.org.uk/
http://geo.waveshot.com/
http://locusonus.org/soundmap/024/
HistoryPin project has audio/video
Madrid Sound map - http://www.madridsoundscape.org/
and heaps more, some listed here - http://www.weirdvibrations.com/2010/01/13/sound-maps-ii/

Andrew

ezekiel

unread,
Jan 31, 2012, 2:07:32 PM1/31/12
to liquid-galaxy
My replies aren't showing up - so I'll paste via the Google Groups web
interface:

Hey all,

Don't forget that "launchmplayer", "mp-control", "fadeswitch" and an
example
"viewsyncrelay.pl" which contains code for altitude-based audio AND
lat-long-based video playback have been in the code repository since
early
December 2010!

I could've sworn we had an email exchange about it over a year ago,
but I
don't see it now. Since I can't find the exchange anywhere, I guess I
can put some more
details in here - all of this made easier by recent viewsyncrelay.pl
enhancements:

"launchmplayer" starts up two instances of mplayer on every node at
startup.
Once instance for audio (via HDMI), and one instance with (optionally
cropped)
fullscreen video. The "slave mode" mplayer instances only receive
input via
fifo, so we have "mp-control" to make that easy. "fadeswitch" is
executed by
"viewsyncrelay.pl" when aspects of the ViewSync packets are matched -
it
uses "mp-control" to fade the audio volume down, switch the current
playlist
(either a playlist for a new altitude, or a playlist for video), and
fade
the audio volume back up.

It makes for a really nice, immersive experience - as you're out in
space
you're surrounded by airy trance; as you're flying closer to earth, an
up-beat attack fades in, and if your altitude drops below zero, you're
surrounded by whale songs (even if you're just in a freshwater
lake! :).

Finally - when you land directly in front of the Colosseum, a
fullscreen
video with audio (via HDMI) covers the entire display until you fly
somewhere else.

All of this is included in the examples from the repository purely as
a
proof-of-concept.

Thanks
--
Kiel Christofferson
End Point Corporation
www.endpoint.com

On Jan 30, 7:27 pm, Andrew Leahy <alf...@gmail.com> wrote:
> arggh. accidentally hit send before completing my train of thought.
>
> -- other geolocated/geotagged sound projects:
>
> "UK Sound Map"http://sounds.bl.uk/uksoundmap/index.aspx
> "London Sound Map"http://www.soundsurvey.org.uk/http://geo.waveshot.com/http://locusonus.org/soundmap/024/
> HistoryPin project has audio/video
> Madrid Sound map -http://www.madridsoundscape.org/
> and heaps more, some listed here -http://www.weirdvibrations.com/2010/01/13/sound-maps-ii/
>
> Andrew
>
> On 31 January 2012 11:20, Andrew Leahy <alf...@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
> > Hi Josh, i bow to superior perl coder !
>
> > Triggering "things" based on viewsync has heaps of potential for Liquid
> > Galaxy, especially as it can be done without touching Google Earth one
> > little bit! Just need someone with the time, inclination & motivation.
>
> > Some of these are on the LG Ideas Page -
> >http://code.google.com/p/liquid-galaxy/wiki/IdeasPage
>
> > An obvious one for me is SOUND!
> > Sound is an "immersive effect" completely missing in Liquid Galaxy!!
>
> > The first demo I setup on my Liquid Galaxy was PlanetInAction's 3DSound
> > demohttp://www.planetinaction.com/earthsound/
> >> --Josh Tolleyj...@endpoint.com / eggyk...@gmail.com

ki...@endpoint.com

unread,
Jan 31, 2012, 1:31:38 PM1/31/12
to liquid...@googlegroups.com
Hey all,

Don't forget that "launchmplayer", "mp-control", "fadeswitch" and an example
"viewsyncrelay.pl" which contains code for altitude-based audio AND
lat-long-based video playback have been in the code repository since early
December 2010!

I could've sworn we had an email exchange about it over a year ago, but I
don't see it now.

--

Kiel Christofferson

unread,
Jan 31, 2012, 1:47:33 PM1/31/12
to liquid...@googlegroups.com
On Tue, Jan 31, 2012 at 01:31:38PM -0500, ki...@endpoint.com wrote:
> Hey all,
>
> Don't forget that "launchmplayer", "mp-control", "fadeswitch" and an example
> "viewsyncrelay.pl" which contains code for altitude-based audio AND
> lat-long-based video playback have been in the code repository since early
> December 2010!
>
> I could've sworn we had an email exchange about it over a year ago, but I
> don't see it now.
>

Since I can't find the exchange anywhere, I guess I can put some more


details in here - all of this made easier by recent viewsyncrelay.pl
enhancements:

"launchmplayer" starts up two instances of mplayer on every node at startup.

Once instance for audio, and one instance with (optionally cropped)


fullscreen video. The "slave mode" mplayer instances only receive input via
fifo, so we have "mp-control" to make that easy. "fadeswitch" is executed by
"viewsyncrelay.pl" when aspects of the ViewSync packets are matched - it

uses mp-control to fade the audio volume down, switch current playlist


(either a playlist for a new altitude, or a playlist for video), and fade
the audio volume back up.

It makes for a really nice, immersive experience - as you're out in space
you're surrounded by airy trance; as you're flying closer to earth, an
up-beat attack fades in, and if your altitude drops below zero, you're
surrounded by whale songs (even if you're just in a freshwater lake! :).

Finally - when you land directly in front of the Colosseum, a fullscreen
video with audio (via HDMI) covers the entire display until you fly
somewhere else.

All of this is included in the examples from the repository purely as a
proof-of-concept.

Thanks

Andrew Leahy

unread,
Feb 11, 2012, 6:07:35 AM2/11/12
to liquid...@googlegroups.com
I've added another couple of geo-located soundscape sources to the IdeasPage on the Liquid Galaxy wiki...

 http://soundscapenetwork.org/ - science environmental/ecological  soundscapes.

 http://urbanremix.gatech.edu/ - New York City! click on "Map"


We can do a lot with viewsync and/or javascript glue, but it would be great to have soundscapes incorporated into GE itself, the same way that imagery is (panoramio, 360cities, gigapans, gigapxls, youtube, etc.). This would be a pretty cool feature for Google Earth! We've seen Oceans and Trees added in the last couple of years, howabout a Sound layer?

I guess these other content sources are all curated by a community, I'm not sure the soundscape community is that well organised. Most of the soundscape communities seem to already use 2d maps.google.com, no one is really looking at Google Earth. Maybe we need some Liquid Galaxies running with immersive audio and some little Google magic to bring it together? :)

Andrew
Reply all
Reply to author
Forward
0 new messages