SlideShare une entreprise Scribd logo
1  sur  14
Télécharger pour lire hors ligne
Linux Kernel and
Multimídia
Mauro Carvalho Chehab
Linux Kernel Maintainer of the Media Subsystem
Linux Kernel Expert
Samsung Open Source Group
Aug 17, 2013

Open Source Group – Silicon Valley

Not to be used for commercial purpose without getting permission
All information, opinions and ideas herein are exclusively the author's own opinion

© 2013 SAMSUNG Electronics Co.
Linux is Everywhere

2
Open Source Group – Silicon Valley

© 2013 SAMSUNG Electronics Co.
The Linux Kernel Devel Model
●

Kernel is the core of the operational system that runs a Linux system

●

Its development is dictated by the community, not by someone or some company
–

If someone (and/or their company) wants a feature, submit a patch
●

●

The community reviews the patch. If community is happy, it gets merged

The development community is huge and open
–
–

●

All discussions are via mailing lists (generally hosted at vger.kernel.org);
IRC (and physical meetings) help to get agreements on more polemic items

A new Linux Kernel version is released on every ~2 months
–

–

●

●

After a new release, 2 weeks are used to merge the features for the next one.
This period of time is called: “merge window”;
A variable period (typically 8 weeks) is used to review the code. After each
week, a new release candidate is released (so, about 7 rc's and a final version).

Contributions are open to everyone, and patches are publicly reviewed
Subsystem maintainers are responsible to collect the accepted patches, do a final
review and submit them to Linus Torvards (the creator of Linux).
3

Open Source Group – Silicon Valley

© 2013 SAMSUNG Electronics Co.
Development model of the Kernel

4
Open Source Group – Silicon Valley

© 2013 SAMSUNG Electronics Co.
Some devel stats on Kernel 3.10
Most active 3.10 developers
By changesets
By changed lines
H Hartley Sweeten
392
2.9% Joe Perches
34561
Jingoo Han
299
2.2% Hans Verkuil
18739
Hans Verkuil
293
2.2% Kent Overstreet
18690
Alex Elder
268
2.0% Larry Finger
17222
Al Viro
205
1.5% Greg Kroah-Hartman
16610
Felipe Balbi
202
1.5% Shawn Guo
12879
Sachin Kamat
192
1.4% Dave Chinner
12838
Laurent Pinchart
174
1.3% Paul Zimmerman
12637
Johan Hovold
159
1.2% H Hartley Sweeten
12518
Mauro Carvalho Chehab
158
1.2% Al Viro
11116
Wei Y
ongjun
139
1.0% Andrey Smirnov
11107
Arnd Bergmann
138
1.0% Mauro Carvalho Chehab
9726
Eduardo Valentin
138
1.0% Laurent Pinchart
9258
Axel Lin
112
0.8% Jussi Kivilinna
8960
Lee Jones
111
0.8% Lee Jones
8598
Lars-Peter Clausen
99
0.7% Sylwester Nawrocki
8305
Kuninori Morimoto
98
0.7% Artem Bityutskiy
8094
T
ejun Heo
97
0.7% Dave Airlie
7546
Mark Brown
97
0.7% Guenter Roeck
7510
Johannes Berg
96
0.7% Sanjay Lal
7428

Total of 1,374 developers and 13.500 changesets

In blue: media developers
5

Open Source Group – Silicon Valley

4.5%
2.4%
2.4%
2.2%
2.2%
1.7%
1.7%
1.6%
1.6%
1.4%
1.4%
1.3%
1.2%
1.2%
1.1%
1.1%
1.0%
1.0%
1.0%
1.0%

source: http://lwn.net/Articles/555867/
© 2013 SAMSUNG Electronics Co.
How to start contributing
●

RTFM: there are several documents inside the Kernel source explaining the proccess:
–

/Documentation/HOWTO
●

–

/Documentation/CodingStyle
●

–

Main view for new developers
Describes the coding style used by the Linux Kernel

/Documentation/SubmittingPathes e SubmittingDrivers
●

General procedures for submittins patches/drivers
–

It should be noticed that each subsystem may have additional rules

–
–

●

/MAINTAINERS:
Show the subsystem maintainers, driver maintainer and mailing lists that should
be used to send patches

There are two scripts that help to:
–

Check the coding style (checkpatch.pl)

–

Check to whom a patch should be sent (get_maintainer.pl)
6

Open Source Group – Silicon Valley

© 2013 SAMSUNG Electronics Co.
Kernel API's for media devices
●

Video4Linux API (version 2)
–
–

●

For video inputs/outputs and radio, video and analog TV device control
Extending it for Software Digital Radio is currently being discussed

DVB API (version 5)
–

●

Remote Controller / Input evdev APIs
–

●

For Remote Controllers and webcam/grabber buttons

The Advanced Linux Sound Architecture (ALSA)
–

●

For digital TV inputs

For audio inputs, outputs, mixers (and sequencers)

Media Controller API
–

To control complex devices with configurable pipelines

–

Used only on embeeded devices and on UVC (USB Video Class)

–

Subdev API
●

To control each single logical element on complex devices
7

Open Source Group – Silicon Valley

© 2013 SAMSUNG Electronics Co.
Example of a new patch
Patch summary:
Subject: uvc: more buffers
Date: Fri, 09 Aug 2013 12:11:36 -0000
main author
From: Oliver Neukum <oneukum@suse.de>
To: laurent.pinchart@ideasonboard.com , linux-media@vger.kernel.org
Driver maintainer
This is necessary to let the new generation of cameras
from LiteOn used in Haswell ULT notebook operate. Otherwise
the images will be truncated.
Signed-off-by: Oliver Neukum <oneukum@suse.de>

what it does

Mailing List
of the subsystem
Patch description:
why it is needed and
how was done

diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
index 9e35982..9f1930b 100644
--- a/drivers/media/usb/uvc/uvcvideo.h
Patch custodity chain
+++ b/drivers/media/usb/uvc/uvcvideo.h
@@ -114,9 +114,9 @@
confirming that the pach
/* Number of isochronous URBs. */
is GPL plus acks, reviews,
#define UVC_URBS
5
Tests, etc.
/* Maximum number of packets per URB. */
-#define UVC_MAX_PACKETS
32
+#define UVC_MAX_PACKETS
128
/* Maximum number of video buffers. */
-#define UVC_MAX_VIDEO_BUFFERS 32
Unified diff of
+#define UVC_MAX_VIDEO_BUFFERS 128
the changes
/* Maximum status buffer size in bytes of interrupt URB. */
#define UVC_MAX_STATUS_SIZE
16

Source:https://patchwork.linuxtv.org/patch/19656/
9
Open Source Group – Silicon Valley

© 2013 SAMSUNG Electronics Co.
Steps for writing/submitting (1)
●

1) Get a copy of the latest development tree:
–

http://git.linuxtv.org/media_tree.git (for a media patch)

●

2) Write and test the changes

●

3) generate the patch
$ git commit -a
–

write a proper summary, descriptions and add your SOB
$ git show > my_changes.patch

●

3) Check if CodingStyle was not violated or if it doesn't have some common
mistakes:
$ ./script/checkpatch.pl my_changes.patch
–

●

Fix patch until checkpatch.pl is happy and test it again

4) Send it to the maintainers
–

Use get_maintainers.pl to know to whom address the email
$ ./script/get_maintainers.pl my_changes.patch
10

Open Source Group – Silicon Valley

© 2013 SAMSUNG Electronics Co.
Steps for writing/submitting (2)
$ ./scripts/get_maintainer.pl /tmp/uvc-more-buffers.patch
Laurent Pinchart <laurent.pinchart@ideasonboard.com>
(maintainer:USB VIDEO CLASS)
Mauro Carvalho Chehab <m.chehab@samsung.com> (maintainer:MEDIA
INPUT INFRA...)
linux-media@vger.kernel.org (open list:USB VIDEO CLASS)
linux-kernel@vger.kernel.org (open list)

●

In the specific case of media drivers, don't c/c the maintainer. If everything is ok in
the patch, it will appear in a few at patchwork:
–

