Index | Thread | Search

From:
izzy Meyer <izder456@disroot.org>
Subject:
Re: sndiod: control of midithru ports with sndioctl.
To:
Alexandre Ratchov <alex@caoua.org>
Cc:
tech@openbsd.org
Date:
Wed, 17 Jun 2026 13:49:51 -0500

Download raw body.

Thread
On Thu, 11 Jun 2026 09:39:22 +0200
Alexandre Ratchov <alex@caoua.org> wrote:

> This diff allows sndioctl to control midithru/N ports.
> 
> For now there's a single "server.port" control that specifies which
> hardware MIDI ports programs see. It's the equivalent of what's the
> "server.device" control is for audio. This can be used to expose
> multiple hardware ports as a single "midithru/N" port, ex., allowing a
> program to see all the hardware without using hairy midicat(1)-based
> plumbing that needs to be restarted whenever a new device is
> plugged. Ex.:
> 
> 	sndioctl -f midithru/0 server.port=0,2,3
> 
> With a simple hotplugd(8) one-liner, MIDI devices show in programs as
> soon as they are connected. Ex.:
> 
>         case $DEVNAME in
>         midi[0-9])
>                 sndioctl -f midithru/0 server.port=+${DEVNAME#midi}
>                 ;;
>         esac
> 
> The diff also simplifies sndiod internals, as it makes MIDI and audio
> handling very similar: less logic, less code, less bugs.
> 
> OK?

(snip)

I can confirm this works very well on my machine running -current. I
have a usb midi keyboard from DONNER that I plug and unplug frequently
when producing music on LMMS. So, having this interface exposed to
sndioctl is very helpful. No problems insofar for me.

-- 
iz (she/her)

> I say mundane things
> so the uninteresting
> just might get noticed.

izder456 (dot) neocities (dot) org