From f60e99f45e8197de2bc0970c7dd7f87148fdaf30 Mon Sep 17 00:00:00 2001 From: Christos Margiolis Date: Mon, 12 Feb 2024 13:05:47 +0200 Subject: [PATCH] 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 --- sys/dev/sound/usb/uaudio.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index eb4b676d5e7..26d95bf3ee9 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -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)