On 4/2/19 2:40 AM, Shuah Khan wrote:
Media Device Allocator API to allows multiple drivers share a media device.
This API solves a very common use-case for media devices where one physical
device (an USB stick) provides both audio and video. When such media device
exposes a standard USB Audio class, a proprietary Video class, two or more
independent drivers will share a single physical USB bridge. In such cases,
it is necessary to coordinate access to the shared resource.
Using this API, drivers can allocate a media device with the shared struct
device as the key. Once the media device is allocated by a driver, other
drivers can get a reference to it. The media device is released when all
the references are released.
The primary focus for testing The patch series is making sure media
device is released when both drivers release the media device with
a series of unbind/binds on both drivers.
- both au0828 and snd-usb-aduio as built-in
- both au0828 and snd-usb-aduio as modules
- au0828 as module and snd-usb-aduio as built-in
- au0828 as built-in and snd-usb-aduio as module
Test results can be found at:
https://docs.google.com/document/d/1RMF8Rwj7xHJEoOx6_K2f-REgZJ63BMeAVEf-CV-0HsM/edit?usp=sharing
Phew, after posting v2 of my patch "au0828: stop video streaming only when last
user stops" everything now works as it should, including the issue with two VBI
streams you found.
Should I take the selftest patch or will you take that yourself?
Let me know so I can make the pull request for this. It's been a long journey
since the first post on April 9th, 2014: "[RFC PATCH 0/2] managed token devres
interfaces".
Almost exactly five years of work!Amazing. We ended up with a far better solution than the the first patch