moss 2016, bucharest, romania - designing the iot jukebox with brillo
TRANSCRIPT
Designing the IoT “Jukebox” with Brillo
Constantin MuscaSoftware Engineer at Intel
Outline
• Problem statement• Solution• System Architecture• Implementation• Conclusions and future work• Demo
Problem statement
• Random music in bars• Music cannot be controlled• Lack of customer engagement
Mission
Music is personal.
Let’s eliminate random music.
Solution: Brillo
What is Brillo ?• Embedded OS• Core services• Developer kit
Image Source: Google
The Brillo Operating System
• Open Source• Maintained• Supports devices as small as 128MB
of storage and 32MB of RAM• Customizable Hardware
Linux Kernel
Android HAL
Device
Admin
System
Services
OTA
updates…Connectivity
The Brillo Core Services and the Developer Console
• Weave• Metrics• Crash reporting
• OTAs
Image Source: Google
The Brillo Developer kit
• Based on the Android.mk architecture
• Standard testing
• Android debug bridge (adb)
Image Source: Google
Weave
Image Source: Google
• Protocol for device discovery, provisioning, authentication, and interaction
• Schema Driven (JSON)
• OAuth 2.0 Authentication, Google as AS
Intel Edison Arduino Board
• High performance dual core Intel CPU• Wi-Fi antenna within the Edison Chip• Support for USB, GPIOs, I2C, SPI
Image Source: intel.com
Grove Starter Kit & USB Speakers
• Grove Base Shield• Grove Light Sensor• Grove LCD• USB Speakers
Hardware System Connections
Software System Architecture
JBClient
USB Audio HAL
JBService
Grove LCD supportWeave support
Binder
Weave Enabled
Applications
Weave Developer Console
Android Application
Weave
Brillo OS JBVolumeService
Implementation: JBClient
• Connects to JBService through Binder• Acts as middleman for all Weave - JBService
communication• Maintains and updates the Weave device state
Image Source: developers.google.com/weave
Implementation: Jukebox Weave Commands Schema
"commands": {"play": {
"parameters": {"songName": {
"type": "string","minLength": 5
}}
},"pause": {},"resume": {},"stop": {},"download": {
"parameters": {"trackUrl": {
"type": "string","minLength": 5
},"filename": {
"type": "string","minLength": 5
}}
}} Image Source: developers.google.com/weave
Implementation: Jukebox Weave State Schema
"state": {"status": {
"type": "string","enum": ["idle", "playing", "paused"]
},"songs": {
"type": "array","items": {"type": "string"}
},"downloadStatus": {
"type": "string","enum": ["idle", "downloading"]
}}
Image Source: developers.google.com/weave
Implementation: Exposed Weave States
Weave states:• Playing status - [idle, playing, paused]• Downloading status - [idle, downloading]• Playlist - list of strings
Playing
Idle
Paused Idle Downloading
Implementation: Jukebox Service
JBService• Ensures a healthy and stable music playing life cycle• Uses Stagefright exposed AudioPlayer for handling music• Uses CURL for downloading new songs• Exposes a list of supported songs (playlist) to Jukebox Client
Implementation: Jukebox Service details
play(song)
pause()
resume()
stop()
Jukebox Player
displayVolume(volume)
displaySong(song)
displayStatus(status)
LCDServiceProxy
downloadSong(url, filename)
getPlaylist()
PlaylistManager
play(song)
pause()
resume()
stop()
download(url, filename)
getPlaylist()
JBService
Implementation: AIDL Interface
interface IJBService {boolean is_playing();void play(String song_name);void pause();void resume();void stop();void download(String track_url,
String filename);boolean is_downloading();
String get_playlist();}
Implementation: Jukebox Volume Service
JB Volume Service• Maps the range of supported values from Light Sensor to
volume• Updates the system volume based on the ambient lighting• Less light yields lower volume while more bright rooms yield
higher volume
Implementation: Jukebox Volume Service
Linux Kernel
libmraa
libupm
Brillo Sensors HAL
Jukebox Volume ServiceSensors HAL API• get_sensors_list(list)• activate(sensor, true/false)• batch(sensor, flags, sampling period, maximum report latency)• setDelay(sensor, sampling period)• flush(sensor)• poll()
libupm• https://github.com/intel-iot-devkit/upm
libmraa• https://github.com/intel-iot-devkit/mraa
Conclusions and future work
Conclusions• It’s easy to build a Weave controllable
Jukebox using Brillo
Future work:• Add support for multiple playlists• Increase the context awareness
Demo
Legal Notices and Disclaimers
•Intel technologies’ features and benefits depend on system configuration and may require enabled hardware, software or service activation. Learn more at intel.com, or from the OEM or retailer.
•No computer system can be absolutely secure.
•Tests document performance of components on a particular test, in specific systems. Differences in hardware, software, or configuration will affect actual performance. Consult other sources of information to evaluate performance as you consider your purchase. For more complete information about performance and benchmark results, visit http://www.intel.com/performance.
•Intel, the Intel logo and others are trademarks of Intel Corporation in the U.S. and/or other countries. *Other names and brands may be claimed as the property of others.
•© 2016 Intel Corporation.