Files
Christos Margiolis 439b219fed 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 <[email protected]>
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-06-09 17:10:58 +02:00

38 lines
993 B
Plaintext

# Audio redirection
notify 0 {
match "system" "SND";
match "subsystem" "CONN";
match "type" "IN";
match "cdev" "dsp[0-9]+";
# Other audio servers or device switching commands can be used here
# instead of virtual_oss(8).
action "\
vd=/dev/$(sysrc -n virtual_oss_default_control_device); \
test -e ${vd} && /usr/sbin/virtual_oss_cmd ${vd} -R /dev/$cdev";
};
notify 0 {
match "system" "SND";
match "subsystem" "CONN";
match "type" "OUT";
match "cdev" "dsp[0-9]+";
# See comment above.
action "\
vd=/dev/$(sysrc -n virtual_oss_default_control_device); \
test -e ${vd} && /usr/sbin/virtual_oss_cmd ${vd} -P /dev/$cdev";
};
notify 0 {
match "system" "SND";
match "subsystem" "CONN";
match "type" "NODEV";
# No connected devices. Disable both recording and playback to avoid
# repeated virtual_oss error messages.
action "\
vd=/dev/$(sysrc -n virtual_oss_default_control_device); \
test -e ${vd} && /usr/sbin/virtual_oss_cmd ${vd} -f /dev/null";
};