Re: sndiod: -F does not switch back to preferred device

2021-12-25 Thread Klemens Nanni
On Sat, Dec 25, 2021 at 04:45:11PM +0100, Alexandre Ratchov wrote: > On Sat, Dec 25, 2021 at 02:51:08PM +, Klemens Nanni wrote: > > > > either "devices that are" or "device that is", I'd say the latter. > > > > commited with "device that is". > > BTW, the example of the -F option descriptio

Re: sndiod: -F does not switch back to preferred device

2021-12-25 Thread Alexandre Ratchov
On Sat, Dec 25, 2021 at 02:51:08PM +, Klemens Nanni wrote: > > either "devices that are" or "device that is", I'd say the latter. > commited with "device that is". BTW, the example of the -F option description seems more appropriate for the new hot plugging section. OK? diff --git a/sndio

Re: sndiod: -F does not switch back to preferred device

2021-12-25 Thread Klemens Nanni
On Sat, Dec 25, 2021 at 03:46:48PM +0100, Alexandre Ratchov wrote: > On Sat, Dec 25, 2021 at 01:34:19PM +, Klemens Nanni wrote: > > > > This reads OK kn, but I suspect others will object to the hotplugd(8) > > reference. > > > > here's a new one, with attach/detach replaced by plug/unplug an

Re: sndiod: -F does not switch back to preferred device

2021-12-25 Thread Alexandre Ratchov
On Sat, Dec 25, 2021 at 01:34:19PM +, Klemens Nanni wrote: > > This reads OK kn, but I suspect others will object to the hotplugd(8) > reference. > here's a new one, with attach/detach replaced by plug/unplug and no ref to hotplug(8) OK? diff --git a/sndiod/sndiod.8 b/sndiod/sndiod.8 index

Re: sndiod: -F does not switch back to preferred device

2021-12-25 Thread Klemens Nanni
On Mon, Dec 20, 2021 at 10:11:25AM +0100, Alexandre Ratchov wrote: > On Fri, Dec 17, 2021 at 07:11:41PM +, Klemens Nanni wrote: > > > > So we've concluded that the hotplpugging framework needs work, fine. > > > > I'd still like to improve sndiod(8) regarding its own behaviour. > > > > How ab

Re: sndiod: -F does not switch back to preferred device

2021-12-20 Thread Alexandre Ratchov
On Fri, Dec 17, 2021 at 07:11:41PM +, Klemens Nanni wrote: > > So we've concluded that the hotplpugging framework needs work, fine. > > I'd still like to improve sndiod(8) regarding its own behaviour. > > How about the same diff modulo hotplug referencing/examples? > This helps me understand

Re: sndiod: -F does not switch back to preferred device

2021-12-17 Thread Klemens Nanni
On Thu, Dec 09, 2021 at 11:29:04PM +, Klemens Nanni wrote: > On Thu, Dec 09, 2021 at 10:21:56AM +0100, Alexandre Ratchov wrote: > > On Wed, Dec 08, 2021 at 10:30:08PM +, Klemens Nanni wrote: > > > Following https://www.openbsd.org/faq/faq13.html#usbaudio and reading > > > sndiod(8)'s > > >

Re: sndiod: -F does not switch back to preferred device

2021-12-10 Thread Theo de Raadt
Alexandre Ratchov wrote: > On Thu, Dec 09, 2021 at 09:02:07PM -0700, Theo de Raadt wrote: > > > > I think drivers, or maybe this can be done in higher-level subsystems, need > > to be modified such that events get sent when a device is *actually ready*, > > and the call from config_attach() shou

Re: sndiod: -F does not switch back to preferred device

2021-12-09 Thread Alexandre Ratchov
On Thu, Dec 09, 2021 at 09:02:07PM -0700, Theo de Raadt wrote: > > I think drivers, or maybe this can be done in higher-level subsystems, need > to be modified such that events get sent when a device is *actually ready*, > and the call from config_attach() should be deleted. > For audio and MIDI

Re: sndiod: -F does not switch back to preferred device

