dsp_chn_alloc() stopped at the first primary channel that was either
idle or already had vchans. Since the list is walked in order, the first
channel matched both conditions once it had been used, so every client
after the first was stacked onto it as a vchan and the remaining primary
channels were never allocated at all.
This is invisible on devices with a single primary channel, but not on
those which provide several. snd_emu10kx(4), for instance, registers
four primary channels for its front device, each able to run with its
own rate.
Look for an idle primary channel first, and only fall back to sharing
one that already has vchans when there is none left.
PR: 287687
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks