Skip to content

Update ALSA, and au0828 drivers to use Managed Media Controller API

Shuah Khan alsa-devel linux-media 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest20 patches 0 repliesNew

Changes since v2 from the cover letter

http://www.spinics.net/lists/linux-media/msg91926.html

1. An important change in this patch series is made to ALSA to check for resources and hold in snd_usb_hw_params(), and release from snd_usb_hw_free(). This change fixed the lockdep warnings seen when resources were held in TRIGGER_START and released from TRIGGER_STOP which could run in IRQ context. I acknowledge Clemens Ladisch for suggesting the correct places to hold/free resources to avoid IRQ path complications.
2. With the above change, the patch series is simpler without the need to change the graph_mutex into a spinlock.
3. I split the patches up differently for easy reviews - no code bloat from v2.
4. A second important change is now the Bridge driver (au0828) owns and drives the graph creation as well as enabling and disabling tuner. It also keeps state information to avoid graph walks in enable_source and disable_source handler. I acknowledge Hans Verkuil for his suggestions and ideas for this change.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/20media: Media Controller register/unregister entity_notify APIdrivers/media/media-device.c include/media/media-device.h+68 -00 replies
2/20media: Add ALSA Media Controller function entitiesinclude/uapi/linux/media.h+8 -10 replies
3/20media: Media Controller enable/disable source handler APIinclude/media/media-device.h+19 -00 replies
4/20media: Media Controller fix to not let stream_count go negativedrivers/media/media-entity.c+12 -60 replies
5/20media: Media Controller export non locking __media_entity_setup_link()drivers/media/media-entity.c+1 -00 replies
6/20media: Media Controller non-locking __media_entity_pipeline_start/stop()drivers/media/media-entity.c include/media/media-entity.h+33 -150 replies
7/20media: v4l-core add v4l_enable/disable_media_tuner() helper functionsdrivers/media/v4l2-core/v4l2-dev.c include/media/v4l2-dev.h+31 -00 replies
8/20media: Move au8522_media_pads enum to au8522.h from au8522_priv.hdrivers/media/dvb-frontends/au8522.h drivers/media/dvb-frontends/au8522_priv.h+7 -80 replies
9/20media: au8522 change to create MC pad for ALSA Audio Outdrivers/media/dvb-frontends/au8522.h drivers/media/dvb-frontends/au8522_decoder.c+2 -00 replies
10/20media: au0828 Use au8522_media_pads enum for pad definesdrivers/media/usb/au0828/au0828-core.c+5 -20 replies
11/20media: au0828 fix au0828_create_media_graph() entity checksdrivers/media/usb/au0828/au0828-core.c+18 -100 replies
12/20media: Change v4l-core to check for tuner availabilitydrivers/media/v4l2-core/v4l2-fh.c drivers/media/v4l2-core/v4l2-ioctl.c drivers/media/v4l2-core/videobuf2-core.c+33 -00 replies
13/20media: dvb-frontend invoke enable/disable_source handlersdrivers/media/dvb-core/dvb_frontend.c drivers/media/dvb-core/dvb_frontend.h+24 -1180 replies
14/20media: au0828 video remove au0828_enable_analog_tuner()drivers/media/usb/au0828/au0828-video.c+0 -610 replies
15/20media: au0828 video change to use v4l_enable_media_tuner()drivers/media/usb/au0828/au0828-video.c+12 -20 replies
16/20media: au0828 change to use Managed Media Controller APIdrivers/media/usb/au0828/au0828-core.c+22 -230 replies
17/20media: au0828 change to register/unregister entity_notify hookdrivers/media/usb/au0828/au0828-core.c drivers/media/usb/au0828/au0828.h+102 -820 replies
18/20media: au0828 implement enable_source and disable_source handlersdrivers/media/usb/au0828/au0828-core.c drivers/media/usb/au0828/au0828.h+149 -20 replies
19/20media: dvb-core create tuner to demod pad link in disabled statedrivers/media/dvb-core/dvbdev.c+2 -10 replies
20/20sound/usb: Update ALSA driver to use Managed Media Controller APIsound/usb/Makefile sound/usb/card.c sound/usb/card.h +8 more+310 -80 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH MC Next Gen 00/20] Update ALSA, and au0828 drivers to use Managed Media Controller API

This patch series updates ALSA driver, and au0828 core driver to use Managed Media controller API to share tuner. Please note that Managed Media Controller API and DVB and V4L2 drivers updates to use Media Controller API have been added in a prior patch series.

Media Controller API is enhanced with two new interfaces to register and unregister entity_notify hooks to allow drivers to take appropriate actions when as new entities get added to the shared media device.

Tested exclusion between digital, analog, and audio to ensure when tuner has an active link to DVB FE, analog, and audio will detect and honor the tuner busy conditions and vice versa.

