snd_uaudio: mark selected configurations

snd_uaudio(4) selects the first maching rate/channel/bit/format/buffer
configuration for use during attach, even though it will print the rest
of the supported configurations detected. To make this clear, mark the
selected playback and recording configurations with a "selected" string.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D43766
This commit is contained in:
Christos Margiolis 2024-02-12 13:05:47 +02:00
parent 883b8ed582
commit f60e99f45e

View file

@ -1051,11 +1051,12 @@ uaudio_attach(device_t dev)
for (x = 0; x != sc->sc_play_chan[i].num_alt; x++) {
device_printf(dev, "Play[%u]: %d Hz, %d ch, %s format, "
"2x%dms buffer.\n", i,
"2x%dms buffer.%s\n", i,
sc->sc_play_chan[i].usb_alt[x].sample_rate,
sc->sc_play_chan[i].usb_alt[x].channels,
sc->sc_play_chan[i].usb_alt[x].p_fmt->description,
uaudio_buffer_ms);
uaudio_buffer_ms,
(x == 0) ? " (selected)" : "");
}
}
if (i == 0)
@ -1081,11 +1082,12 @@ uaudio_attach(device_t dev)
for (x = 0; x != sc->sc_rec_chan[i].num_alt; x++) {
device_printf(dev, "Record[%u]: %d Hz, %d ch, %s format, "
"2x%dms buffer.\n", i,
"2x%dms buffer.%s\n", i,
sc->sc_rec_chan[i].usb_alt[x].sample_rate,
sc->sc_rec_chan[i].usb_alt[x].channels,
sc->sc_rec_chan[i].usb_alt[x].p_fmt->description,
uaudio_buffer_ms);
uaudio_buffer_ms,
(x == 0) ? " (selected)" : "");
}
}
if (i == 0)