From nobody Tue Jan 16 16:50:04 2024 X-Original-To: dev-commits-src-main@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 4TDw3c4tDMz57bd1; Tue, 16 Jan 2024 16:50:04 +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 4TDw3c4N42z4c4q; Tue, 16 Jan 2024 16:50:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705423804; 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=v9qQew4TcrsCUFp8u/o0QVmwJNdsS1HHnN/5+f03dEI=; b=DuYAI80xoQA8zNQ+Ge5tkNyKKgYADuCgnatPsA5XRjMXstu2Y7CM5g2ow1nf0GJ6/KhuD5 GXJ6faSRvf9Mqz4P3cJ1JzAJSn/lBGLC3hvRHBd5WRxkSvuCbOqyEgzHMn23rPMI6YuqSP 4rdfpzBynNAl/39kzlrPPbGgzsJxwCozXt5AbXxT3fPWdf9Wd14UZa6IQQ1TBVCHtyLeJW 3/a7ibqKgb2jidelm/TzNF1NEuac5GjUZmILmVFDhFA6+vlc8XON+JFjyNDzNFLUzj+yAw J+M4oNmP99QCWLnuO54ZJTfLbu2nRrpxVDSROfOxIlyrmmmuFfDUVVUpgO+5Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705423804; 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=v9qQew4TcrsCUFp8u/o0QVmwJNdsS1HHnN/5+f03dEI=; b=QuIzj9pPIDCeqMqlnfcYAGmaOpHwS555ut+gTQQFFefQP7JCVHRx9D9gBrMxn2/zXeCqut f6wcj58v8jhwOuQTNjc45Yi6agalJsHtBaZ8g02wmp0vKkUyyA6qw+vhYQKeQCRmNnkWXV WfGLlL3VqpzlKAZqeIEBfUOfux+ji+6JwjuEzSilY5NFPjCJATvwlfO0b/j2FgxtM/wLCe GPhocO34AFS+5lMgUhXWOKnCGKqKFJ/0BnIMajYHLeUHlsXwJwxvhfUhSTDNgaZgDe1YeL xruWqbks9MyPjMwRqmaaAJpW6y+awtvm+4QOTgQIYcYkAAJlkyr/ai6BZ6UqgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705423804; a=rsa-sha256; cv=none; b=JivQY1G8GjcPC4juztdpANtRsICFo+TymUHWYzgEo3iWGIgtMBh+snSCgaOS1EqAODmOdb E5PRfhhVmj2UYyRzcvk/PBn98djzNG7C/uxrSmBNs82ofSbY+JPZbMY3wmoyHHK6oKQLHZ CPxRABTzHhcVIM2EJAk/Khgd1LvUlPLzG41mIpEcWrPmZD4cEFqbi6BN76s0tBtk66dKKv ckNy1lKDitwyMns1J7rzCoOV+aCM62W1ocYt7gaEO4bawHUWgvJUG2fTyDuT3Abq1jicRZ cgVivZhZpHbfN4JqahSe3tmGnX36TOL9xt7K6G11myPwB2dQ9tPp18LToHvDRw== 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 4TDw3c3S3CznQ7; Tue, 16 Jan 2024 16:50:04 +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 40GGo4CM073736; Tue, 16 Jan 2024 16:50:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GGo4o5073731; Tue, 16 Jan 2024 16:50:04 GMT (envelope-from git) Date: Tue, 16 Jan 2024 16:50:04 GMT Message-Id: <202401161650.40GGo4o5073731@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 18d87fe4fe3b - main - snd_uaudio: provide information about the device name and attached driver List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 18d87fe4fe3b310796e138855016678453140423 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=18d87fe4fe3b310796e138855016678453140423 commit 18d87fe4fe3b310796e138855016678453140423 Author: Christos Margiolis AuthorDate: 2024-01-16 16:46:49 +0000 Commit: Christos Margiolis CommitDate: 2024-01-16 16:46:49 +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 --- 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); }