alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 1/11] expose sound device topology information
@ 2012-08-27 22:28 Clemens Ladisch
  2012-08-27 22:29 ` [RFC PATCH 01/11] ALSA: implement MEDIA_IOC_DEVICE_INFO Clemens Ladisch
                   ` (11 more replies)
  0 siblings, 12 replies; 17+ messages in thread
From: Clemens Ladisch @ 2012-08-27 22:28 UTC (permalink / raw)
  To: Takashi Iwai, Mark Brown, alsa-devel

Hi,

these are some tentative patches to allow sound drivers to provide
routing information to userspace.  (So far, snd-usb-audio has a partial
implementation; I haven't yet had time for snd-hda-intel.  I haven't
even looked at ASoC.)

The media controller API <linux/media.h> allows prividing routing
information, but its implementation does not quite fit the sound
drivers:
* it allows reconfiguration of links, but not in a way that would be
  useful for ALSA selector controls;
* it allows drivers to access the entity graph and pipelines, which is
  not needed;
* it is rather heavyweight.

Therefore, these patches create their own implementation of the media
controller API.  In this implementation, all entity and link information
is completely static, and more space-efficient.

For simplicity, the ioctls hook into the ALSA control device instead
of creating a new /dev/media* device.

The separate implementation does not allow sharing of one media
controller device in the case of combined audio/video devices.  However,
separate drivers would already be a problem for HDMI outputs (GPU and
sound); it appears we might need some mechanism to connect the
topologies of multiple media devices.

TLVs (for jack entities, and for associating controls with entities)
are not yet defined.


Example output for my simple UA-1A device (not all information is
decoded correctly):

$ media-ctl -p -d /dev/snd/controlC5
Opening media device /dev/snd/controlC5
Enumerating entities
Found 4 entities
Enumerating pads and links
Media controller API version 0.0.0

Media device information
------------------------
driver          snd-usb-audio
model           EDIROL UA-1A
serial
bus info        usb-0000:00:12.2-4.3
hw revision     0x101
driver version  0.0.0

Device topology
- entity 1: USB Audio (1 pad, 1 link)
            type Node subtype ALSA
            device node name /dev/tty             (should be hw:5,0,0)
        pad0: Source
                -> "OT3":0 [ENABLED,IMMUTABLE]

- entity 3: OT3 (1 pad, 1 link)
            type Unknown subtype Unknown          (should be Jack)
        pad0: Sink
                <- "USB Audio":0 [ENABLED,IMMUTABLE]

- entity 4: IT4 (1 pad, 1 link)
            type Unknown subtype Unknown
        pad0: Source
                -> "USB Audio":0 [ENABLED,IMMUTABLE]

- entity 7: USB Audio (1 pad, 1 link)
            type Node subtype ALSA
            device node name /dev/tty
        pad0: Sink
                <- "IT4":0 [ENABLED,IMMUTABLE]


 include/linux/media.h     |    9
 include/sound/core.h      |   13 +
 include/sound/media.h     |  116 ++++++++++
 include/sound/pcm.h       |    6
 sound/core/Kconfig        |    7
 sound/core/Makefile       |    1
 sound/core/init.c         |    4
 sound/core/media.c        |  425 ++++++++++++++++++++++++++++++++++++++
 sound/core/pcm.c          |   46 ++++
 sound/core/sound.c        |    3
 sound/pci/hda/hda_intel.c |    2
 sound/usb/card.c          |    2
 sound/usb/mixer.c         |  278 ++++++++++++++++++++++++
 sound/usb/quirks.c        |    4
 sound/usb/stream.c        |   16 -
 sound/usb/stream.h        |    1
 16 files changed, 925 insertions(+), 8 deletions(-)


Regards,
Clemens

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2012-09-07 10:40 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-27 22:28 [RFC PATCH 1/11] expose sound device topology information Clemens Ladisch
2012-08-27 22:29 ` [RFC PATCH 01/11] ALSA: implement MEDIA_IOC_DEVICE_INFO Clemens Ladisch
2012-09-07  2:13   ` Mark Brown
2012-09-07  7:14     ` Clemens Ladisch
2012-09-07 10:40       ` Takashi Iwai
2012-08-27 22:30 ` [RFC PATCH 02/11] ALSA: implement MEDIA_IOC_ENUM_ENTITIES Clemens Ladisch
2012-08-27 22:30 ` [RFC PATCH 03/11] ALSA: pcm: add ALSA PCM device entities Clemens Ladisch
2012-08-27 22:31 ` [RFC PATCH 04/11] ALSA: implement MEDIA_IOC_ENUM_LINKS (1) Clemens Ladisch
2012-08-27 22:31 ` [RFC PATCH 05/11] ALSA: implement MEDIA_IOC_ENUM_LINKS (2) Clemens Ladisch
2012-08-27 22:32 ` [RFC PATCH 06/11] ALSA: implement MEDIA_IOC_SETUP_LINK Clemens Ladisch
2012-08-27 22:33 ` [RFC PATCH 07/11] [media] media: add entity types for ALSA Clemens Ladisch
2012-08-27 22:33 ` [RFC PATCH 08/11] ALSA: usb-audio: implement card get_info callback Clemens Ladisch
2012-08-27 22:34 ` [RFC PATCH 09/11] ALSA: usb-audio: create PCM device entities Clemens Ladisch
2012-08-27 22:35 ` [RFC PATCH 10/11] ALSA: usb-audio: add terminal/unit entities and links Clemens Ladisch
2012-08-27 22:36 ` [RFC PATCH 11/11] ALSA: hda-intel: implement card get_info callback Clemens Ladisch
2012-09-04 15:56 ` [RFC PATCH 1/11] expose sound device topology information Takashi Iwai
2012-09-04 18:02   ` Clemens Ladisch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).