On Fri, May 01, 2020 at 05:16:10PM +0200, Damien Couderc wrote:
> 
> So if I'm not wrong it could be possible to set the -f option with the
> analog device and the -F option with the digital-only one.
> 
> That said, it would work only if you have two audio device (e.g. HDMI from
> video card as audio0 and analog from soundcard as audio1).
> 
> This is not true on Thinkpad laptops for example because they have two
> output codecs on the same device for both analog and digital (and only one
> is kept actually).
> 
> Maybe we could make first analog and first digital codec available on each
> audio device. Then sndiod would take the first analog and the first digital
> from the devices in the given order. Does it sound sane?

-F is just a tool to *ease* switching between devices, but doesn't
solve the "default device problem" completely. It's intended to be
used as follows:

        -f rsnd/0 -F rsnd/1 -F rsnd/2 ...

which might become the default. This way if there's only one
sound-card, it's used. If the user connects a new device, the new one
is used until it's disconnected. That works by pure luck because
attach order maches device priority.

To apply this model to hdmi, there must be a mean to detect if it's
connected to speakers and make it fail if it is not, so it can be
skipped. If we can't detect whether it's connected, we must be sure it
won't be used instead of the others. But even if hdmi has properly
detected speakers, the user may want to use the analog one because it
is more capable, for instance for telephony.

AFAICS, this general problem can't be solved by just adding the hdmi
device with the proper minor number, changes will be needed in many
places of the audio sub-system.

In the short term if you make sure the digital codec and the hdmi-only
device properly work, never attache as audio0 and speakers are
detected, the current defaults will work and nobody will
complain. This would be a big step forward.

my 2 cents

Reply via email to