From nobody Thu Apr 16 14:51:16 2026 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 4fxLYk4XM2z6ZnC6 for ; Thu, 16 Apr 2026 14:51:22 +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 4fxLYj5Sh7z4GRH for ; Thu, 16 Apr 2026 14:51:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776351081; 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=WXKWSuVRMtjVJmcr9HO2XSS8uJsHQ31g30XQxbQoPUK4atz04XJU9yO3YEcLvWToYX694H c/R/CoGWDTO717iJu/eceRbKkT/WMiClbIBSZDHYY/bzGi91zTZ8aft3y9JmcK+rJgPGrq ZtukxRdUgUVIsh6LRRGjMIbIy54o5LAVDL3TehLYdRwgXzjkcjCLf6fQsmg8J1T2HPEI5/ qoder+J63trvrTVSpYRMJs1vOrp/x/TBPaMtAeuE+34JzR69fGz2gMY0GL5kOu2IRYB2j9 iMS8Oyp147qlGBJHZxkN63vkIZq89m+pfuQniKsEELLlmeEBS74UFH6pcf/EPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776351081; a=rsa-sha256; cv=none; b=n5UZmxYuLFYMc4Y8zcdH7VUdFk2+CqMEsSquQGKhTJxOkEo2W+0Rdtm573AtLCsO3i27sZ +EznuuIqBrkDqL8mWjt+3RwMV4uEmBMr48na0I5yZIYZAxKFsWxq5oi1453oW5yo/mE88I kZ+Oif9srkX9YxTP3h7wk9BQhq+tBMZXJXf45mRDDSGRp4dOdAnUFkMsLAqU8tanro3dM/ txNKwwEy0nnEIGbNYMJXvYhkpA3I339HKilDLkdeyQ5IbdZuKrb4MOeUx8BfJuGySoqBzL 2ekMAfncecHhOHG2gP979C/mRtNoUYsa8PJJJO69L1ohzUYyXTrtuvqxVhENwQ== 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=1776351081; 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=FSDUmwVUJzC3Kd2vnPz/rxLapRVQ9YsAPqkIQklSn7BoOgr5OhTGrokI5ZQX1t7lGeGBL/ eRjWK2YVO0nJo+/oZy5eXkRAfFtN6hSmrLfe4CUdGwQibbMW5MeZgW/X4NvC/QYrGq7IQB JFS9mkok7x36+W8fyZec19j+ayL5zOdurQGsC6IpqHbYxuQFnfdMnI8ancDaCYWsUga5Xv n9qo07LH/z0JHqIjBFXJaiB86ea/E8C70fbpDA4H2fU6Z+u2OlTKz7kknkA7bxTKtzYQ1R Xm7bSPRemURMT/dlLgUWbif2SJBtXHEeWzqVcCAYScfP5XLmbbbEA+R6MOz7yg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxLYj51D6z1BXp for ; Thu, 16 Apr 2026 14:51:21 +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 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/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"; };