moss 2016, bucharest, romania - designing the iot jukebox with brillo

26
Designing the IoT “Jukebox” with Brillo Constantin Musca Software Engineer at Intel

Upload: constantin-musca

Post on 16-Apr-2017

166 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo

Designing the IoT “Jukebox” with Brillo

Constantin MuscaSoftware Engineer at Intel

Page 2: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo

Outline

• Problem statement• Solution• System Architecture• Implementation• Conclusions and future work• Demo

Page 3: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo

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

Mission

Music is personal.

Let’s eliminate random music.

Page 5: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo

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

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

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

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

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

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

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

Hardware System Connections

Page 13: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo

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

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

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

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

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

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

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

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

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

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

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

Demo

Page 25: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo
Page 26: MOSS 2016, Bucharest, Romania - Designing the IoT Jukebox with Brillo

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.