From nobody Thu Apr 23 08:41:20 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 4g1V1f1fClz6ZBVs for ; Thu, 23 Apr 2026 08:41:26 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g1V1d2dqwz3hYT for ; Thu, 23 Apr 2026 08:41:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776933685; 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=SosA4UrvFQHspWBXcEVFLs0EZ0kjX7L4UNQEEWTquNE=; b=xjLUnc6iaouOmywp+3KlarBwv6o9+SgOsulZRN5WOwHEYnDLVR0MlWGT0Uv8KndLTEGOfu K/b5de1C5egSupJQm0Q4csGRy31FX/zAPgdbQDRk7BA8Cu7AzeCQa+cSmgdy/h03L/TKJz RP7e9UETk3VKSVoEdQ2Q3wE22bIHi7o9dyu5VtFYrC/efaNUa+Rjfcc7TRknmIx2V1mZ1S bc75BLEmZgVoFjnRCBF12xzto06NQyZ0btJhc+n8l/sD1TagQlCv2OwBuvsJ9eCMV7pRJM gzftPDjoWaAl5T7KQyiVdOpdqoq16fOV4kpsdXRTK7PAYxtQ6Pz5rC6bWUEvng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776933685; a=rsa-sha256; cv=none; b=mNseGyU3FtxFHX8eIckvM9guGKPvhkyjJoEnGmdXdNxdT/0p/5GQt01AKJX1+4cUxcrnVi eY2nLy5P69TrqDqTvR9ugs0X+0RSQJqBmLYY2gvFV884rz2NnK6c3FnBsi1fopioV3pvsk QbFh+tnuoNxI5rLP3JdgnYMiZxW/h8ORQupjOJr+tk3qL22RVe66mTyRpyfnJMGFJ405J8 FUM6ahVK98JPSWMLPI7jbH2SCz9TW1yS2N0H0A6Xr+pJ6lwr9SuD32TjfMuw/cVTKLc82q q5XlEjSlEtR5An04LfuPLNXdsSAX1h+LSfgfVa13R+U2BGsG4ETjaIB5jft19w== 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=1776933685; 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=SosA4UrvFQHspWBXcEVFLs0EZ0kjX7L4UNQEEWTquNE=; b=c1+dSpUzw0F9xMKLex/ah54yhlhgiatodhol47VzT78yHBGxa7kQPtxt3cN3iDbxPiPEFS +uM7+I7IRFAXvg2L9x7+SKP/Y9atcPbAeWeYUDePP97HMg2tGoHvEuKC1+OyHqt503AO0A WgSQAOHF0pClA+tEQa1XFEKA5gN9DabFlefYfp0PaKG/vDpuonANB1+DdF/cjzTNxryDiP MpNl0urFmM8yxB7pYyuDflf7NfSfrYt2XPXsk56Bfj3uLAVz5sqktUeqCTxZbVt9FgWcE2 YXhxVLakCtxNUKN5UpPcTDwR8styYcL37PD7Ja/IQOhaeaZURBjGTmUH4E3DAQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g1V1d1ycNz180x for ; Thu, 23 Apr 2026 08:41:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 32503 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 23 Apr 2026 08:41:20 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: f89909e462e8 - stable/15 - 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/stable/15 X-Git-Reftype: branch X-Git-Commit: f89909e462e8707d8ac5993959b8899712e282c2 Auto-Submitted: auto-generated Date: Thu, 23 Apr 2026 08:41:20 +0000 Message-Id: <69e9db30.32503.53cf168e@gitrepo.freebsd.org> The branch stable/15 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=f89909e462e8707d8ac5993959b8899712e282c2 commit f89909e462e8707d8ac5993959b8899712e282c2 Author: Christos Margiolis AuthorDate: 2026-04-16 14:51:02 +0000 Commit: Christos Margiolis CommitDate: 2026-04-23 08:41:15 +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 (cherry picked from commit 70e27ecba51892cbe4cc94bbf785c6dd261dfd57) --- 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"; };