●

●

https://patchwork.linuxtv.org/project/linux-media/list/

Also, in general, don't copy LKML (linux-kernel). That's the last resort when
there's no specific subsystem mailing list.
Stuff not maintained and without any subsystem maintainer should be submitted
to Andrew Morton <akpm@linux-foundation.org>.
11

Open Source Group – Silicon Valley

© 2013 SAMSUNG Electronics Co.
Now, what happens?
●

Wait for people to review it. It may take some time, as Kernel developers are
generally busy with other stuff
–

Everybody can review a patch, including you.
●

If you find a problem, write an email describing what you noticed.

●

If you tested the patch, reply to it with
Tested-by: you <your.email>

●

If you reviewed the patch but didn't test, reply to it with
Reviewed-by: you <your.email>

●

–

●

Driver/system maintainers can also reply with Acked-by if they're ok if
someone else would review and apply that patch.

A patch with reviews/tests will likely flow quicker than one that would
depend solely on the driver maintainer to test

The driver maintainer will get your patch, test or review and either apply or ask
someone else to apply it;

●

The patch will be applied by a sub-maintainer or by a subsystem maintainer;

●

The subsystem maintainer will send it to Linus on the next merge window.
12

Open Source Group – Silicon Valley

© 2013 SAMSUNG Electronics Co.
Some literature
●

You should read:
–

●

The pertinent docs at Kernel source tree, under Documentation/ directory

Some books for starting working on Kernel:
–

Corbet, J; Rubini, A; Kroah-Hartman, Greg, Linux Device Drivers, 3rd edition,
O'Reilly, 2005
There's an online version: http://lwn.net/Kernel/LDD3/
Love, Robert, Linux Kernel Development, 3rd edition, Addison-Wesley, 2010
–

–
–

Daniel P. Bovet, Marco Cesati, Understanding the Linux Kernel, 3rd edition,
O'Reilly, 2005

–

Venkateswaran, Sreekrishnan, Essential Linux Device Drivers, Prentice Hall,
2008

–

Web useful resources:
●

http://kernelnewbies.org/

●

http://lwn.net
–

V4L2 articles:
● http://lwn.net/Articles/203924/
13

Open Source Group – Silicon Valley

© 2013 SAMSUNG Electronics Co.
References on media drivers
●

How to get and test the latest drivers:
–

●

See http://git.linuxtv.org/media_build.git

Userspace tools:
–

Remote controller/V4L/DVD: http://git.linuxtv.org/v4l-utils.git

●

Wiki pages: http://linuxtv.org/wiki/

●

Mailing list: linux-media@vger.kernel.org

●

IRC channel: irc.freenode.net
–

channels #v4l and #linuxtv

–

Can be assessed via http://webchat.freenode.net/

14
Open Source Group – Silicon Valley

© 2013 SAMSUNG Electronics Co.
Thank you.

15
Open Source Group – Silicon Valley

© 2013 SAMSUNG Electronics Co.

Contenu connexe

Tendances

2012 a deployment pipeline for infrastructure a dev ops case study at nbn _ ...
2012 a deployment pipeline for infrastructure  a dev ops case study at nbn _ ...2012 a deployment pipeline for infrastructure  a dev ops case study at nbn _ ...
2012 a deployment pipeline for infrastructure a dev ops case study at nbn _ ...
sauravs007
 

Tendances (20)

Design, Build,and Maintain the Embedded Linux Platform
Design, Build,and Maintain the Embedded Linux PlatformDesign, Build,and Maintain the Embedded Linux Platform
Design, Build,and Maintain the Embedded Linux Platform
 
Software update for embedded systems
Software update for embedded systemsSoftware update for embedded systems
Software update for embedded systems
 
y2038 issue
y2038 issuey2038 issue
y2038 issue
 
Using open source software to build an industrial grade embedded linux platfo...
Using open source software to build an industrial grade embedded linux platfo...Using open source software to build an industrial grade embedded linux platfo...
Using open source software to build an industrial grade embedded linux platfo...
 
