From nobody Thu Apr 16 14:51:16 2026 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 4fxLYc5pn3z6Zn8q for ; Thu, 16 Apr 2026 14:51:16 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxLYc4ymhz4GFk for ; Thu, 16 Apr 2026 14:51:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776351076; 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=GpDrWUEcpVpRzVyzqT95X4COE4+R7y20/y8nqTv4Kq0=; b=FWI+IR+mSeweDqP6ebJpsbPxNgF97KI3tyIXsf6yOzvR/cnKqMVo5PGlB4/et5F9a+sAet J3FV7q0qe7+MqAA/Ak0oNx6KNkuQnXvk5KvQnJc5dcDuHL1H3kQj3DxKvAOhYpxnLxVnpR RIzlK+CqPZXD34hK2tvy2Y7MJp4e2vONX7k50HY2uXrhrpfqdI708l/X5MWiIC9Udk1xMB JNSgJ0uVyeEfHxwK6uj8PPgMvAjRJMMukwXwRjpAthMKA+lwJzHPzb0uThBxhm7vYHm09W 7osVP2nwubAllYSQX6QZFp5PlwQqS4P5C9ctph6zk7fKewiqnzHu3jMA6cQN1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776351076; a=rsa-sha256; cv=none; b=s/q/Hl6ME57CAGeg3j5aW/ye62AGL9v9cmsQ7q51AvxXuKmN9KrQwWrjBmLpig2hlpqGMO F1IcnXFIlruvd1fNcPCnSXWVNHm/PUfZfdZt77usuOexkZDT0elTe05oSPZNAz7ybTCwEu drUKuh4ZfU6fgqideG4MPnrUfnfvoFZmSnLjqGVg5BqtJiwEgrki+4bFngLVut+W3wFZ1n vbiOz9olThHz+16dypmG6HoRU5THWSxdBfs6qwWrifn2QJD2kd03/VrV3tXEXBrs5osdvU 8A667e5CH9wd/GkD0k/KBGSg1DlR4q++TCetqVpqq5yAw9IsJ4R/VxCorTU3sA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776351076; 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=GpDrWUEcpVpRzVyzqT95X4COE4+R7y20/y8nqTv4Kq0=; b=cz305snytzh9M6BCtuxPvx4Dum66AYtYTvPjydeBBW20g784ExhQeAtJ7POVrgUOSRcY4T moMAi7rNulUAuX8XJl+plfMvvVvAeoGPRu7CBd6VxyQ8Uv0HPrwb7jatDlpIJap/ObErjh etLIL87tn475FdW+pK4MuFgLaxx0utIQY9uHEYWDlCWkAgsNlQzriayjp0yCWWb2iEj4/Q XlJQ+1X27xBay7BU3uf4pQsLJg5+PyNOU9HMjZ4salZsKcbFFwXCCVqEezdRc4+xm7clx+ DnwMR2FRHfFrn2EFLjZDL1j1UfLfL5v/WK4Brt5ai04AJBhww9fcSiS3PYmsBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxLYc4WdYz1BVR for ; Thu, 16 Apr 2026 14:51:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1ca84 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 14:51:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 70e27ecba518 - main - virtual_oss: Introduce virtual_oss_default_control_device rc variable 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 70e27ecba51892cbe4cc94bbf785c6dd261dfd57 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 14:51:16 +0000 Message-Id: <69e0f764.1ca84.2b51b9f1@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=70e27ecba51892cbe4cc94bbf785c6dd261dfd57 commit 70e27ecba51892cbe4cc94bbf785c6dd261dfd57 Author: Christos Margiolis AuthorDate: 2026-04-16 14:51:02 +0000 Commit: Christos Margiolis CommitDate: 2026-04-16 14:51:02 +0000 virtual_oss: Introduce virtual_oss_default_control_device rc variable The -t option gives the user the ability to create a control device for a given virtual_oss(8) instance, so that the instance's configuration can be manipulated during runtime with virtual_oss_cmd(8). As is expected, the control device's name is not known, since it is specified by the user. This patch introduces a virtual_oss_default_control_device rc variable, which defaults to "vdsp.ctl". The goal of this is that third-party programs and scripts can access the control device of the default virtual_oss(8) configuration without guessing. This is especially useful for sbin/devd/snd.conf which deals with hot-swapping sound devices using virtual_oss(8). Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D55670 --- libexec/rc/rc.d/virtual_oss | 6 +++++- sbin/devd/snd.conf | 14 ++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/libexec/rc/rc.d/virtual_oss b/libexec/rc/rc.d/virtual_oss index d55b51463442..a25abf256f55 100644 --- a/libexec/rc/rc.d/virtual_oss +++ b/libexec/rc/rc.d/virtual_oss @@ -25,6 +25,10 @@ required_modules="cuse" configs= pidpath="/var/run/${name}" default_unit=$(sysctl -n hw.snd.default_unit 2> /dev/null) + +# Default configuration's control device. +: "${virtual_oss_default_control_device:="vdsp.ctl"}" + virtual_oss_default_args="\ -S \ -C 2 \ @@ -35,7 +39,7 @@ virtual_oss_default_args="\ -i 8 \ -f /dev/dsp${default_unit} \ -d dsp \ - -t vdsp.ctl" + -t ${virtual_oss_default_control_device}" # Set to NO by default. Set it to "YES" to enable virtual_oss. : "${virtual_oss_enable:="NO"}" diff --git a/sbin/devd/snd.conf b/sbin/devd/snd.conf index 5ca0be86e246..e2dc6d94a299 100644 --- a/sbin/devd/snd.conf +++ b/sbin/devd/snd.conf @@ -7,12 +7,8 @@ notify 0 { # Other audio servers or device switching commands can be used here # instead of virtual_oss(8). - # - # FIXME: We are hardcoding /dev/vdsp.ctl here, simply because it is a - # common virtual_oss control device name. Until we find a proper way to - # define control devices here, /dev/vdsp.ctl can be changed to the - # control device of choice. - action "/usr/sbin/virtual_oss_cmd /dev/vdsp.ctl -R /dev/$cdev"; + action "/usr/sbin/virtual_oss_cmd \ + /dev/$(sysrc virtual_oss_default_control_device) -R /dev/$cdev"; }; notify 0 { @@ -22,7 +18,8 @@ notify 0 { match "cdev" "dsp[0-9]+"; # See comment above. - action "/usr/sbin/virtual_oss_cmd /dev/vdsp.ctl -P /dev/$cdev"; + action "/usr/sbin/virtual_oss_cmd \ + /dev/$(sysrc virtual_oss_default_control_device) -P /dev/$cdev"; }; notify 0 { @@ -32,5 +29,6 @@ notify 0 { # No connected devices. Disable both recording and playback to avoid # repeated virtual_oss error messages. - action "/usr/sbin/virtual_oss_cmd /dev/vdsp.ctl -f /dev/null"; + action "/usr/sbin/virtual_oss_cmd \ + /dev/$(sysrc virtual_oss_default_control_device) -f /dev/null"; };