From fbe74c8cadf600e8330347cf6707998cefb56496 Mon Sep 17 00:00:00 2001 From: hselasky Date: Wed, 19 Aug 2020 08:05:37 +0000 Subject: [PATCH] Print current buffer latency in dmesg for the USB audio driver and not just the maximum. MFC after: 1 week Sponsored by: Mellanox Technologies --- 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 54abd63d9ecb..b149de3a93a3 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -1031,10 +1031,11 @@ 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, " - "2x8ms buffer.\n", i, + "2x%dms buffer.\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); + sc->sc_play_chan[i].usb_alt[x].p_fmt->description, + uaudio_buffer_ms); } } if (i == 0) @@ -1060,10 +1061,11 @@ 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, " - "2x8ms buffer.\n", i, + "2x%dms buffer.\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); + sc->sc_rec_chan[i].usb_alt[x].p_fmt->description, + uaudio_buffer_ms); } } if (i == 0)