Please find the graphs generated using mc_nextgen_test tool at various points during testing at:

https://drive.google.com/folderview?id=0B0NIL0BQg-Alb3JFb2diMXRoQlU&usp=sharing

This patch series is the port of the same work that was done in the following patch series to use Media Controller Next Gen API.

Patch v3 - Media Controller API:
https://www.mail-archive.com/[email protected]/msg92572.html

References and History:

Changes since v2:
http://www.spinics.net/lists/linux-media/msg91926.html

1. An important change in this patch series is made to ALSA to check for resources and hold in snd_usb_hw_params(), and release from snd_usb_hw_free(). This change fixed the lockdep warnings seen when resources were held in TRIGGER_START and released from TRIGGER_STOP which could run in IRQ context. I acknowledge Clemens Ladisch for suggesting the correct places to hold/free resources to avoid IRQ path complications.
2. With the above change, the patch series is simpler without the need to change the graph_mutex into a spinlock.
3. I split the patches up differently for easy reviews - no code bloat from v2.
4. A second important change is now the Bridge driver (au0828) owns and drives the graph creation as well as enabling and disabling tuner. It also keeps state information to avoid graph walks in enable_source and disable_source handler. I acknowledge Hans Verkuil for his suggestions and ideas for this change.

History:
This patch series has been updated to address comments from 3 previous versions of this series. Links to v3 version for reference are:

https://www.mail-archive.com/linux-media%40vger.kernel.org/msg89491.html
https://www.mail-archive.com/[email protected]/msg89492.html
https://www.mail-archive.com/linux-media%40vger.kernel.org/msg89493.html
Shuah Khan (20):
media: Media Controller register/unregister entity_notify API
media: Add ALSA Media Controller function entities
media: Media Controller enable/disable source handler API
media: Media Controller fix to not let stream_count go negative
media: Media Controller export non locking __media_entity_setup_link()
media: Media Controller non-locking
__media_entity_pipeline_start/stop()
media: v4l-core add v4l_enable/disable_media_tuner() helper functions
media: Move au8522_media_pads enum to au8522.h from au8522_priv.h
media: au8522 change to create MC pad for ALSA Audio Out
media: au0828 Use au8522_media_pads enum for pad defines
media: au0828 fix au0828_create_media_graph() entity checks
media: Change v4l-core to check for tuner availability
media: dvb-frontend invoke enable/disable_source handlers
media: au0828 video remove au0828_enable_analog_tuner()
media: au0828 video change to use v4l_enable_media_tuner()
media: au0828 change to use Managed Media Controller API
media: au0828 change to register/unregister entity_notify hook
media: au0828 implement enable_source and disable_source handlers
media: dvb-core create tuner to demod pad link in disabled state sound/usb: Update ALSA driver to use Managed Media Controller API

 drivers/media/dvb-core/dvb_frontend.c        | 139 ++---------
 drivers/media/dvb-core/dvb_frontend.h        |   3 +
 drivers/media/dvb-core/dvbdev.c              |   3 +-
 drivers/media/dvb-frontends/au8522.h         |   8 +
 drivers/media/dvb-frontends/au8522_decoder.c |   1 +
 drivers/media/dvb-frontends/au8522_priv.h    |   8 -
 drivers/media/media-device.c                 |  43 ++++
 drivers/media/media-entity.c                 |  64 +++--
 drivers/media/usb/au0828/au0828-core.c       | 337 ++++++++++++++++++++-------
 drivers/media/usb/au0828/au0828-video.c      |  75 +-----
 drivers/media/usb/au0828/au0828.h            |   8 +
 drivers/media/v4l2-core/v4l2-dev.c           |  27 +++
 drivers/media/v4l2-core/v4l2-fh.c            |   1 +
 drivers/media/v4l2-core/v4l2-ioctl.c         |  29 +++
 drivers/media/v4l2-core/videobuf2-core.c     |   3 +
 include/media/media-device.h                 |  44 ++++
 include/media/media-entity.h                 |   3 +
 include/media/v4l2-dev.h                     |   4 +
 include/uapi/linux/media.h                   |   9 +-
 sound/usb/Makefile                           |  15 +-
 sound/usb/card.c                             |   5 +
 sound/usb/card.h                             |   1 +
 sound/usb/media.c                            | 201 ++++++++++++++++
 sound/usb/media.h                            |  53 +++++
 sound/usb/mixer.c                            |   1 +
 sound/usb/pcm.c                              |  29 ++-
 sound/usb/quirks-table.h                     |   1 +
 sound/usb/quirks.c                           |   9 +-
 sound/usb/stream.c                           |   2 +
 sound/usb/usbaudio.h                         |   1 +
 30 files changed, 823 insertions(+), 304 deletions(-)
 create mode 100644 sound/usb/media.c
 create mode 100644 sound/usb/media.h
Signature · 1 line
2.1.4