Long-term Maintenance Model of Embedded Industrial Linux Distribution
Long-term Maintenance Model of Embedded Industrial Linux DistributionLong-term Maintenance Model of Embedded Industrial Linux Distribution
Long-term Maintenance Model of Embedded Industrial Linux Distribution
 
淺談 Live patching technology
淺談 Live patching technology淺談 Live patching technology
淺談 Live patching technology
 
Using Embedded Linux for Infrastructure Systems
Using Embedded Linux for Infrastructure SystemsUsing Embedded Linux for Infrastructure Systems
Using Embedded Linux for Infrastructure Systems
 
SLTS kernel and base-layer development in the Civil Infrastructure Platform
SLTS kernel and base-layer development in the Civil Infrastructure PlatformSLTS kernel and base-layer development in the Civil Infrastructure Platform
SLTS kernel and base-layer development in the Civil Infrastructure Platform
 
A Skype case study (2011)
A Skype case study (2011)A Skype case study (2011)
A Skype case study (2011)
 
2012 a deployment pipeline for infrastructure a dev ops case study at nbn _ ...
2012 a deployment pipeline for infrastructure  a dev ops case study at nbn _ ...2012 a deployment pipeline for infrastructure  a dev ops case study at nbn _ ...
2012 a deployment pipeline for infrastructure a dev ops case study at nbn _ ...
 
Embedded Webinar #13: "From Zero to Hero: contribute to Linux Kernel in 15 mi...
Embedded Webinar #13: "From Zero to Hero: contribute to Linux Kernel in 15 mi...Embedded Webinar #13: "From Zero to Hero: contribute to Linux Kernel in 15 mi...
Embedded Webinar #13: "From Zero to Hero: contribute to Linux Kernel in 15 mi...
 
Leveraging CI/CD to improve open stack operation
Leveraging CI/CD to improve open stack operationLeveraging CI/CD to improve open stack operation
Leveraging CI/CD to improve open stack operation
 
Contributing to OpenStack
Contributing to OpenStackContributing to OpenStack
Contributing to OpenStack
 
Software, Over the Air (SOTA) for Automotive Grade Linux (AGL)
Software, Over the Air (SOTA) for Automotive Grade Linux (AGL)Software, Over the Air (SOTA) for Automotive Grade Linux (AGL)
Software, Over the Air (SOTA) for Automotive Grade Linux (AGL)
 
2009-09-24 Get the Hype on System z Webinar with IBM, Current & Future Linux ...
2009-09-24 Get the Hype on System z Webinar with IBM, Current & Future Linux ...2009-09-24 Get the Hype on System z Webinar with IBM, Current & Future Linux ...
2009-09-24 Get the Hype on System z Webinar with IBM, Current & Future Linux ...
 
Skype testing overview
Skype testing overviewSkype testing overview
Skype testing overview
 
Platform Security Summit 18: Xen Security Weather Report 2018
Platform Security Summit 18: Xen Security Weather Report 2018Platform Security Summit 18: Xen Security Weather Report 2018
Platform Security Summit 18: Xen Security Weather Report 2018
 
Embedded Android : System Development - Part III
Embedded Android : System Development - Part IIIEmbedded Android : System Development - Part III
Embedded Android : System Development - Part III
 
Android presentation
Android presentationAndroid presentation
Android presentation
 
XPDDS19: Using Xen to Enable an Open Source Safety Certifiable Automotive Gra...
XPDDS19: Using Xen to Enable an Open Source Safety Certifiable Automotive Gra...XPDDS19: Using Xen to Enable an Open Source Safety Certifiable Automotive Gra...
XPDDS19: Using Xen to Enable an Open Source Safety Certifiable Automotive Gra...
 

Similaire à Linux Kernel and Multimedia

The adoption of FOSS workfows in commercial software development: the case of...
The adoption of FOSS workfows in commercial software development: the case of...The adoption of FOSS workfows in commercial software development: the case of...
The adoption of FOSS workfows in commercial software development: the case of...
dmgerman
 
Faster Computing has contacted Go2Linux and requested a brief prop
Faster Computing has contacted Go2Linux and requested a brief propFaster Computing has contacted Go2Linux and requested a brief prop
Faster Computing has contacted Go2Linux and requested a brief prop
ChereCheek752
 
