experimental alsa stream support at xawtv3
Quoted 34 lines · Devin Heitmueller
From: Devin Heitmueller <[email protected]>
Subject: Re: [ANNOUNCE] experimental alsa stream support at xawtv3
To: "Hans Verkuil" <[email protected]>
Cc: "Mauro Carvalho Chehab" <[email protected]>, "Linux Media Mailing List" <[email protected]>
Date: Tuesday, 24 May, 2011, 16:57
On Tue, May 24, 2011 at 2:50 AM, HansOh, and how is it expected to handle informing the application about
device contention between DVB and V4L? Some devices share the tuner
and therefore you cannot use both the V4L and DVB device at the same
time. Other products have two independent input paths on the same
board, allowing both to be used simultaneously (the HVR-1600 is a
popular example of this). Sysfs isn't going to tell you this
information, which is why in the MC API we explicitly added the notion
of device groups (so the driver author can explicitly state the
relationships).Today MythTV users accomplish this by manually specifying "Input
Groups". I say that's what they do, but in reality they don't realize
that they need to configure MythTV this way until they complain that
MythTV recordings fail when trying to record programs on both inputs,
at which point an advanced user points it out to
Quoted 8 lines
them. End users
shouldn't have to understand the internal architecture of their
capture card just to avoid weird crashy behavior (which is what often
happens if you try to use both devices simultaneously since almost no
hybrid drivers do proper locking).
Are there mechanisms for device-locking in the v4l api? With my 2 hybrid saa7134 cards I have observed exactly this issues in Mythtv and also in xawtv and kaffeine.... At the moment I disable one device via additional card definitions and modprobe-parameters, so that the other one is "alone" and only one app gets control over the tuner.
But this driver (saa7134) seams not even lock the /dev/video0 correctly, as starting xawtv twice renders the card inoperable and forces rebooting to get the card working again...
Is there a good starting point to implement the locking?
Quoted 6 lines
I am in favor of this finally getting some attention, but the reality
is that sysfs isn't going to cut it. It just doesn't expose enough
information about the underlying hardware layout.
Quoted 11 lines
Devin
Signature · 7 lines
Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Emil
Quoted 2 lines · Emil Meier
Are there mechanisms for device-locking in the v4l api? With my 2 hybrid saa7134 cards I have observed exactly this issues in Mythtv and also in xawtv and kaffeine.... At the moment I disable one device via additional card definitions and modprobe-parameters, so that the other one is "alone" and only one app gets control over the tuner.
There is currently no infrastructure for doing this in the core framework. It varies on based on the bridge. For example, the saa7164 bridge driver won't let you do it (by design it returns -EBUSY), but I believe almost all of the others will. And of course with no locking the net result is completely unpredictable results as you attempt to issue a tuning request on one side while the other side is already in use.
Worth noting that at least in MythTV you can work around the issue in userland by putting both the V4L and DVB device into the same input group. That prevents MythTV from attempting to use both devices at the same time.
Quoted 1 line
But this driver (saa7134) seams not even lock the
/dev/video0correctly, as starting xawtv twice renders the card inoperable and forces rebooting to get the card working again...
Probably worth noting that it is actually legal to have multiple callers open a V4L2 device. The EBUSY condition only occurs when initiating streaming. This is why you can have an application like mplayer playing the video while at the same time using a command line tool to change the channel.
That said, if the card is rendered inoperable until reboot, then you've hit some sort of bug.
Quoted 1 line
Is there a good starting point to implement the locking?
Not really: there isn't really any locking framework today which spans both DVB and V4L.
There are really two different aspects to this problem:
The first is applications being able to tell what DVB and V4L devices are related so that they know that they cannot even attempt to use them at the same time. This is necessary for stuff like MythTV so that it's scheduler can know a conflict exists ahead of time instead of waiting until actually attempting to do the record.
The second aspect is making sure that you simply can never actually use both devices at the same time. This is really about reliability - locking to ensure that two callers don't screw up the state of the tuner.
Devin
Signature · 2 lines
Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com