From nobody Tue Jan 30 11:08:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPMpw6BR1z58dMq; Tue, 30 Jan 2024 11:08:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TPMpw4zPsz4HPH; Tue, 30 Jan 2024 11:08:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706612904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R7jS4eHby9roV1cAgWR51H1o5Va3vcdQR/pqGGquQ7k=; b=Ld5boljIX73+b+O5k5s35n2VyJ8xmg9PHstyOVMQJI9im+M5ZCVLqC00LyXKEd5EtrXFnc Ot3gyAfApR7FuFmw8lPK/gIiiZrroo1IZ3mV/kNvxpW+d2O00+naugCZzCj7fOEUGSPsqG idPP7s4fdP7oUuX1rqwMFktgMBEF+PUe5Z57pCPmda6qwznI3//RPxbux1OENMyHM9PgcC DfHC27CeaVrw2HA8wLEXo04TtI65Yylu4m2NqrQ7Hg8/RfdUievWLv7o4gdBSlNiCZRR51 cVcFewjUbPr8Ijrbf1yAvu3U0rw1ZC6V3DopQBKVJ2lgD41TahXdIQZoakpNMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706612904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R7jS4eHby9roV1cAgWR51H1o5Va3vcdQR/pqGGquQ7k=; b=xKlYTnbRJ/krUqUEtXqQNg7PB0vIf3bc8Hg1TqO2gbreeEYiBf+1AfnhE2QpyKNSGua+YW cq3cgyEHya1wMi9QMn3jJzCmCwrhttX68Z7L5FMRIzba/Z1szoPKQEyA8CwVRKbYWFf7j1 GrmbvrMt58UGS5UPY9yj1EHgkbI/czARwM0LiNtyW8nTwZtQ6k64nLJtKvGYPIie1ucyLR zP9pZM9nuseSlIcC7lj/um2jO4OcegRjWgxj+b5l/qsKLZVfUh6Zke0xxoyAgIVNhY6Yog FeX3AzF8SjAYkxalRunlsGU+odEqEusRQRDuN1DjJt0FeWSbV1uopGlovKpbXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706612904; a=rsa-sha256; cv=none; b=a6s+Wwn6KD5/Mzk08RNWp73vVhPOkMkigzbUCefAtVU0qxXNZByjn4AKoyvUAfVTOEAaGh OQomomxWKLgN3eqeYr0gfbbPfDIkJK7B69iFgg8PjBc3V5rS6zQUd/RTCCdagEeAjbMQsP JvNsIYvO1gakHZNvAGJ+c6CxJhn4a/QII868dNf92F7PkaebX4zZ/6wsXDplt4irUmwb+l UWd3FeTZlBzxWIFxNDVIBHo1ZZWBFECVIAcZJE0Ddxc6hSbZ2ErFFbjzql+fob+yh1IffG Tp8uP8As25w+JUY5C+zUC6SyAfLYy7ajz083lFw2CQqWlOB7DYtdOmPBJbTuyg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TPMpw1yLlzYpg; Tue, 30 Jan 2024 11:08:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40UB8Oi5075838; Tue, 30 Jan 2024 11:08:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UB8O6j075835; Tue, 30 Jan 2024 11:08:24 GMT (envelope-from git) Date: Tue, 30 Jan 2024 11:08:24 GMT Message-Id: <202401301108.40UB8O6j075835@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 626d9b855302 - stable/14 - snd_uaudio: provide information about the device name and attached driver List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 626d9b855302ac97809bb429cfe5ae0e4c99c1ac Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=626d9b855302ac97809bb429cfe5ae0e4c99c1ac commit 626d9b855302ac97809bb429cfe5ae0e4c99c1ac Author: Christos Margiolis AuthorDate: 2024-01-16 16:46:49 +0000 Commit: Christos Margiolis CommitDate: 2024-01-30 11:07:28 +0000 snd_uaudio: provide information about the device name and attached driver Unlike the other sound drivers, snd_uaudio(4) doesn't provide information about the device's description and the driver it's attached to. A side-effect of this is that applications such as mixer(8), that fetch these strings through the OSS API's SNDCTL_CARDINFO ioctl will show a USB audio device as: pcm0:mixer: at ? kld snd_uaudio This patch replaces the generic "USB Audio" description with the device's actual manufacturer and product strings, and the "at ?" string with the driver it's attached to: pcm0:mixer: at uaudio0 kld snd_uaudio Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D43347 (cherry picked from commit 18d87fe4fe3b310796e138855016678453140423) --- sys/dev/sound/usb/uaudio.c | 11 +++++++++-- sys/dev/sound/usb/uaudio_pcm.c | 1 - 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index a14cdf805353..3237093bcbfa 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -1171,7 +1171,7 @@ uaudio_attach_sub(device_t dev, kobj_class_t mixer_class, kobj_class_t chan_clas { struct uaudio_softc *sc = device_get_softc(device_get_parent(dev)); unsigned i = uaudio_get_child_index_by_dev(sc, dev); - char status[SND_STATUSLEN]; + char status[SND_STATUSLEN], desc[128]; uaudio_mixer_init(sc, i); @@ -1199,7 +1199,14 @@ uaudio_attach_sub(device_t dev, kobj_class_t mixer_class, kobj_class_t chan_clas mixer_hwvol_init(dev); - snprintf(status, sizeof(status), "at ? %s", PCM_KLDSTRING(snd_uaudio)); + snprintf(desc, sizeof(desc), "%s %s", + usb_get_manufacturer(sc->sc_udev), + usb_get_product(sc->sc_udev)); + device_set_desc_copy(dev, desc); + + snprintf(status, sizeof(status), "at %s %s", + device_get_nameunit(device_get_parent(dev)), + PCM_KLDSTRING(snd_uaudio)); if (pcm_register(dev, sc, (sc->sc_play_chan[i].num_alt > 0) ? 1 : 0, diff --git a/sys/dev/sound/usb/uaudio_pcm.c b/sys/dev/sound/usb/uaudio_pcm.c index 3236e1bd2e5c..bf1f2ebb5e33 100644 --- a/sys/dev/sound/usb/uaudio_pcm.c +++ b/sys/dev/sound/usb/uaudio_pcm.c @@ -201,7 +201,6 @@ ua_probe(device_t dev) (func->func != SCF_PCM)) { return (ENXIO); } - device_set_desc(dev, "USB audio"); return (BUS_PROBE_DEFAULT); }