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 hardcodes the control device's name to "vdsp.ctl" when
virtual_oss(8) replaces sound(4)'s /dev/dsp with its own, i.e., when "-d
dsp" is specified. The goal of this hardcoding is that third-party
programs and scripts can access the control device for the
virtual_oss(8)-created /dev/dsp without guessing. This is especially
useful for sbin/devd/snd.conf which deals with hot-swapping sound
devices using virtual_oss(8).
There are a few side effects with this patch:
1. Configurations that specify "-d dsp" cannot use the -t option at all,
because the control device is hardcoded to "vdsp.ctl" and cannot be
overwritten.
2. "-t vdsp.ctl" can be manually specified only when the virtual_oss(8)
sound device is not /dev/dsp. This, as is logical, cannot be done at
the same time another virtual_oss(8) instance which specifies "-d
dsp" is running, because either the first instance will reserve the
name, or the instance which specified "-d dsp" will not the other
instance use that device name.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week