This was a talk on how to build systems with Kamaelia given at Pycon UK. It
goes through from basics through to building a swarming P2P live radio
system.
TeamStation AI System Report LATAM IT Salaries 2024
Building systems with Kamaelia
1. Kamaelia:
SnapTogether Software
Michael Sparks
Senior Research Engineer
BBC Research & Innovation
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
2. BBC R&I ...
PAL, Teletext, NICAM,
DVB, DAB, Freeview, TV Anytime
Majority of BBC Open Source Projects
inc Dirac, Kamaelia
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
3. Key Research
goal?
To make concurrency
easy to work with
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
4. How???
Single Reader/Single Writer
Communicating Sequential Things
Original context: scalable servers
Component Composition
Written in Python
Ideas are language agnostic
Proof of concept in C++
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
5. How???
No, I don't believe in “one
language to rule them all”
*cough*Erlang*cough*
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
6. (demo)
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
7. ie this:
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
8. What I'm aiming to
get through
P2P Radio
What?
System
Walkthrough Q&A
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
9. What?
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
10. What if... ?
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
11. What has it been
used for?
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
12. Who's used it?
Radio & Music
Interactive
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
13. Who's used it?
Matt Biddulph
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
14. Who's used it?
Matt Biddulph
Open Days “this is what I need”
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
15. Who's used it?
Matt Biddulph
Open Days “this is what I need”
Record All Radio PVR
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
16. Who's used it?
Matt Biddulph
Open Days “this is what I need”
Record All Radio PVR
Podcasts
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
17. Who's used it?
Matt Biddulph
Open Days “this is what I need”
Record All Radio PVR
Podcasts
Proof of concept
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
18. Who's used it?
Matt Biddulph
Open Days “this is what I need”
Record All Radio PVR
Podcasts
Proof of concept
Prototyping for experimentation
for new services
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
19. Who's used it?
Prototyping for
experimentation for new
services
... without any involvement
from R&D
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
20. Who's used it?
Prototyping for
experimentation for new
services
... without any involvement
from R&D
due to being open source
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
21. Who's used it?
BBC Macro
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
22.
Blog frontend
Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
& Meta Store
Programme
bbc one transcoder
Kamaelia Backend
bbc two transcoder
DEMUXER
bbc three transcoder
TUNER
bbc four transcoder
cbbc transcoder
cbeebies transcoder
Kamaelia
news 24 transcoder
parliament transcoder
23. Who's used it?
Rapid Prototyping
of Collaborative
Community Radio
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
24. Who's used it? DJs in the
Channel Controller
Community
Control
Streaming Networ
Server k Mixer
Playout Web Front End
Linked by
Music Store
videoconf
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
25. Who's used it? DJs in the
Channel Controller
Community
Control
Streaming Networ
Server k Mixer
Playout Web Front End
Linked by
Music Store
videoconf
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
26. Google's Summer of
Code Student Work
2006, 2007
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
27. Bit Torrent 2006
Programmes...
WEBSITE
Ingest
BitTorrent Metadata
Split
Store
Torrent Maker
Web Client
Torrent Peer
Swarm Store
Torrent Peer Access
Programmes...
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
28. Open GL 2006
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
29. 2006
Trusted Communications
eg secure phone Decrypt
ie trusted by the user Audio Decode
Encrypt
Decrypt
BUFFER
Encrypt
Decrypt
AudioPlayer
Encrypt
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
30. 2007
Filelike Interface
> (Much!) simpler usage outside
Kamaelia systems
IRC/AIM Components
> causes creation of components
> allows remote control of systems
Visual Component Generation
> Sub component model
> aim:easier creation of components
visually (rather than systems)
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
31. Other Systems
Reframing for mobile, remuxing DVBT
interactive aps for multicast streams,
Whiteboarding, VoIP testing, etc.
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
32. Walkthrough
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
37. Diving Inside?
from Axon.ThreadedComponent import
threadedcomponent
class ConsoleReader(threadedcomponent):
def main(self):
eol = quot;nquot;
while 1:
# this blocks so we use a thread
line = raw_input(quot;>>> quot;)
line = line + eol
self.send(line, quot;outboxquot;)
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
38. Diving Inside?
from Axon.Component import component
class ConsoleEchoer(component):
def main(self):
while 1:
while self.dataReady(quot;inboxquot;):
data = self.recv(quot;inboxquot;)
_sys.stdout.write(str(data))
_sys.stdout.flush()
yield 1
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
39. Used thus...
Pipeline( ConsoleReader(),
ConsoleEchoer(),
).run()
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
52.
Kamaelia is already a highly
capable platform that has
delivered some interesting
tools
Currently version 0.5.0
Version reflects where we want to be
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
53. However it also shows that
you can make
concurrency easier to work
with, even in a normal
language
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
54. You can build your own
version if you follow our
“mini axon” tutorial using
your language of choice
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
55. Suggestions:
Take it, use it
Build cool stuff with it
Break it, Fix it
Steal the ideas
Clone in your own
language
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/
56. Thanks for listening :)
http://kamaelia.sf.net/
michael.sparks@bbc.co.uk
Kamaelia Michael Sparks, michaels@rd.bbc.co.uk, http://kamaelia.sf.net/