22 Apr, 2019

1 commit

  • 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.

    Change the ALSA driver to use the Media Controller API to share media
    resources with DVB, and V4L2 drivers on a AU0828 media device.

    The Media Controller specific initialization is done after sound card is
    registered. ALSA creates Media interface and entity function graph nodes
    for Control, Mixer, PCM Playback, and PCM Capture devices.

    snd_usb_hw_params() will call Media Controller enable source handler
    interface to request the media resource. If resource request is granted,
    it will release it from snd_usb_hw_free(). If resource is busy, -EBUSY is
    returned.

    Media specific cleanup is done in usb_audio_disconnect().

    Reviewed-by: Takashi Iwai
    Signed-off-by: Shuah Khan
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Shuah Khan
     

01 Apr, 2016

1 commit

  • Unfortunately, this patch caused several regressions at au0828 and
    snd-usb-audio, like this one:
    https://bugzilla.kernel.org/show_bug.cgi?id=115561

    It also showed several troubles at the MC core that handles pretty
    poorly the memory protections and data lifetime management.

    So, better to revert it and fix the core before reapplying this
    change.

    This reverts commit aebb2b89bff0 ("[media] sound/usb: Use Media
    Controller API to share media resources")'

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

04 Mar, 2016

2 commits

  • Fix to use meaningful names instead of numbered goto labels

    Signed-off-by: Shuah Khan
    Signed-off-by: Mauro Carvalho Chehab

    Shuah Khan
     
  • Change ALSA driver to use Media Controller API to share media resources
    with DVB and V4L2 drivers on a AU0828 media device. Media Controller
    specific initialization is done after sound card is registered. ALSA
    creates Media interface and entity function graph nodes for Control,
    Mixer, PCM Playback, and PCM Capture devices.

    snd_usb_hw_params() will call Media Controller enable source handler
    interface to request the media resource. If resource request is
    granted, it will release it from snd_usb_hw_free(). If resource is
    busy, -EBUSY is returned.

    Media specific cleanup is done in usb_audio_disconnect().

    Signed-off-by: Shuah Khan
    Acked-by: Takashi Iwai
    Signed-off-by: Mauro Carvalho Chehab

    Shuah Khan