Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USB-Audio: Wrong S/PDIF (iec958) input and output #292

Open
sibzou opened this issue Jan 15, 2023 · 2 comments
Open

USB-Audio: Wrong S/PDIF (iec958) input and output #292

sibzou opened this issue Jan 15, 2023 · 2 comments

Comments

@sibzou
Copy link

sibzou commented Jan 15, 2023

I am new to the Linux sound system. As I understand, USB sound cards doesn't directly tell the kernel or alsa-lib how many S/PDIF inputs and outputs they have. But they obviously tell their "brand name" like "Plantronics USB Headset" or "HP Digital Stereo Headset" for example.

To present the correct number of S/PDIF inputs and outputs to the rest of the userspace, alsa-lib seems to maintain a kind of known devices database in src/conf/cards/USB-Audio.conf.

If a USB card brand is not known in this file, alsa-lib always present a single S/PDIF input and a single S/PDIF output. If the index of this card is 1 for example, snd_pcm_open(&pcm, "iec958:1", SND_PCM_STREAM_PLAYBACK, 0) and snd_pcm_open(&pcm, "iec958:1", SND_PCM_STREAM_CAPTURE, 0) will always return 0 even if the USB device doesn't have a real S/PDIF input or output.

My question is why this is the default behavior? We are in a "every USB cards have S/PDIF, except those who are known in USB-Audio.conf" logic. I think it should be "None USB card has S/PDIF except those who are known for it in USB-Audio.conf" because USB devices without S/PDIF are much more common.

Cf https://bugs.launchpad.net/ubuntu/+source/alsa-lib/+bug/1002952

Thank you!

@perexg
Copy link
Member

perexg commented May 2, 2023

At first, it's a bit late to change this configuration scheme now. If we revert the database as you suggest, the hardware with S/PDIF will not work (regression), because there's no collection of this data. I think that the point was to enable all features by default. @tiwai ?

We are moving to UCM anyway, so we can be more careful there.

@sibzou
Copy link
Author

sibzou commented May 19, 2023

there's no collection of this data

So you confirm that we can't know how many S/PDIF inputs and outputs a device have other than by having an internal database that maps his name to this number of inputs/outputs?

We are moving to UCM anyway, so we can be more careful there.

I don't know UCM well, how it helps to be more careful?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants