diff options
| author | Christos Margiolis <christos@FreeBSD.org> | 2026-06-09 15:10:58 +0000 |
|---|---|---|
| committer | Christos Margiolis <christos@FreeBSD.org> | 2026-06-09 15:10:58 +0000 |
| commit | 439b219fed3eea8ad3e1204393a8605826b8bbca (patch) | |
| tree | 87000cfcc7de1de9bb1afe033b2ba20205cd5cd9 | |
| parent | 8011f6b0d8ba2ee18a60f3bd719f950081a474b3 (diff) | |
devd/snd.conf: Handle absent control device properly
If virtual_oss is not enabled when these rules run on startup, dmesg
will show the following messages:
Starting devd.
virtual_oss_cmd: Could not open control device: /dev/vdsp.ctl: No such file or directory
virtual_oss_cmd: Could not open control device: /dev/vdsp.ctl: No such file or directory
Reported by: olce, Mark Millard <marklmi@yahoo.com>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
| -rw-r--r-- | sbin/devd/snd.conf | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sbin/devd/snd.conf b/sbin/devd/snd.conf index 3fc1cb9f0b0e..ecaec62bc6cc 100644 --- a/sbin/devd/snd.conf +++ b/sbin/devd/snd.conf @@ -7,8 +7,9 @@ notify 0 { # Other audio servers or device switching commands can be used here # instead of virtual_oss(8). - action "/usr/sbin/virtual_oss_cmd \ - /dev/$(sysrc -n virtual_oss_default_control_device) -R /dev/$cdev"; + action "\ + vd=/dev/$(sysrc -n virtual_oss_default_control_device); \ + test -e ${vd} && /usr/sbin/virtual_oss_cmd ${vd} -R /dev/$cdev"; }; notify 0 { @@ -18,8 +19,9 @@ notify 0 { match "cdev" "dsp[0-9]+"; # See comment above. - action "/usr/sbin/virtual_oss_cmd \ - /dev/$(sysrc -n virtual_oss_default_control_device) -P /dev/$cdev"; + action "\ + vd=/dev/$(sysrc -n virtual_oss_default_control_device); \ + test -e ${vd} && /usr/sbin/virtual_oss_cmd ${vd} -P /dev/$cdev"; }; notify 0 { @@ -29,6 +31,7 @@ notify 0 { # No connected devices. Disable both recording and playback to avoid # repeated virtual_oss error messages. - action "/usr/sbin/virtual_oss_cmd \ - /dev/$(sysrc -n virtual_oss_default_control_device) -f /dev/null"; + action "\ + vd=/dev/$(sysrc -n virtual_oss_default_control_device); \ + test -e ${vd} && /usr/sbin/virtual_oss_cmd ${vd} -f /dev/null"; }; |
