All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: Philippe Bekaert <linux@panokkel.be>
Cc: alsa-devel@alsa-project.org
Subject: Re: PCM channel names
Date: Thu, 19 Aug 2021 09:52:04 +0900	[thread overview]
Message-ID: <YR2rNBk7FgVAk5Ch@workstation> (raw)
In-Reply-To: <8FD26792-0CE4-4E46-B2A5-E3780FC3B15B@panokkel.be>

Hi,

I'm a maintainer of ALSA firewire stack, which supports drivers for
audio and music units in IEEE 1394 bus, including some recording
equipments such as RME Fireface series.

On Wed, Aug 18, 2021 at 05:16:24PM +0200, Philippe Bekaert wrote:
> Same context as my previous mail …
> 
> The RME HDSPe cards have a large number of input and outputs for which the
> standard ALSA channels names and mappings make little sense. 
> 
> Names depend on the card, e.g. Analog.L, Analog.R, AES.1/1 … AES.1/8,
> ADAT.1 … ADAT.8 etc…
> 
> Right now, the hdspm driver provides a ad-hoc virtual file in
> /proc/asound/card<n> containing these names. 
> 
> Isn’t there a more generic interface to communicate PCM channel names
> from driver to user space
> 
> Same questions as before:
> 
> Has anyone been facing similar issues? How have you been solving it? Is
> there any “common practice” or “habits” in this community concerning
> this topic? Would it make sense to define a kind of generic interface
> for PCM naming? Then, has anyone an idea or preference how it should
> look like?
> 
> Again looking forward to your feedback.
> 
> Best regards and thanks in advance,
> 
> Philippe.

I have the same issues, see:

Enhancement request: Add "pretty" port names · Issue #32
https://github.com/takaswie/snd-firewire-improve/issues/32

Actually, in regard of kernel/userspace interaction, we have 'channel map'
structure for Type-Length-Value (TLV) API in ALSA control character device
(see 'include/uapi/sound/asound.h' and 'include/uapi/sound/tlv.h'). The
structure consists of array with channel position and its role defined by
SNDRV_CHMAP_XXX macros.

The macros seem to be designed for standard surround channels such as
2.1 ch, 6 ch, 7.1 ch and so on. Some userspace applications handles the
data of structure for construction of surround channels.

However, in recording equipments, the design might not be suitable since
audio data for analog and digital inputs and outputs are
transferred in the same PCM substream. In the case, we can not find
standard surround channels on audio data frame in the substream.
Furthermore, as long as userspace applications expects standard surround
channels, it's not better to integrate the channel map structure simply
for our purpose.

I think it better to design another way as comprehensive solution, but I
have never found any good way.

The most realistic way is to deliver string literal such as
'analog-input-2' and 'adat-output-5', however it can confuse userspace
applications unless any standardization or conventions since any string
expressions can be delivered. Furthermore, it includes inefficiencies in
kernel memory consumption.


Regards

Takashi Sakamoto

      reply	other threads:[~2021-08-19  0:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18 15:16 PCM channel names Philippe Bekaert
2021-08-19  0:52 ` Takashi Sakamoto [this message]

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=YR2rNBk7FgVAk5Ch@workstation \
    --to=o-takashi@sakamocchi.jp \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux@panokkel.be \
    /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.