diff --git a/sbin/devd/snd.conf b/sbin/devd/snd.conf index 3fc1cb9f0b0..ecaec62bc6c 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"; };