revert back to single device by default

This commit is contained in:
Alexandre Ratchov 2016-01-10 12:05:17 +01:00
parent cf1ebc72d3
commit f745d41032
2 changed files with 18 additions and 22 deletions

View File

@ -350,22 +350,29 @@ to which they are attached.
.Pp .Pp
If no audio devices If no audio devices
.Pq Fl f .Pq Fl f
are specified, first 4 audio devices are added and are specified,
settings are applied to all of them. settings are applied as if
Similarly, if no MIDI ports the default device is specified.
.Pq Fl q
are specified, first 8 MIDI ports are added and
settings are applied to all of them.
If no sub-devices If no sub-devices
.Pq Fl s .Pq Fl s
are specified for a device, a default sub-device is are specified for a device, a default sub-device is
created attached to it. created attached to it.
If a device or MIDI port If a device
.Pq Fl fq .Pq Fl f
is defined twice, both definitions are merged: is defined twice, both definitions are merged:
parameters of the first one are used but sub-devices parameters of the first one are used but sub-devices
.Pq Fl s .Pq Fl s
of both definitions are created. of both definitions are created.
The default
.Xr sndio 7
device used by
.Nm
is
.Pa rsnd/0 ,
and the default sub-device exposed by
.Nm
is
.Pa snd/0 .
.Pp .Pp
If If
.Nm .Nm

View File

@ -338,8 +338,7 @@ main(int argc, char **argv)
int c, background, unit; int c, background, unit;
int pmin, pmax, rmin, rmax; int pmin, pmax, rmin, rmax;
char base[SOCKPATH_MAX], path[SOCKPATH_MAX]; char base[SOCKPATH_MAX], path[SOCKPATH_MAX];
char loc[32]; unsigned int mode, dup, mmc, vol;
unsigned int mode, dup, mmc, vol, i;
unsigned int hold, autovol, bufsz, round, rate; unsigned int hold, autovol, bufsz, round, rate;
const char *str; const char *str;
struct aparams par; struct aparams par;
@ -466,18 +465,8 @@ main(int argc, char **argv)
fputs(usagestr, stderr); fputs(usagestr, stderr);
return 1; return 1;
} }
if (dev_list == NULL) { if (dev_list == NULL)
for (i = 0; i < 4; i++) { mkdev(DEFAULT_DEV, &par, 0, bufsz, round, rate, hold, autovol);
snprintf(loc, sizeof(loc), "rsnd/%u", i);
mkdev(loc, &par, 0, bufsz, round, rate, hold, autovol);
}
}
if (port_list == NULL) {
for (i = 0; i < 8; i++) {
snprintf(loc, sizeof(loc), "rmidi/%u", i);
mkport(loc, hold);
}
}
for (d = dev_list; d != NULL; d = d->next) { for (d = dev_list; d != NULL; d = d->next) {
if (opt_byname("default", d->num)) if (opt_byname("default", d->num))
continue; continue;