manjaro – Why does running “amidi -l” produce an error message that says “Inappropriate ioctl for device”?

When I run amidi -l on my Thinkpad X1 Carbon (Generation 5) running Manjaro Linux, instead of no device info appearing in the output (which I’d expect since no MIDI hardware devices are connected) I instead get this error message:

> amidi -l
Dir Device    Name
cannot determine device number: Inappropriate ioctl for device

Running the same command with strace provides more detail for the call to ioctl producing the error:

> strace amidi -l
...
ioctl(3, SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE, 0x7fff73f39dd8) = -1 ENOTTY (Inappropriate ioctl for device)
write(2, "cannot determine device number: "..., 62cannot determine device number: Inappropriate ioctl for device) = 62
...

What does this error message mean and why is it happening?

Read more here: Source link