Details
- Reviewers
christos
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Does this actually work? snd_uaudio(4) does not seem to implement a kqfilter method. I haven't checked whether the USB stack has a default handler. Also see my comment in D54359.
It does work, this diff and D54359 is what I tested together. I finally have PCIe card with USB slots that I passthru to VM and I hooked up my old USB interface. On the other end of MIDI cable is keyboard, so I tested this patch by playing on that keyboard while watching messages in VM. Did you try it and it didn't work for you? If yes, what's the scenario, and why does it work for me?
Oh, it works on 15.0-RELEASE, so no wonder I wrote this patch so easily: it doesn't do anything ๐
The USB stack seems to have a default kqfilter method,so I suppose this is why it works. Does it work properly though?
Almost perfectly in my testing. Problem is that kevent.data is always 0 and as kqueue is advertised as "after the fact" eventing system, it would be nice to get the event after all 3 bytes are ready. I'm speaking strictly about notes and controllers, but similar is true for any MIDI message: I'd like to receive event once the whole message is ready. In this code you'll notice I read 2 more bytes after initial read. That feels like magic, so it would be nice to get event.data = 3 and read the whole MIDI message at once.