[LAD] alsa seq client ids??

Chris Cannam cannam at all-day-breakfast.com
Wed Sep 12 14:20:28 UTC 2007


On Wednesday 12 September 2007 14:00, IOhannes M zmoelnig wrote:
> however i have found no way to find out, which clients are real midi
> devices and which are not.

I've wondered this many times before, and have come to the conclusion that 
there is no way that's any better than a "rule of thumb".  I'd like to know 
if anyone out there thinks otherwise.

Prior to ALSA driver version 1.0.11rc1, system clients were numbered 0 to 63, 
hardware clients 64 to 127 and software clients 128 onwards.  ALSA 1.0.11rc1 
changed this (for a good reason, but apparently without documenting it) so 
that system clients were 0 to 15, hardware clients 16 to 127 and software 
clients 128 onwards.

This was particularly problematic at the time, because it is the ALSA driver 
that generates the client numbers, and there is nothing enforcing the rule 
that the ALSA driver and library should be the same version.  A user 
application therefore couldn't rely on the alsalib version number when trying 
to decide whether a client numbered 16 to 63 was system or hardware.  (It's 
always recommended that the ALSA driver and library version numbers match up, 
but I don't think that a third-party application can necessarily assume that 
this will be the case on every system.)

I assume it must be intended that ALSA applications treat these numbers as 
meaningless opaque identifiers; otherwise they wouldn't have been changed so 
lightly.  But I don't see any alternative if you want to do autoconnection 
(even under user control).  Many people here will argue that autoconnection 
is a bad idea in itself.  I am not interested in having that argument again, 
except perhaps in the pub with a few pints stacked up and ready.

Also, note that you can't rely on the SND_SEQ_PORT_TYPE flags to tell you 
anything useful either.


Chris



More information about the Linux-audio-dev mailing list