SlideShare una empresa de Scribd logo
1 de 41
Descargar para leer sin conexión
Samsung Open Source Group © SAMSUNG Electronics Co.1
Media Resource Sharing Through
The Media Controller API
Korea Linux Forum, October 26th
2015
Shuah Khan
Samsung Open Source Group
shuahkh@osg.samsung.com
Samsung Open Source Group © SAMSUNG Electronics Co.2
Abstract
Media devices have hardware resources that are shared across several
functions. However, media drivers have no knowledge of which resources are
shared. For example, accessing DVB and ALSA at the same time, or the DVB
and V4L analog video at the same time results in video and audio stream
errors.
At the root of this problem is a lack of a common locking mechanism that can
provide access control. As a result, it is necessary to create a locking
construct at the master device level for all drivers that share a device to
facilitate resource sharing. A common managed media device created at the
parent USB device level can function as this locking construct.
In this talk, Shuah will discuss the Managed Media Controller API and how
ALSA and au0828 use it to share media resources. In addition, she will show
how media-ctl/mc_nextgen_test tool can be used to generate media graphs
for a media device.
Samsung Open Source Group © SAMSUNG Electronics Co.3
Agenda ...
● Media Devices
●
Media vs. Multi-function Devices
● Shared Media Functions Nicely - Challenges
● Exclusive Access Use-cases
● About Win-TV HVR 950Q
● Media Controller API
● Managed Media Controller API
● HVR 950Q Drivers with Managed Media Device
● HVR 950Q Device Media Graphs
● HVR 950Q Drivers Sharing Resources
Samsung Open Source Group © SAMSUNG Electronics Co.4
Media Devices ...
Hauppauge Win TV HVR 950Q
Hybrid USB TV Stick
Kworld UB435-Q V3
Hauppauge 80e PCTV HD Mini Stick
Samsung Open Source Group © SAMSUNG Electronics Co.5
Media vs. Multi-function
Devices ...
● A group of independent
devices.
● Each device implements
a function.
● Sharing is not limited to
attach point.
● A single device.
● MFD framework helps
identify functions as
discrete platform
devices.
● Sharing is limited to
attach point – sub-
devices attached to a
shared bus.
Samsung Open Source Group © SAMSUNG Electronics Co.6
Media vs. Multi-function
Devices ...
● Functions can be shared.
● Media drivers have to
coordinate sharing.
● Fine grain locking.
● Leverage non-media drivers.
e.g: snd-usb-audio for audio
function.
● Each function is independent.
● Drivers don't need to
coordinate sharing.
● Fine grain locking.
Samsung Open Source Group © SAMSUNG Electronics Co.7
Sharing Media Functions
Nicely - Challenges ...
● Drivers are unaware of shared resources.
● Drivers don't have a way to ensure exclusive access to
shared resource/function.
– e.g: Starting Digital application disrupts Video streaming.
● Drivers can access/change modes while resource is in
use by another.
● Existing fine grain locks don't ensure exclusive access.
● Existing locks are local to function drivers. No global
locks that span all drivers.
Samsung Open Source Group © SAMSUNG Electronics Co.8
Exclusive Access Use-cases ...
● Starting Digital application ...
– should not disrupt active Video and Audio streams.
● Starting Video application ...
– should not disrupt active Digital and Audio streams.
● Starting Audio application …
– should not disrupt Video and Digital streams.
● Querying current configuration (read only access)
should work.
Samsung Open Source Group © SAMSUNG Electronics Co.9
About Win-TV HVR 950Q ...
Hardware:
– USB bus – attach point
– Tuner on I2C bus
– Audio Processor
– Decoder
– Video
– Digital
– No Radio
– IR receiver (No transmitter)
Samsung Open Source Group © SAMSUNG Electronics Co.10
About Win-TV HVR 950Q ...
Drivers:
– au0828 usb driver
– au0828 dvb extension
– au0828 analog (v4l2) extension
– i2c Hauppauge eeprom decoder driver
– Xceive xc5000 silicon tuner driver
– snd-usb-audio
Samsung Open Source Group © SAMSUNG Electronics Co.11
About Win-TV HVR 950Q ...
Device/Driver view:
USB Device
struct usb_device
USB Device Parent
struct device
Au0828 USB driver
struct au0828_dev
Snd-usb-audio
Au0828 DVB
Au0828 Video
Shared USB Interface
Au8522 Decoder
Xc5000 tuner
Samsung Open Source Group © SAMSUNG Electronics Co.12
Shared Resource Exclusive
Locking ...
Samsung Open Source Group © SAMSUNG Electronics Co.13
Media Controller API ...
● Relational media graph framework
● Media functions/resources represented as
nodes on a graph
● Media Device serves as the root node
● Allows creating links between nodes
● Allows active/inactive links between nodes
● Allows start/stop pipelines between nodes
Samsung Open Source Group © SAMSUNG Electronics Co.14
Managed Media Controller API ...
Media Device as a device resource
● media_device_get_devres()
● media_device_find_devres()
Samsung Open Source Group © SAMSUNG Electronics Co.15
Managed Media Controller API ...
Allows au0828 and snd-usb-audio share media
device
● Media Device is a managed device resource at
the parent USB device.
● Media Device is the root node for the shared
media graph.
● Media Device gets created by either au0828 or
snd-usb-audio – first one to run probe wins.
Samsung Open Source Group © SAMSUNG Electronics Co.16
HVR 950Q drivers with Managed
Media Device ...
Device/Driver view:
USB Device
struct usb_device
USB Device Parent
struct device
Au0828 USB driver
struct au0828_dev
Snd-usb-audio
Au0828 DVB
Au0828 Video
Shared USB Interface
Managed Media
Device on
USB Device Parent
struct device
Shared Media Device
Au8522 Decoder
Xc5000 tuner
Samsung Open Source Group © SAMSUNG Electronics Co.17
Media Controller Entity Notify
API ...
● media_device_register_entity_notify()
● media_device_unregister_entity_notify()
● Enables drivers to register callbacks to take
action as entities get added by other drivers.
Samsung Open Source Group © SAMSUNG Electronics Co.18
Shared Media Graph Creation ...
● Drivers (au0828, and snd-usb-audio) add
entities for their functions.
● Bridge driver (au0828) creates links between
entities via entity_notify API.
Samsung Open Source Group © SAMSUNG Electronics Co.19
HVR 950Q Media Graph ...
Samsung Open Source Group © SAMSUNG Electronics Co.20
Media Controller Enable/Disable
Source handlers ...
● Media Device - enable/disable source handlers.
● Enable source grants access to shared
resource or returns -EBUSY.
● Disable source marks shared resource free.
● Bridge drivers (e.g au0828) implement and
register enable/disable source handlers to
manage access to shared resources.
Samsung Open Source Group © SAMSUNG Electronics Co.21
Audio owns tuner ...
Samsung Open Source Group © SAMSUNG Electronics Co.22
Audio releases tuner ...
Samsung Open Source Group © SAMSUNG Electronics Co.23
Video owns tuner ...
Samsung Open Source Group © SAMSUNG Electronics Co.24
Video releases tuner ...
Samsung Open Source Group © SAMSUNG Electronics Co.25
Digital owns tuner ...
Samsung Open Source Group © SAMSUNG Electronics Co.26
Digital releases tuner ...
Samsung Open Source Group © SAMSUNG Electronics Co.27
Audio owns tuner – Digital
start/stop ...
Samsung Open Source Group © SAMSUNG Electronics Co.28
Audio owns tuner – Video
start/stop ...
Samsung Open Source Group © SAMSUNG Electronics Co.29
Video owns tuner – Audio
start/stop ...
Samsung Open Source Group © SAMSUNG Electronics Co.30
Video owns tuner – Digital
start/stop ...
Samsung Open Source Group © SAMSUNG Electronics Co.31
Digital owns tuner – Audio
start/stop ...
Samsung Open Source Group © SAMSUNG Electronics Co.32
Digital owns tuner – Video
start/stop ...
Samsung Open Source Group © SAMSUNG Electronics Co.33
tvtime owns tuner ...
Samsung Open Source Group © SAMSUNG Electronics Co.34
tvtime releases tuner ...
Samsung Open Source Group © SAMSUNG Electronics Co.35
After v4l2-ctl –all run ...
Samsung Open Source Group © SAMSUNG Electronics Co.36
mc_nextgen_test tool ...
Usage: mc_nextgen_test [OPTION...]
A testing tool for the MC next geneneration API
-d, --device=DEVICE media controller device (default: /dev/media0
-D, --dot show in Graphviz format
-e, --entities show entities
-i, --interfaces show pads
-I, --intf-links show interface links
-l, --data-links show data links
-?, --help Give this help list
--usage Give a short usage message
-V, --version Print program version
Samsung Open Source Group © SAMSUNG Electronics Co.37
Links to patches ...
● Update ALSA, and au0828 drivers to use Managed
Media Controller API – patch series links:
– https://www.mail-archive.com/linux-media@vger.kernel
.org/msg92752.html
● Mixer and Control Interface support
– https://www.mail-archive.com/linux-media@vger.kernel
.org/msg93084.html
● mc_nextgen_test tool patch to add ALSA entity
support
– https://www.mail-archive.com/linux-media@vger.kernel
.org/msg93086.html
Samsung Open Source Group © SAMSUNG Electronics Co.38
Links to media graphs ...
● Media graphs generated using
mc_nextgen_test tool at various points during
testing at
– https://drive.google.com/open?id=0B0NIL0BQg-
AlLWE3SzAxazBJWm8
Samsung Open Source Group © SAMSUNG Electronics Co.39
Questions ?
Samsung Open Source Group © SAMSUNG Electronics Co.40
Thank You!
Samsung Open Source Group © SAMSUNG Electronics Co.41
About Kworld ATSC TV Stick ...
● Hardware:
– USB bus – attach point
– Tuner on I2C bus
– Digital TV
– Audio
● Drivers:
– em28xx usb driver
– em28xx dvb extension
– dvb frontend adapter: demux, dvr, net
– tda18212

Más contenido relacionado

Similar a Media Resource Sharing Through the Media Controller API

Droidcon 2013 France - Android Platform Anatomy
Droidcon 2013 France - Android Platform AnatomyDroidcon 2013 France - Android Platform Anatomy
Droidcon 2013 France - Android Platform AnatomyBenjamin Zores
 
Ubuntu Core 技术详解
Ubuntu Core 技术详解Ubuntu Core 技术详解
Ubuntu Core 技术详解Rex Tsai
 
Kernel Recipes 2017 - HDMI CEC: Status Report - Hans Verkuil
Kernel Recipes 2017 - HDMI CEC: Status Report - Hans VerkuilKernel Recipes 2017 - HDMI CEC: Status Report - Hans Verkuil
Kernel Recipes 2017 - HDMI CEC: Status Report - Hans VerkuilAnne Nicolas
 
ELCE 2010 - State Of Multimedia In 2010 Embedded Linux Devices
ELCE 2010 - State Of Multimedia In 2010 Embedded Linux DevicesELCE 2010 - State Of Multimedia In 2010 Embedded Linux Devices
ELCE 2010 - State Of Multimedia In 2010 Embedded Linux DevicesBenjamin Zores
 
Mobile apps on the big screen
Mobile apps on the big screenMobile apps on the big screen
Mobile apps on the big screenHeinrich Seeger
 
Utf 8'en'ibm sametime 9 - voice and video deployment
Utf 8'en'ibm sametime 9 - voice and video deployment Utf 8'en'ibm sametime 9 - voice and video deployment
Utf 8'en'ibm sametime 9 - voice and video deployment a8us
 
Movi presentation Singapore video tech meetup
Movi presentation Singapore video tech meetupMovi presentation Singapore video tech meetup
Movi presentation Singapore video tech meetupLars-Erik M Ravn
 
Droidcon 2013 france - The Growth of Android in Embedded Systems
Droidcon 2013 france - The Growth of Android in Embedded SystemsDroidcon 2013 france - The Growth of Android in Embedded Systems
Droidcon 2013 france - The Growth of Android in Embedded SystemsBenjamin Zores
 
Elc Europe 2020 : u-boot- porting and maintaining a bootloader for a multimed...
Elc Europe 2020 : u-boot- porting and maintaining a bootloader for a multimed...Elc Europe 2020 : u-boot- porting and maintaining a bootloader for a multimed...
Elc Europe 2020 : u-boot- porting and maintaining a bootloader for a multimed...Neil Armstrong
 
Userspace drivers-2016
Userspace drivers-2016Userspace drivers-2016
Userspace drivers-2016Chris Simmonds
 
DAVE: Free development platform for XMC code generation
DAVE: Free development platform for XMC code generationDAVE: Free development platform for XMC code generation
DAVE: Free development platform for XMC code generationInfineon4Engineers
 
Android Operating System
Android Operating System Android Operating System
Android Operating System Sunil Maurya
 
Tizen IVI - Rusty Lynch (Intel) - Korea Linux Forum 2012
Tizen IVI - Rusty Lynch (Intel) - Korea Linux Forum 2012Tizen IVI - Rusty Lynch (Intel) - Korea Linux Forum 2012
Tizen IVI - Rusty Lynch (Intel) - Korea Linux Forum 2012Ryo Jin
 
Changyun Wang Under the Supervision of Dr.Turner
Changyun Wang Under the Supervision of Dr.TurnerChangyun Wang Under the Supervision of Dr.Turner
Changyun Wang Under the Supervision of Dr.TurnerVideoguy
 
Optimizing the Audio Decoding Based Upon Hardware Capability: An Android NUPl...
Optimizing the Audio Decoding Based Upon Hardware Capability: An Android NUPl...Optimizing the Audio Decoding Based Upon Hardware Capability: An Android NUPl...
Optimizing the Audio Decoding Based Upon Hardware Capability: An Android NUPl...INFOGAIN PUBLICATION
 
Optimizing the Audio Decoding Based Upon Hardware Capability: An Android NUPl...
Optimizing the Audio Decoding Based Upon Hardware Capability: An Android NUPl...Optimizing the Audio Decoding Based Upon Hardware Capability: An Android NUPl...
Optimizing the Audio Decoding Based Upon Hardware Capability: An Android NUPl...INFOGAIN PUBLICATION
 

Similar a Media Resource Sharing Through the Media Controller API (20)

Droidcon 2013 France - Android Platform Anatomy
Droidcon 2013 France - Android Platform AnatomyDroidcon 2013 France - Android Platform Anatomy
Droidcon 2013 France - Android Platform Anatomy
 
Ubuntu Core 技术详解
Ubuntu Core 技术详解Ubuntu Core 技术详解
Ubuntu Core 技术详解
 
Kernel Recipes 2017 - HDMI CEC: Status Report - Hans Verkuil
Kernel Recipes 2017 - HDMI CEC: Status Report - Hans VerkuilKernel Recipes 2017 - HDMI CEC: Status Report - Hans Verkuil
Kernel Recipes 2017 - HDMI CEC: Status Report - Hans Verkuil
 
ELCE 2010 - State Of Multimedia In 2010 Embedded Linux Devices
ELCE 2010 - State Of Multimedia In 2010 Embedded Linux DevicesELCE 2010 - State Of Multimedia In 2010 Embedded Linux Devices
ELCE 2010 - State Of Multimedia In 2010 Embedded Linux Devices
 
Mobile apps on the big screen
Mobile apps on the big screenMobile apps on the big screen
Mobile apps on the big screen
 
Utf 8'en'ibm sametime 9 - voice and video deployment
Utf 8'en'ibm sametime 9 - voice and video deployment Utf 8'en'ibm sametime 9 - voice and video deployment
Utf 8'en'ibm sametime 9 - voice and video deployment
 
Building Digital TV Support in Linux
Building Digital TV Support in LinuxBuilding Digital TV Support in Linux
Building Digital TV Support in Linux
 
Mktech
MktechMktech
Mktech
 
Movi presentation Singapore video tech meetup
Movi presentation Singapore video tech meetupMovi presentation Singapore video tech meetup
Movi presentation Singapore video tech meetup
 
Droidcon 2013 france - The Growth of Android in Embedded Systems
Droidcon 2013 france - The Growth of Android in Embedded SystemsDroidcon 2013 france - The Growth of Android in Embedded Systems
Droidcon 2013 france - The Growth of Android in Embedded Systems
 
Elc Europe 2020 : u-boot- porting and maintaining a bootloader for a multimed...
Elc Europe 2020 : u-boot- porting and maintaining a bootloader for a multimed...Elc Europe 2020 : u-boot- porting and maintaining a bootloader for a multimed...
Elc Europe 2020 : u-boot- porting and maintaining a bootloader for a multimed...
 
Userspace drivers-2016
Userspace drivers-2016Userspace drivers-2016
Userspace drivers-2016
 
DAVE: Free development platform for XMC code generation
DAVE: Free development platform for XMC code generationDAVE: Free development platform for XMC code generation
DAVE: Free development platform for XMC code generation
 
Mktech
MktechMktech
Mktech
 
Android Operating System
Android Operating System Android Operating System
Android Operating System
 
Tizen IVI - Rusty Lynch (Intel) - Korea Linux Forum 2012
Tizen IVI - Rusty Lynch (Intel) - Korea Linux Forum 2012Tizen IVI - Rusty Lynch (Intel) - Korea Linux Forum 2012
Tizen IVI - Rusty Lynch (Intel) - Korea Linux Forum 2012
 
Changyun Wang Under the Supervision of Dr.Turner
Changyun Wang Under the Supervision of Dr.TurnerChangyun Wang Under the Supervision of Dr.Turner
Changyun Wang Under the Supervision of Dr.Turner
 
Optimizing the Audio Decoding Based Upon Hardware Capability: An Android NUPl...
Optimizing the Audio Decoding Based Upon Hardware Capability: An Android NUPl...Optimizing the Audio Decoding Based Upon Hardware Capability: An Android NUPl...
Optimizing the Audio Decoding Based Upon Hardware Capability: An Android NUPl...
 
Optimizing the Audio Decoding Based Upon Hardware Capability: An Android NUPl...
Optimizing the Audio Decoding Based Upon Hardware Capability: An Android NUPl...Optimizing the Audio Decoding Based Upon Hardware Capability: An Android NUPl...
Optimizing the Audio Decoding Based Upon Hardware Capability: An Android NUPl...
 
Mktech
MktechMktech
Mktech
 

Más de Samsung Open Source Group

The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)Samsung Open Source Group
 
Rapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USBRapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USBSamsung Open Source Group
 
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesTizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesSamsung Open Source Group
 
IoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and BeyondIoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and BeyondSamsung Open Source Group
 
IoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorialIoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorialSamsung Open Source Group
 
Open Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate StrategyOpen Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate StrategySamsung Open Source Group
 
IoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilityIoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilitySamsung Open Source Group
 
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...Samsung Open Source Group
 
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux DeviceAdding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux DeviceSamsung Open Source Group
 
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivityIoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivitySamsung Open Source Group
 
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under LinuxPractical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under LinuxSamsung Open Source Group
 
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/LinuxIoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/LinuxSamsung Open Source Group
 
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of ThingsJerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of ThingsSamsung Open Source Group
 

Más de Samsung Open Source Group (20)

The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)
 
Easy IoT with JavaScript
Easy IoT with JavaScriptEasy IoT with JavaScript
Easy IoT with JavaScript
 
Spawny: A New Approach to Logins
Spawny: A New Approach to LoginsSpawny: A New Approach to Logins
Spawny: A New Approach to Logins
 
Rapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USBRapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USB
 
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesTizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
 
IoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and BeyondIoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and Beyond
 
IoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorialIoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorial
 
GENIVI + OCF Cooperation
GENIVI + OCF CooperationGENIVI + OCF Cooperation
GENIVI + OCF Cooperation
 
Framework for IoT Interoperability
Framework for IoT InteroperabilityFramework for IoT Interoperability
Framework for IoT Interoperability
 
Open Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate StrategyOpen Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate Strategy
 
IoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilityIoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT Interoperability
 
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
 
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux DeviceAdding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
 
IoTivity: From Devices to the Cloud
IoTivity: From Devices to the CloudIoTivity: From Devices to the Cloud
IoTivity: From Devices to the Cloud
 
SOSCON 2016 JerryScript
SOSCON 2016 JerryScriptSOSCON 2016 JerryScript
SOSCON 2016 JerryScript
 
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivityIoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
 
Run Your Own 6LoWPAN Based IoT Network
Run Your Own 6LoWPAN Based IoT NetworkRun Your Own 6LoWPAN Based IoT Network
Run Your Own 6LoWPAN Based IoT Network
 
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under LinuxPractical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
 
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/LinuxIoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
 
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of ThingsJerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
 

Último

%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Hararemasabamasaba
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...chiefasafspells
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburgmasabamasaba
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...masabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 

Último (20)

%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 

Media Resource Sharing Through the Media Controller API

  • 1. Samsung Open Source Group © SAMSUNG Electronics Co.1 Media Resource Sharing Through The Media Controller API Korea Linux Forum, October 26th 2015 Shuah Khan Samsung Open Source Group shuahkh@osg.samsung.com
  • 2. Samsung Open Source Group © SAMSUNG Electronics Co.2 Abstract Media devices have hardware resources that are shared across several functions. However, media drivers have no knowledge of which resources are shared. For example, accessing DVB and ALSA at the same time, or the DVB and V4L analog video at the same time results in video and audio stream errors. At the root of this problem is a lack of a common locking mechanism that can provide access control. As a result, it is necessary to create a locking construct at the master device level for all drivers that share a device to facilitate resource sharing. A common managed media device created at the parent USB device level can function as this locking construct. In this talk, Shuah will discuss the Managed Media Controller API and how ALSA and au0828 use it to share media resources. In addition, she will show how media-ctl/mc_nextgen_test tool can be used to generate media graphs for a media device.
  • 3. Samsung Open Source Group © SAMSUNG Electronics Co.3 Agenda ... ● Media Devices ● Media vs. Multi-function Devices ● Shared Media Functions Nicely - Challenges ● Exclusive Access Use-cases ● About Win-TV HVR 950Q ● Media Controller API ● Managed Media Controller API ● HVR 950Q Drivers with Managed Media Device ● HVR 950Q Device Media Graphs ● HVR 950Q Drivers Sharing Resources
  • 4. Samsung Open Source Group © SAMSUNG Electronics Co.4 Media Devices ... Hauppauge Win TV HVR 950Q Hybrid USB TV Stick Kworld UB435-Q V3 Hauppauge 80e PCTV HD Mini Stick
  • 5. Samsung Open Source Group © SAMSUNG Electronics Co.5 Media vs. Multi-function Devices ... ● A group of independent devices. ● Each device implements a function. ● Sharing is not limited to attach point. ● A single device. ● MFD framework helps identify functions as discrete platform devices. ● Sharing is limited to attach point – sub- devices attached to a shared bus.
  • 6. Samsung Open Source Group © SAMSUNG Electronics Co.6 Media vs. Multi-function Devices ... ● Functions can be shared. ● Media drivers have to coordinate sharing. ● Fine grain locking. ● Leverage non-media drivers. e.g: snd-usb-audio for audio function. ● Each function is independent. ● Drivers don't need to coordinate sharing. ● Fine grain locking.
  • 7. Samsung Open Source Group © SAMSUNG Electronics Co.7 Sharing Media Functions Nicely - Challenges ... ● Drivers are unaware of shared resources. ● Drivers don't have a way to ensure exclusive access to shared resource/function. – e.g: Starting Digital application disrupts Video streaming. ● Drivers can access/change modes while resource is in use by another. ● Existing fine grain locks don't ensure exclusive access. ● Existing locks are local to function drivers. No global locks that span all drivers.
  • 8. Samsung Open Source Group © SAMSUNG Electronics Co.8 Exclusive Access Use-cases ... ● Starting Digital application ... – should not disrupt active Video and Audio streams. ● Starting Video application ... – should not disrupt active Digital and Audio streams. ● Starting Audio application … – should not disrupt Video and Digital streams. ● Querying current configuration (read only access) should work.
  • 9. Samsung Open Source Group © SAMSUNG Electronics Co.9 About Win-TV HVR 950Q ... Hardware: – USB bus – attach point – Tuner on I2C bus – Audio Processor – Decoder – Video – Digital – No Radio – IR receiver (No transmitter)
  • 10. Samsung Open Source Group © SAMSUNG Electronics Co.10 About Win-TV HVR 950Q ... Drivers: – au0828 usb driver – au0828 dvb extension – au0828 analog (v4l2) extension – i2c Hauppauge eeprom decoder driver – Xceive xc5000 silicon tuner driver – snd-usb-audio
  • 11. Samsung Open Source Group © SAMSUNG Electronics Co.11 About Win-TV HVR 950Q ... Device/Driver view: USB Device struct usb_device USB Device Parent struct device Au0828 USB driver struct au0828_dev Snd-usb-audio Au0828 DVB Au0828 Video Shared USB Interface Au8522 Decoder Xc5000 tuner
  • 12. Samsung Open Source Group © SAMSUNG Electronics Co.12 Shared Resource Exclusive Locking ...
  • 13. Samsung Open Source Group © SAMSUNG Electronics Co.13 Media Controller API ... ● Relational media graph framework ● Media functions/resources represented as nodes on a graph ● Media Device serves as the root node ● Allows creating links between nodes ● Allows active/inactive links between nodes ● Allows start/stop pipelines between nodes
  • 14. Samsung Open Source Group © SAMSUNG Electronics Co.14 Managed Media Controller API ... Media Device as a device resource ● media_device_get_devres() ● media_device_find_devres()
  • 15. Samsung Open Source Group © SAMSUNG Electronics Co.15 Managed Media Controller API ... Allows au0828 and snd-usb-audio share media device ● Media Device is a managed device resource at the parent USB device. ● Media Device is the root node for the shared media graph. ● Media Device gets created by either au0828 or snd-usb-audio – first one to run probe wins.
  • 16. Samsung Open Source Group © SAMSUNG Electronics Co.16 HVR 950Q drivers with Managed Media Device ... Device/Driver view: USB Device struct usb_device USB Device Parent struct device Au0828 USB driver struct au0828_dev Snd-usb-audio Au0828 DVB Au0828 Video Shared USB Interface Managed Media Device on USB Device Parent struct device Shared Media Device Au8522 Decoder Xc5000 tuner
  • 17. Samsung Open Source Group © SAMSUNG Electronics Co.17 Media Controller Entity Notify API ... ● media_device_register_entity_notify() ● media_device_unregister_entity_notify() ● Enables drivers to register callbacks to take action as entities get added by other drivers.
  • 18. Samsung Open Source Group © SAMSUNG Electronics Co.18 Shared Media Graph Creation ... ● Drivers (au0828, and snd-usb-audio) add entities for their functions. ● Bridge driver (au0828) creates links between entities via entity_notify API.
  • 19. Samsung Open Source Group © SAMSUNG Electronics Co.19 HVR 950Q Media Graph ...
  • 20. Samsung Open Source Group © SAMSUNG Electronics Co.20 Media Controller Enable/Disable Source handlers ... ● Media Device - enable/disable source handlers. ● Enable source grants access to shared resource or returns -EBUSY. ● Disable source marks shared resource free. ● Bridge drivers (e.g au0828) implement and register enable/disable source handlers to manage access to shared resources.
  • 21. Samsung Open Source Group © SAMSUNG Electronics Co.21 Audio owns tuner ...
  • 22. Samsung Open Source Group © SAMSUNG Electronics Co.22 Audio releases tuner ...
  • 23. Samsung Open Source Group © SAMSUNG Electronics Co.23 Video owns tuner ...
  • 24. Samsung Open Source Group © SAMSUNG Electronics Co.24 Video releases tuner ...
  • 25. Samsung Open Source Group © SAMSUNG Electronics Co.25 Digital owns tuner ...
  • 26. Samsung Open Source Group © SAMSUNG Electronics Co.26 Digital releases tuner ...
  • 27. Samsung Open Source Group © SAMSUNG Electronics Co.27 Audio owns tuner – Digital start/stop ...
  • 28. Samsung Open Source Group © SAMSUNG Electronics Co.28 Audio owns tuner – Video start/stop ...
  • 29. Samsung Open Source Group © SAMSUNG Electronics Co.29 Video owns tuner – Audio start/stop ...
  • 30. Samsung Open Source Group © SAMSUNG Electronics Co.30 Video owns tuner – Digital start/stop ...
  • 31. Samsung Open Source Group © SAMSUNG Electronics Co.31 Digital owns tuner – Audio start/stop ...
  • 32. Samsung Open Source Group © SAMSUNG Electronics Co.32 Digital owns tuner – Video start/stop ...
  • 33. Samsung Open Source Group © SAMSUNG Electronics Co.33 tvtime owns tuner ...
  • 34. Samsung Open Source Group © SAMSUNG Electronics Co.34 tvtime releases tuner ...
  • 35. Samsung Open Source Group © SAMSUNG Electronics Co.35 After v4l2-ctl –all run ...
  • 36. Samsung Open Source Group © SAMSUNG Electronics Co.36 mc_nextgen_test tool ... Usage: mc_nextgen_test [OPTION...] A testing tool for the MC next geneneration API -d, --device=DEVICE media controller device (default: /dev/media0 -D, --dot show in Graphviz format -e, --entities show entities -i, --interfaces show pads -I, --intf-links show interface links -l, --data-links show data links -?, --help Give this help list --usage Give a short usage message -V, --version Print program version
  • 37. Samsung Open Source Group © SAMSUNG Electronics Co.37 Links to patches ... ● Update ALSA, and au0828 drivers to use Managed Media Controller API – patch series links: – https://www.mail-archive.com/linux-media@vger.kernel .org/msg92752.html ● Mixer and Control Interface support – https://www.mail-archive.com/linux-media@vger.kernel .org/msg93084.html ● mc_nextgen_test tool patch to add ALSA entity support – https://www.mail-archive.com/linux-media@vger.kernel .org/msg93086.html
  • 38. Samsung Open Source Group © SAMSUNG Electronics Co.38 Links to media graphs ... ● Media graphs generated using mc_nextgen_test tool at various points during testing at – https://drive.google.com/open?id=0B0NIL0BQg- AlLWE3SzAxazBJWm8
  • 39. Samsung Open Source Group © SAMSUNG Electronics Co.39 Questions ?
  • 40. Samsung Open Source Group © SAMSUNG Electronics Co.40 Thank You!
  • 41. Samsung Open Source Group © SAMSUNG Electronics Co.41 About Kworld ATSC TV Stick ... ● Hardware: – USB bus – attach point – Tuner on I2C bus – Digital TV – Audio ● Drivers: – em28xx usb driver – em28xx dvb extension – dvb frontend adapter: demux, dvr, net – tda18212