exp_1_20bca1108(kashish_dixit.docx
exp_1_20bca1108(kashish_dixit.docxexp_1_20bca1108(kashish_dixit.docx
exp_1_20bca1108(kashish_dixit.docx
ApkaAmitbro
 
It’s 2021. Why are we -still- rebooting for patches? A look at Live Patching.
It’s 2021. Why are we -still- rebooting for patches? A look at Live Patching.It’s 2021. Why are we -still- rebooting for patches? A look at Live Patching.
It’s 2021. Why are we -still- rebooting for patches? A look at Live Patching.
All Things Open
 
"Building Complete Embedded Vision Systems on Linux—From Camera to Display," ...
"Building Complete Embedded Vision Systems on Linux—From Camera to Display," ..."Building Complete Embedded Vision Systems on Linux—From Camera to Display," ...
"Building Complete Embedded Vision Systems on Linux—From Camera to Display," ...
Edge AI and Vision Alliance
 

Similaire à Linux Kernel and Multimedia (20)

LCA14: LCA14-403: Importance of migrating external projects used in Android t...
LCA14: LCA14-403: Importance of migrating external projects used in Android t...LCA14: LCA14-403: Importance of migrating external projects used in Android t...
LCA14: LCA14-403: Importance of migrating external projects used in Android t...
 
Open source Android 10 on Orange Pi: Meth or Reality?
Open source Android 10 on Orange Pi: Meth or Reality?Open source Android 10 on Orange Pi: Meth or Reality?
Open source Android 10 on Orange Pi: Meth or Reality?
 
The adoption of FOSS workfows in commercial software development: the case of...
The adoption of FOSS workfows in commercial software development: the case of...The adoption of FOSS workfows in commercial software development: the case of...
The adoption of FOSS workfows in commercial software development: the case of...
 
Unit+seven+ +introduction+to+linux+and+ubuntu
Unit+seven+ +introduction+to+linux+and+ubuntuUnit+seven+ +introduction+to+linux+and+ubuntu
Unit+seven+ +introduction+to+linux+and+ubuntu
 
Unit+seven+ +introduction+to+linux+and+ubuntu
Unit+seven+ +introduction+to+linux+and+ubuntuUnit+seven+ +introduction+to+linux+and+ubuntu
Unit+seven+ +introduction+to+linux+and+ubuntu
 
Linux internals v4
Linux internals v4Linux internals v4
Linux internals v4
 
Maintenance des branches stables du noyau
Maintenance des branches stables du noyauMaintenance des branches stables du noyau
Maintenance des branches stables du noyau
 
Clone Clone Make: a better way to build
Clone Clone Make: a better way to buildClone Clone Make: a better way to build
Clone Clone Make: a better way to build
 
Linux Kernel Participation HowTo
Linux Kernel Participation HowToLinux Kernel Participation HowTo
Linux Kernel Participation HowTo
 
Kernel Recipes 2016 - The kernel report
Kernel Recipes 2016 - The kernel reportKernel Recipes 2016 - The kernel report
Kernel Recipes 2016 - The kernel report
 
Linaro and Android Kernel
Linaro and Android KernelLinaro and Android Kernel
Linaro and Android Kernel
 
Faster Computing has contacted Go2Linux and requested a brief prop
Faster Computing has contacted Go2Linux and requested a brief propFaster Computing has contacted Go2Linux and requested a brief prop
Faster Computing has contacted Go2Linux and requested a brief prop
 
exp_1_20bca1108(kashish_dixit.docx
exp_1_20bca1108(kashish_dixit.docxexp_1_20bca1108(kashish_dixit.docx
exp_1_20bca1108(kashish_dixit.docx
 
Opendaylight SDN Controller
Opendaylight SDN ControllerOpendaylight SDN Controller
Opendaylight SDN Controller
 
ELC-E 2016 Neil Armstrong - No, it's never too late to upstream your legacy l...
ELC-E 2016 Neil Armstrong - No, it's never too late to upstream your legacy l...ELC-E 2016 Neil Armstrong - No, it's never too late to upstream your legacy l...
ELC-E 2016 Neil Armstrong - No, it's never too late to upstream your legacy l...
 
OpenStack Integration with OpenContrail and OpenDaylight
OpenStack Integration with OpenContrail and OpenDaylightOpenStack Integration with OpenContrail and OpenDaylight
OpenStack Integration with OpenContrail and OpenDaylight
 
Long Term Support the Eclipse Way
Long Term Support the Eclipse WayLong Term Support the Eclipse Way
Long Term Support the Eclipse Way
 
It’s 2021. Why are we -still- rebooting for patches? A look at Live Patching.
It’s 2021. Why are we -still- rebooting for patches? A look at Live Patching.It’s 2021. Why are we -still- rebooting for patches? A look at Live Patching.
It’s 2021. Why are we -still- rebooting for patches? A look at Live Patching.
 
Lcu14 312-Introduction to the Ecosystem day
Lcu14 312-Introduction to the Ecosystem day Lcu14 312-Introduction to the Ecosystem day
Lcu14 312-Introduction to the Ecosystem day
 
"Building Complete Embedded Vision Systems on Linux—From Camera to Display," ...
"Building Complete Embedded Vision Systems on Linux—From Camera to Display," ..."Building Complete Embedded Vision Systems on Linux—From Camera to Display," ...
"Building Complete Embedded Vision Systems on Linux—From Camera to Display," ...
 

Plus de Samsung Open Source Group

Plus 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
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Linux Kernel and Multimedia

  • 1. Linux Kernel and Multimídia Mauro Carvalho Chehab Linux Kernel Maintainer of the Media Subsystem Linux Kernel Expert Samsung Open Source Group Aug 17, 2013 Open Source Group – Silicon Valley Not to be used for commercial purpose without getting permission All information, opinions and ideas herein are exclusively the author's own opinion © 2013 SAMSUNG Electronics Co.
  • 2. Linux is Everywhere 2 Open Source Group – Silicon Valley © 2013 SAMSUNG Electronics Co.
  • 3. The Linux Kernel Devel Model ● Kernel is the core of the operational system that runs a Linux system ● Its development is dictated by the community, not by someone or some company – If someone (and/or their company) wants a feature, submit a patch ● ● The community reviews the patch. If community is happy, it gets merged The development community is huge and open – – ● All discussions are via mailing lists (generally hosted at vger.kernel.org); IRC (and physical meetings) help to get agreements on more polemic items A new Linux Kernel version is released on every ~2 months – – ● ● After a new release, 2 weeks are used to merge the features for the next one. This period of time is called: “merge window”; A variable period (typically 8 weeks) is used to review the code. After each week, a new release candidate is released (so, about 7 rc's and a final version). Contributions are open to everyone, and patches are publicly reviewed Subsystem maintainers are responsible to collect the accepted patches, do a final review and submit them to Linus Torvards (the creator of Linux). 3 Open Source Group – Silicon Valley © 2013 SAMSUNG Electronics Co.
  • 4. Development model of the Kernel 4 Open Source Group – Silicon Valley © 2013 SAMSUNG Electronics Co.
  • 5. Some devel stats on Kernel 3.10 Most active 3.10 developers By changesets By changed lines H Hartley Sweeten 392 2.9% Joe Perches 34561 Jingoo Han 299 2.2% Hans Verkuil 18739 Hans Verkuil 293 2.2% Kent Overstreet 18690 Alex Elder 268 2.0% Larry Finger 17222 Al Viro 205 1.5% Greg Kroah-Hartman 16610 Felipe Balbi 202 1.5% Shawn Guo 12879 Sachin Kamat 192 1.4% Dave Chinner 12838 Laurent Pinchart 174 1.3% Paul Zimmerman 12637 Johan Hovold 159 1.2% H Hartley Sweeten 12518 Mauro Carvalho Chehab 158 1.2% Al Viro 11116 Wei Y ongjun 139 1.0% Andrey Smirnov 11107 Arnd Bergmann 138 1.0% Mauro Carvalho Chehab 9726 Eduardo Valentin 138 1.0% Laurent Pinchart 9258 Axel Lin 112 0.8% Jussi Kivilinna 8960 Lee Jones 111 0.8% Lee Jones 8598 Lars-Peter Clausen 99 0.7% Sylwester Nawrocki 8305 Kuninori Morimoto 98 0.7% Artem Bityutskiy 8094 T ejun Heo 97 0.7% Dave Airlie 7546 Mark Brown 97 0.7% Guenter Roeck 7510 Johannes Berg 96 0.7% Sanjay Lal 7428 Total of 1,374 developers and 13.500 changesets In blue: media developers 5 Open Source Group – Silicon Valley 4.5% 2.4% 2.4% 2.2% 2.2% 1.7% 1.7% 1.6% 1.6% 1.4% 1.4% 1.3% 1.2% 1.2% 1.1% 1.1% 1.0% 1.0% 1.0% 1.0% source: http://lwn.net/Articles/555867/ © 2013 SAMSUNG Electronics Co.
  • 6. How to start contributing ● RTFM: there are several documents inside the Kernel source explaining the proccess: – /Documentation/HOWTO ● – /Documentation/CodingStyle ● – Main view for new developers Describes the coding style used by the Linux Kernel /Documentation/SubmittingPathes e SubmittingDrivers ● General procedures for submittins patches/drivers – It should be noticed that each subsystem may have additional rules – – ● /MAINTAINERS: Show the subsystem maintainers, driver maintainer and mailing lists that should be used to send patches There are two scripts that help to: – Check the coding style (checkpatch.pl) – Check to whom a patch should be sent (get_maintainer.pl) 6 Open Source Group – Silicon Valley © 2013 SAMSUNG Electronics Co.
  • 7. Kernel API's for media devices ● Video4Linux API (version 2) – – ● For video inputs/outputs and radio, video and analog TV device control Extending it for Software Digital Radio is currently being discussed DVB API (version 5) – ● Remote Controller / Input evdev APIs – ● For Remote Controllers and webcam/grabber buttons The Advanced Linux Sound Architecture (ALSA) – ● For digital TV inputs For audio inputs, outputs, mixers (and sequencers) Media Controller API – To control complex devices with configurable pipelines – Used only on embeeded devices and on UVC (USB Video Class) – Subdev API ● To control each single logical element on complex devices 7 Open Source Group – Silicon Valley © 2013 SAMSUNG Electronics Co.
  • 8. Example of a new patch Patch summary: Subject: uvc: more buffers Date: Fri, 09 Aug 2013 12:11:36 -0000 main author From: Oliver Neukum <oneukum@suse.de> To: laurent.pinchart@ideasonboard.com , linux-media@vger.kernel.org Driver maintainer This is necessary to let the new generation of cameras from LiteOn used in Haswell ULT notebook operate. Otherwise the images will be truncated. Signed-off-by: Oliver Neukum <oneukum@suse.de> what it does Mailing List of the subsystem Patch description: why it is needed and how was done diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h index 9e35982..9f1930b 100644 --- a/drivers/media/usb/uvc/uvcvideo.h Patch custodity chain +++ b/drivers/media/usb/uvc/uvcvideo.h @@ -114,9 +114,9 @@ confirming that the pach /* Number of isochronous URBs. */ is GPL plus acks, reviews, #define UVC_URBS 5 Tests, etc. /* Maximum number of packets per URB. */ -#define UVC_MAX_PACKETS 32 +#define UVC_MAX_PACKETS 128 /* Maximum number of video buffers. */ -#define UVC_MAX_VIDEO_BUFFERS 32 Unified diff of +#define UVC_MAX_VIDEO_BUFFERS 128 the changes /* Maximum status buffer size in bytes of interrupt URB. */ #define UVC_MAX_STATUS_SIZE 16 Source:https://patchwork.linuxtv.org/patch/19656/ 9 Open Source Group – Silicon Valley © 2013 SAMSUNG Electronics Co.
  • 9. Steps for writing/submitting (1) ● 1) Get a copy of the latest development tree: – http://git.linuxtv.org/media_tree.git (for a media patch) ● 2) Write and test the changes ● 3) generate the patch $ git commit -a – write a proper summary, descriptions and add your SOB $ git show > my_changes.patch ● 3) Check if CodingStyle was not violated or if it doesn't have some common mistakes: $ ./script/checkpatch.pl my_changes.patch – ● Fix patch until checkpatch.pl is happy and test it again 4) Send it to the maintainers – Use get_maintainers.pl to know to whom address the email $ ./script/get_maintainers.pl my_changes.patch 10 Open Source Group – Silicon Valley © 2013 SAMSUNG Electronics Co.
  • 10. Steps for writing/submitting (2) $ ./scripts/get_maintainer.pl /tmp/uvc-more-buffers.patch Laurent Pinchart <laurent.pinchart@ideasonboard.com> (maintainer:USB VIDEO CLASS) Mauro Carvalho Chehab <m.chehab@samsung.com> (maintainer:MEDIA INPUT INFRA...) linux-media@vger.kernel.org (open list:USB VIDEO CLASS) linux-kernel@vger.kernel.org (open list) ● In the specific case of media drivers, don't c/c the maintainer. If everything is ok in the patch, it will appear in a few at patchwork: – ● ● https://patchwork.linuxtv.org/project/linux-media/list/ Also, in general, don't copy LKML (linux-kernel). That's the last resort when there's no specific subsystem mailing list. Stuff not maintained and without any subsystem maintainer should be submitted to Andrew Morton <akpm@linux-foundation.org>. 11 Open Source Group – Silicon Valley © 2013 SAMSUNG Electronics Co.
  • 11. Now, what happens? ● Wait for people to review it. It may take some time, as Kernel developers are generally busy with other stuff – Everybody can review a patch, including you. ● If you find a problem, write an email describing what you noticed. ● If you tested the patch, reply to it with Tested-by: you <your.email> ● If you reviewed the patch but didn't test, reply to it with Reviewed-by: you <your.email> ● – ● Driver/system maintainers can also reply with Acked-by if they're ok if someone else would review and apply that patch. A patch with reviews/tests will likely flow quicker than one that would depend solely on the driver maintainer to test The driver maintainer will get your patch, test or review and either apply or ask someone else to apply it; ● The patch will be applied by a sub-maintainer or by a subsystem maintainer; ● The subsystem maintainer will send it to Linus on the next merge window. 12 Open Source Group – Silicon Valley © 2013 SAMSUNG Electronics Co.
  • 12. Some literature ● You should read: – ● The pertinent docs at Kernel source tree, under Documentation/ directory Some books for starting working on Kernel: – Corbet, J; Rubini, A; Kroah-Hartman, Greg, Linux Device Drivers, 3rd edition, O'Reilly, 2005 There's an online version: http://lwn.net/Kernel/LDD3/ Love, Robert, Linux Kernel Development, 3rd edition, Addison-Wesley, 2010 – – – Daniel P. Bovet, Marco Cesati, Understanding the Linux Kernel, 3rd edition, O'Reilly, 2005 – Venkateswaran, Sreekrishnan, Essential Linux Device Drivers, Prentice Hall, 2008 – Web useful resources: ● http://kernelnewbies.org/ ● http://lwn.net – V4L2 articles: ● http://lwn.net/Articles/203924/ 13 Open Source Group – Silicon Valley © 2013 SAMSUNG Electronics Co.
  • 13. References on media drivers ● How to get and test the latest drivers: – ● See http://git.linuxtv.org/media_build.git Userspace tools: – Remote controller/V4L/DVD: http://git.linuxtv.org/v4l-utils.git ● Wiki pages: http://linuxtv.org/wiki/ ● Mailing list: linux-media@vger.kernel.org ● IRC channel: irc.freenode.net – channels #v4l and #linuxtv – Can be assessed via http://webchat.freenode.net/ 14 Open Source Group – Silicon Valley © 2013 SAMSUNG Electronics Co.
  • 14. Thank you. 15 Open Source Group – Silicon Valley © 2013 SAMSUNG Electronics Co.