From: Clemens Ladisch <clemens@ladisch.de>
To: Takashi Iwai <tiwai@suse.de>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
alsa-devel@alsa-project.org
Subject: [RFC PATCH 1/11] expose sound device topology information
Date: Tue, 28 Aug 2012 00:28:30 +0200 [thread overview]
Message-ID: <503BF48E.1090100@ladisch.de> (raw)
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
next reply other threads:[~2012-08-27 22:29 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-27 22:28 Clemens Ladisch [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=503BF48E.1090100@ladisch.de \
--to=clemens@ladisch.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.