moss 2016, bucharest, romania - designing the iot jukebox with brillo
TRANSCRIPT
![Page 1: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/1.jpg)
Designing the IoT “Jukebox” with Brillo
Constantin MuscaSoftware Engineer at Intel
![Page 2: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/2.jpg)
Outline
• Problem statement• Solution• System Architecture• Implementation• Conclusions and future work• Demo
![Page 3: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/3.jpg)
Problem statement
• Random music in bars• Music cannot be controlled• Lack of customer engagement
![Page 4: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/4.jpg)
Mission
Music is personal.
Let’s eliminate random music.
![Page 5: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/5.jpg)
Solution: Brillo
What is Brillo ?• Embedded OS• Core services• Developer kit
Image Source: Google
![Page 6: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/6.jpg)
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
![Page 7: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/7.jpg)
The Brillo Core Services and the Developer Console
• Weave• Metrics• Crash reporting
• OTAs
Image Source: Google
![Page 8: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/8.jpg)
The Brillo Developer kit
• Based on the Android.mk architecture
• Standard testing
• Android debug bridge (adb)
Image Source: Google
![Page 9: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/9.jpg)
Weave
Image Source: Google
• Protocol for device discovery, provisioning, authentication, and interaction
• Schema Driven (JSON)
• OAuth 2.0 Authentication, Google as AS
![Page 10: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/10.jpg)
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
![Page 11: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/11.jpg)
Grove Starter Kit & USB Speakers
• Grove Base Shield• Grove Light Sensor• Grove LCD• USB Speakers
![Page 12: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/12.jpg)
Hardware System Connections
![Page 13: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/13.jpg)
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
![Page 14: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/14.jpg)
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
![Page 15: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/15.jpg)
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
![Page 16: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/16.jpg)
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
![Page 17: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/17.jpg)
Implementation: Exposed Weave States
Weave states:• Playing status - [idle, playing, paused]• Downloading status - [idle, downloading]• Playlist - list of strings
Playing
Idle
Paused Idle Downloading
![Page 18: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/18.jpg)
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
![Page 19: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/19.jpg)
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
![Page 20: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/20.jpg)
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();}
![Page 21: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/21.jpg)
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
![Page 22: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/22.jpg)
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
![Page 23: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/23.jpg)
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
![Page 24: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/24.jpg)
Demo
![Page 25: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/25.jpg)
![Page 26: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo](https://reader031.vdocument.in/reader031/viewer/2022030309/58f280191a28ab3f5b8b45b9/html5/thumbnails/26.jpg)
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.