2021-12-09 Thread Theo de Raadt
Theo de Raadt wrote: > I think drivers, or maybe this can be done in higher-level subsystems, need > to be modified such that events get sent when a device is *actually ready*, > and the call from config_attach() should be deleted. Worth mentioning the numbers below are devclass DV_* fields, whi

Re: sndiod: -F does not switch back to preferred device

2021-12-09 Thread Theo de Raadt
As I said back then, I don't see how this solves the problem. If you try to open a /dev/sd2i partition 1msec after the hotplug indicates the arrival of sd2, that open will fail. (There is a small chance it will succeed, but why are we exposing our users to races?) The hotplug event is caused by t

Re: sndiod: -F does not switch back to preferred device

2021-12-09 Thread joshua stein
On Thu, 09 Dec 2021 at 16:46:24 -0700, Theo de Raadt wrote: > Please do not recommend people use hotplugd, for any purpose. > > It is on my queue for deletion, because noone has stepped up and > fixed it. > > hotplug is COMPLETELY FLAWED. It reports when a device is attached, > not when it is rea

Re: sndiod: -F does not switch back to preferred device

2021-12-09 Thread Theo de Raadt
The real thing going on here is that if /dev/hotplug actually worked, then sndiod would be able to use by itself to be smart. But hotplug doesn't work, it is unfit for purpose. So we have discouraged Alexandre from making sndiod look at hotplugd. Now you propose to extranalize this, using the ad

Re: sndiod: -F does not switch back to preferred device

2021-12-09 Thread Theo de Raadt
In addition, such detailed text with examples does not belong in that manual page. What I see there is an example of the "HOWTO" mentality.

Re: sndiod: -F does not switch back to preferred device

2021-12-09 Thread Theo de Raadt
Please do not recommend people use hotplugd, for any purpose. It is on my queue for deletion, because noone has stepped up and fixed it. hotplug is COMPLETELY FLAWED. It reports when a device is attached, not when it is ready. As a result everyone uses it wrong. As a result, your script is bro

Re: sndiod: -F does not switch back to preferred device

2021-12-09 Thread Klemens Nanni
On Thu, Dec 09, 2021 at 10:21:56AM +0100, Alexandre Ratchov wrote: > On Wed, Dec 08, 2021 at 10:30:08PM +, Klemens Nanni wrote: > > Following https://www.openbsd.org/faq/faq13.html#usbaudio and reading > > sndiod(8)'s > > > > -F device > > Specify an alternate device to use. I

Re: sndiod: -F does not switch back to preferred device

2021-12-09 Thread Alexandre Ratchov
On Thu, Dec 09, 2021 at 02:04:06PM +0100, Solene Rapenne wrote: > > where does sndioctl server.device= come from? > > on my system I don't have the server.device property > There's one server.device knob for each "-s" to controls on which device are player (or recorded from). > > sndioctl serv

Re: sndiod: -F does not switch back to preferred device

2021-12-09 Thread Jason McIntyre
On Thu, Dec 09, 2021 at 10:21:56AM +0100, Alexandre Ratchov wrote: > On Wed, Dec 08, 2021 at 10:30:08PM +, Klemens Nanni wrote: > > Following https://www.openbsd.org/faq/faq13.html#usbaudio and reading > > sndiod(8)'s > > > > -F device > > Specify an alternate device to use. I

Re: sndiod: -F does not switch back to preferred device

2021-12-09 Thread Alexandre Ratchov
On Wed, Dec 08, 2021 at 10:30:08PM +, Klemens Nanni wrote: > Following https://www.openbsd.org/faq/faq13.html#usbaudio and reading > sndiod(8)'s > > -F device > Specify an alternate device to use. If it doesn't work, the one > given with the last -f or -F opt

sndiod: -F does not switch back to preferred device

2021-12-08 Thread Klemens Nanni
Following https://www.openbsd.org/faq/faq13.html#usbaudio and reading sndiod(8)'s -F device Specify an alternate device to use. If it doesn't work, the one given with the last -f or -F options will be used. For instance, specifying a USB d