13.07.2015 Views

Experiences Developing a Wayland-Based IVI HMI - The Linux ...

Experiences Developing a Wayland-Based IVI HMI - The Linux ...

Experiences Developing a Wayland-Based IVI HMI - The Linux ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Experiences</strong> <strong>Developing</strong> a<strong>Wayland</strong> <strong>Based</strong> <strong>IVI</strong> <strong>HMI</strong>Ossama Othman28 May 2013


Context• Provide human-machine interface (<strong>HMI</strong>) better suited for Tizen <strong>IVI</strong>• Driver safety• React to vehicle state• Options• Leverage existing user interfaces: mobile, desktop• Develop <strong>IVI</strong>-specific <strong>HMI</strong>2


Problems• Mobile and desktop user interfaces• Suboptimal screen geometry: resolution,orientation• Do not react to vehicle state• Not safe for drivers• Many features are not useful or suitable for <strong>IVI</strong>• Underlying graphics subsystem may be toolarge or slow• Develop <strong>IVI</strong>-specific <strong>HMI</strong>• May require kernel and graphics hardwareexpertise• May require additional resources for in-housedevelopment• CostCompositorUser SpaceInput FrameworkKernelKMSevdevDRM Graphics DriverHardwareGraphicsInput3


5<strong>HMI</strong> Components


<strong>HMI</strong> Service• Provides “home screen”• Facilitates layout of application graphical surfaces• Out of scope• Application lifecycle management• Sound handling and policy• Input management6


Compositor• Handles interactions with graphics hardware• Combines and renders multiple graphical “surfaces” into animage displayed on-screen• <strong>Wayland</strong>• Core compositor protocol used by <strong>IVI</strong> <strong>HMI</strong>• Additional <strong>IVI</strong> <strong>HMI</strong>-specific <strong>Wayland</strong>-based protocols to be defined• Weston• Reference <strong>Wayland</strong> compositor• <strong>HMI</strong> will leverage extensibility to fill feature gaps7


Application Run-time• Provides reusable set of functionality to applications• HTML5• Webkit• Web API implementations• Toolkits• Native• C library• Middleware• Toolkits8


Client Application• Draws surfaces in a buffer• Cairo• OpenGL• etc• Shares buffer with compositor through <strong>Wayland</strong>• Examples• Media player• Browser9


10Component Structure


11<strong>HMI</strong> Server Side


Server Side Architectures• <strong>HMI</strong> Service• Stand-alone• Integrated• Server side architecture remains transparent to the client• Just an implementation detail from the client point of view• Client does not determine where surfaces are placed12


Stand-alone <strong>HMI</strong> Service• <strong>HMI</strong> service is another <strong>Wayland</strong> basedclient• Separate process from compositor• Communicates with compositor just asclient application would• Example: GEN<strong>IVI</strong> style layermanagement13


Stand-alone <strong>HMI</strong> Service – Sequence Diagramsd Stand-alone <strong>HMI</strong> Serv iceApplicationlibwaylandWestonWeston <strong>HMI</strong> Plugin<strong>HMI</strong> Servicewl_surface_attach()wl_surface_commit()surface_commit()configure_surface()layout_surface()map_surface()weston_surface_update_transform()14


Integrated <strong>HMI</strong> Service• <strong>HMI</strong> Service integrated withcompositor• Embedded directly in compositor plugin• Performs same functions as stand-aloneservice15


Integrated <strong>HMI</strong> Service – Sequence Diagramsd Integrated <strong>HMI</strong> Serv iceApplication libwaylandWeston Weston <strong>HMI</strong> Pluginwl_surface_attach()wl_surface_commit()surface_commit()configure_surface()layout_surface()weston_surface_update_transform()16


<strong>HMI</strong> Server Side Architecture ComparisonProsConsStand-alone Integrated Stand-alone IntegratedReusable / FlexibleSimpler architectureBetter fatal error recovery More efficient: less IPCRapid prototypingFlexibility may not beneededLess efficient: more IPCFatal error recovery maybe more difficultPotentially easier tocompromise compositorstate17


18HTML5 <strong>HMI</strong> Problems


Context: HTML5 <strong>Based</strong> <strong>HMI</strong>• HTML5 based <strong>HMI</strong> functionality similar to desktop window manager• User interaction• Layout of applications• Both native and Web applications must be supported• Application may not be full-screen• Application may not be integrated with Web run-time (e.g. through NaCl)• <strong>IVI</strong>-specific paradigms such as layers should be supported• Layer is a collection of graphical surfaces• Sample layers: home screen decorations, input layer, split “screens”• GEN<strong>IVI</strong>® style layer management19


Problem: Gap Between HTML5 and Native Sides• HTML5 based <strong>HMI</strong> cannot readily layout surfaces created bynative application• <strong>HMI</strong> has no knowledge of surfaces created by native applications• JavaScript events are not visible to native application• Recall that native application may not be integrated with Web run-time• Events generated by compositor are not visible to HTML5 based<strong>HMI</strong>20


Problem: Supporting the Layer Concept• No concept of layers in HTML5• May be emulated using multiple HTML5 Canvases• Canvas based approach not always suitable• Not all Web applications use HTML5 Canvases• Not applicable for native applications21


Solution• Compositor• Plugin exposes layer functionality required by <strong>HMI</strong>• Web run-time plugin• Provides JavaScript API that allows interaction with the compositor• Forwards appropriate events to and from native and application andHTML5 based <strong>HMI</strong>• Alternatives• Use WebSockets to communicate between compositor plugin and HTML5based <strong>HMI</strong>• <strong>IVI</strong>-specific Node.js extensions22


23Other Problems


Desktop Shell-isms• Direct use of wl_shell in application or toolkit• Specific to desktop shell model / use case• Not entirely applicable to <strong>IVI</strong>• Compositor wl_shell implementation may not be available• Proposal for better handling of different <strong>Wayland</strong> shell types currently underreview upstream24


25Conclusion


Summary• <strong>Wayland</strong>• Simple, lightweight, efficient and extensible protocol is ideal for custom <strong>HMI</strong>developmen• HTML5 is a compelling technology for implementing an <strong>HMI</strong>• Many useful HTML5/JS libraries• Very active Web API standardization and development• Native application integration is seemingly difficult but is tractable,nonetheless26


References• Tizen <strong>IVI</strong> Images• Daily: http://download.tizen.org/releases/daily/2.0alpha/ivi-wayland/• Snapshots: http://download.tizen.org/snapshots/2.0alpha/ivi-wayland/• Tizen 3.0 based <strong>IVI</strong> images are a work in progress• <strong>Wayland</strong> and Weston• http://wayland.freedesktop.org/• http://cgit.freedesktop.org/wayland• GEN<strong>IVI</strong>®• http://www.genivi.org/• http://projects.genivi.org/ivi-layer-management/27


LegalINFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL®PRODUCTS. EXCEPT AS PROVIDED IN INTEL'S TERMS AND CONDITIONS OF SALE FOR SUCHPRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL DISCLAIMS ANYEXPRESS OR IMPLIED WARRANTY RELATING TO SALE AND/OR USE OF INTEL PRODUCTS,INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE,MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT, OR OTHERINTELLECTUAL PROPERTY RIGHT.Intel may make changes to specifications, product descriptions, and plans at any time, without notice.All dates provided are subject to change without notice.Intel is a trademark of Intel Corporation in the U.S. and other countries.*Other names and brands may be claimed as the property of others.Copyright © 2013, Intel Corporation. All rights are protected.28

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!