kamaelia - fave 2005

Post on 06-May-2015

1.111 Views

Category:

Economy & Finance

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

This was a talk on Kamaelia, Open source & challenges Kamaelia was originally designed to help explore solutions to.

TRANSCRIPT

KamaeliaMichael Sparks

BBC Research & Development

Fave 2005, Bristol, UK

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

Challenges

• This cause many challenges, from rights through to technology

• BBC R&D exists to make technologies to make decisions possible

The BBC will launch a Creative Archive - free access to BBC content for learning, for creativity, for pleasure.The BBC will make its services available when and where people want them, with a new generation of BBC on-demand services.

Building Public Value, Chapter 2http://www.bbc.co.uk/thefuture/bpv/media.shtml

http://kamaelia.sourceforge.net/Challenges/

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

Changing Technology

• Today - the past 10 years

• Mobiles - true converged device, stor

• Network x10, Storage x 1000, CPU just stalled, but > x 300

• Games - Interactive movies, gesture interfaces

• Your video collection can travel with you

• 10 years off???

• Storage x 1000 ?

• Network x100, pervasive, expectation of data movement

• CPU - massively parallel (PS3 etc)

http://kamaelia.sourceforge.net/Challenges/

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

Challenges

500,000 hours of audio is fridge sized today,at consumer bit-rates

10 years from now: with you always?

Challenge: How do we deliver a BBC repository, dozens of TB in size to 20 million homes, dealing with disk failures and data loss.

http://kamaelia.sourceforge.net/Challenges/

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

Challenges

“Share with your sister!!!”- parents since time began

“What CD/Tape shall we get little Jonny?”

Challenge: Provide systems, acceptable to a mature audience that foster a legal sharing culture, but ensuring that people are still paid for producing content, whilst recognising that the audience will create a lot of content themselves.

Digital Rights (not restrictions) Management

http://kamaelia.sourceforge.net/Challenges/

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

Challenges

New Technologies - proprietary at first, open later

Challenge: Open systems for media delivery must be made to scale to very large scale unidirectional streaming

Real, Microsoft,Apple, Java

Applet systems

Open CodecsOpen ProtocolsOpen Platforms

Past Future

Audience growth x1000

http://kamaelia.sourceforge.net/Challenges/

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

Challenges

Live and non-live very different - not just streaming

Challenge: Need for protocols spanning these systems - collaborative client-hub protocols - allowing integration between P2P, Multicast, Broadcast, whilst ensuring security allowing the audience to trust these systems

Application basedGood for non-liveVariable network

Network basedGood for live

Non-variable network

P2P MulticastMultiple ‘casters’

http://kamaelia.sourceforge.net/Challenges/

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

Challenges“Any speed you can have, I can have fasterAny quality you can have, I just want best”

If my capacity to serve grows 1000 times, but your capacity and desire to consume grows 1000 times,

we cannot serve 1000 times as many people.

Challenge: To find a way of capping the need for bandwidth usage (for quality) on the client side. This means higher quality video at lower bit rates becomes more important with time to eliminate issues caused by a “network moore’s law”

http://kamaelia.sourceforge.net/Challenges/

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

Challenges“The Free Lunch is Over”

Challenge: Create a usable system for producing parallel software systems that promotes reuse, resilience, scales on new concurrent hardware platforms, and due to design naturally encourages the design of parallel software systems

PS3 - 9 CPUs XBox 360 - 3Intel - 100 Cores?

Concurrency is hard

Not a problem for audience...Major problem if designing systems

with a 10 year perspective

(Dancing, driving, lego... ?)

http://kamaelia.sourceforge.net/Challenges/

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

Challenges

Challenge: Create a usable system for producing parallel software systems that promotes reuse, resilience, scales on new concurrent hardware platforms, and due to design naturally encourages the design of parallel software systems

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

Kamaelia: aka What?

• Mechanism for building systems out of components resembling unix pipelines/hardware systems

• Aims to make building Interesting systems quick, simple, easy, fun and naturally concurrent.

• Encourages heavy, easy re-use, like Unix

• BBC R&D, Digital Media Group

• Same group as Dirac, TV-Anytime

• However, this ain’t Unix...

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

Kamaelia Graphlines

• Unlike Unix

• 1-D, 2-D, n-D

• Pipelines & Graphlines

• Data is any data object, not just text

• Much richer environment

• Concepts of Services

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

Who?

• Michael Sparks, Matt Hammond, Joseph Lord

• Core systems, bulk of Kamaelia

• Pre-University Trainee: Ciaran Eaton

• Built a video streaming to mobiles in 3 months

• No prior experience of technology

• Summer Vacation Trainee: Tom Gibson

• Built multicast island joining tools , 6 weeks, No prior experience of technologies in use.

• You?

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

Example Systems

• Streaming Ogg Vorbis over TCP

• Streaming Ogg Vorbis over Simple Reliable Multicast

• Network/Graph viewers (including looking inside Kamaelia systems)

• Command line shell

• Simple games

• Network Streaming Subtitling

• Presentation tools (this this one)

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

Platforms

• Written in Python, also have C++ version

• Runs on Linux, Mac OS X, Windows, Nokia Series 60 phones, also likely to run on Maemo happily

• Components can be written in...

• Python

• C, C++

• Pyrex

• Perl (via hack...)

• etc...

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

Why Open Source?• Release?

• Technology is not the BBC’s core business. Developing anyway. No contribution is not failure. Assists standardisation - enables peer review

• We maximise the benefit to the BBC and the BBC’s community of users from the investment the BBC makes in R&D.

• Use ?

• Technology evaluated on its merits, not special (not strange)

• Why proprietary?

