If sndiod is using another sndiod instance instead of the bare
hardware, then it must disable the underlying server.device
control to avoid conflicts with its own server.device control.
-/* $OpenBSD: dev.c,v 1.113 2024/05/06 05:37:26 ratchov Exp $ */
+/* $OpenBSD: dev.c,v 1.114 2024/05/24 15:01:53 ratchov Exp $ */
/*
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
*
return 1;
switch (c->scope) {
case CTL_HW:
+ /*
+ * Disable hardware's server.device control as its
+ * replaced by sndiod's one
+ */
+ if (strcmp(c->node0.name, "server") == 0 &&
+ strcmp(c->func, "device") == 0)
+ return 0;
+ /* FALLTHROUHG */
case CTL_DEV_MASTER:
return (s->opt->dev == c->u.any.arg0);
case CTL_OPT_DEV: