In preparation for the Linux Plumber Conference next week, there has been considerable discussion about Hans Verkuil’s proposed Media Controller framework.
If you only took a cursory read of the framework, you might wonder why you would care about any of this if you aren’t building embedded systems. However, there is actually a *very* real-world capability that many people are interested in:
- Ever want to run tvtime without having to run sox or arecord/aplay in the background?
- Ever want to run mplayer without all those annoying command line arguments to specify which alsa device to use?
- Ever have a system with two analog tuners, and you have to manually match up the /dev/vbi entries with the /dev/video entries?
All three of the above problems are a manifestation of the same problem: an inability for userland applications to know how different devices are related. The Media Controller framework solves that problem.
Here is an example of running Hans’ example command-line tool:
root@ubuntumb:~/v4l-dvb-mc/v4l2-apps# util/v4l2-mc --all
Nodes:
ID: 00010000
Name: media controller
Description:
Type: Node
Subtype: V4L
Inputs: 0
Outputs: 0
Total Links: 0
Major/Minor: 81/0
ID: 00010001
Name: em28xx #0 video
Description:
Type: Node
Subtype: V4L
Inputs: 0
Outputs: 0
Total Links: 0
Major/Minor: 81/1
ID: 00010002
Name: em28xx #0 vbi
Description:
Type: Node
Subtype: V4L
Inputs: 0
Outputs: 0
Total Links: 0
Major/Minor: 81/2
ID: 00010003
Name: Em28xx Audio
Description:
Type: Node
Subtype: ALSA
Inputs: 0
Outputs: 0
Total Links: 0
ALSA: 1
Note the items above in red? That’s the ALSA device that you would need to connect to for the HVR-950’s audio stream. With the changes described above, applications like tvtime and mplayer could be modified to automatically know where to find the audio and VBI devices associated with a video stream.
I’ve cloned Hans’ code and added initial support the ALSA (his original tree didn’t have it yet). Feel free to play with it:
http://kernellabs.com/hg/~dheitmueller/v4l-dvb-mc-alsa/
Comments welcome, of course…