• Take Real - why? Most open, scalable solution at the time. (we don’t tell you to use “windows, sony, philips, etc”)

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

How?

• Components

• Class with single “return and continue” based function, OR implements 3 callbacks, or runs as a thread

• Inboxes/Outboxes

• Linkages

• Scheduler

• Co-ordinating Assistant Tracker

• Think Unix environment & PATH

• “Find me ‘ls’, so I can run it”

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

What’s Available?

• Wide variety suited to networked multimedia:

• Simple SDL based window/surface manager

• Simple Pygame based Game toolkit

• Basic Tk window toolkit integration

• Rate limited file system access

• Generic TCP Client/Server & Multicast components

• Think turbo powered netcat/nc, easily multicast proxy over TCP, overlays, servers

• Ogg Vorbis & Audio decode/playback components

• These can all be use together or independently - “Infinite Diversity in Infinite Combination” - just like programs in shells scripts

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

Coming...

• Swarming P2P component (protocol for upper layers)

• Generic Multicast tunnelling/overlay peer

• Automated Swarming Multicast Island Joiner

• GUI for building pipelines from existing systems

• NEW! Demo!

• More! (What do you want in 10 years time? Use Kamaelia to build it now!)

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

Example Pipelines

• Now to show some example pipelines and graphlines

• Going to whizz through, the idea is to give flavour, not detail

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

TCP Streaming System

server=SimpleServer( protocol=AdHocFileProtocolHandler(file_to_stream), port=clientServerTestPort).activate()

pipeline( TCPClient("127.0.0.1",clientServerTestPort, chargen=1), VorbisDecode(), AOAudioPlaybackAdaptor() ).run()

Example 2

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

Multicast Streaming System

# Serverpipeline( ReadFileAdaptor(file_to_stream, readmode="bitrate", bitrate=400000, chunkrate=50), Multicast_transceiver("0.0.0.0", 0, "224.168.2.9", 1600),).activate()

# Clientpipeline( Multicast_transceiver("0.0.0.0", 1600, "224.168.2.9", 0), detuple(1), VorbisDecode(), AOAudioPlaybackAdaptor(),).run()

Example 4a

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

Simple Reliable Multicast Streaming System

# Server with simple added reliabilty protocolpipeline( ReadFileAdaptor(file_to_stream, readmode="bitrate", bitrate=400000, chunkrate=50), SRM_Sender(), blockise(), # Ensure chunks small enough for multicasting! Multicast_transceiver("0.0.0.0", 0, "224.168.2.9", 1600),).activate()

# Client with simple added reliability protocolpipeline( Multicast_transceiver("0.0.0.0", 1600, "224.168.2.9", 0), detuple(1), SRM_Receiver(), detuple(1), VorbisDecode(), AOAudioPlaybackAdaptor(),).run()

Example 4b

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

Presentation Tool

Graphline( CHOOSER = Chooser(items = files), IMAGE = Image(size=(800,600), position=(8,48)), NEXT = Button(caption="Next", msg="NEXT", position=(72,8)), PREVIOUS = Button(caption="Previous", msg="PREV",position=(8,8)), FIRST = Button(caption="First", msg="FIRST",position=(256,8)), LAST = Button(caption="Last", msg="LAST",position=(320,8)), linkages = { ("NEXT","outbox") : ("CHOOSER","inbox"), ("PREVIOUS","outbox") : ("CHOOSER","inbox"), ("FIRST","outbox") : ("CHOOSER","inbox"), ("LAST","outbox") : ("CHOOSER","inbox"), ("CHOOSER","outbox") : ("IMAGE","inbox"), }).run()

Example 8

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

Simple GameGraphline( newCat = newCat, rotator = loopingCounter(rotation_speed), translation = cartesianPingPong(position,screensize[0],screensize[1],border), scaler = bouncingFloat(scale_speed), imaging = continuousIdentity(cat), shutdown_fanout = fanout(["rotator","translation","scaler", "imaging","self_shutdown"]), linkages = { ("rotator","outbox" ) : ("newCat", "rotator"), ("translation","outbox" ) : ("newCat", "translation"), ("scaler","outbox" ) : ("newCat", "scaler"), ("imaging","outbox" ) : ("newCat", "imaging"), ("newCat", "signal" ): ("shutdown_fanout", "inbox"), ("shutdown_fanout", "rotator") : ("rotator", "control"), ("shutdown_fanout", "translation") : ("translation", "control"), ("shutdown_fanout", "scaler") : ("scaler", "control"), ("shutdown_fanout", "imaging") : ("imaging", "control"), ("shutdown_fanout", "self_shutdown") : ("shutdown_fanout", "control"), } ).activate()

Example 9 (part of!)

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

Writing Components

• Write as you would normally (ignore concurrency), write the smallest, simplest possible solution

• Lends itself to test driven development

• Change all inputs to come from inboxes

• Much like changing a program to read from stdin

• Change all outputs to outboxes

• Much like changing a program to write to stdout

• This approach tends to generate small reusable components and simpler more scalable systems (oddly)

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

Fun Ideas...

• Bunch of random things you could do using Kamaelia:

• Paint program using alpha blending; Rapid Graphical Systems Building; Shared whiteboards, join rooms over network pipes using cheap projectors, 3D “sprite” components

• Stuff we may do:

• Automated distribution over clusters, Kamaelia Component Repository, Automated Intelligent cluster distribution, Component and code migration (take your system with you), compile to silicon?

• Computers not getting in the way of doing things...

©2005 BBC. Part of the Kamaelia project, http://kamaelia.sourceforge.net/ michaels@rd.bbc.co.ukBBC R&D

Demos

GUI System Builder

Introspection

Simple Game

top related