Page MenuHomeFreeBSD

sound examples: Add MIDI kqueue example
Needs ReviewPublic

Authored by meka_tilda.center on Thu, Dec 25, 12:45 AM.
Tags
None
Referenced Files
F141839947: D54360.id168581.diff
Sun, Jan 11, 5:44 AM
Unknown Object (File)
Wed, Jan 7, 5:35 PM
Unknown Object (File)
Tue, Jan 6, 2:27 PM
Unknown Object (File)
Sun, Jan 4, 9:46 PM
Unknown Object (File)
Sat, Jan 3, 3:12 PM
Unknown Object (File)
Fri, Jan 2, 11:04 PM
Unknown Object (File)
Tue, Dec 30, 2:44 PM
Unknown Object (File)
Thu, Dec 25, 9:56 AM
Subscribers

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.

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?

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?

I did not try it yet, but there is no way that the code in D54359 is related to this working, because it does not run with USB MIDI. Does it work without D54359?

I did not try it yet, but there is no way that the code in D54359 is related to this working, because it does not run with USB MIDI. Does it work without D54359?

Oh, it works on 15.0-RELEASE, so no wonder I wrote this patch so easily: it doesn't do anything ๐Ÿ˜„

I did not try it yet, but there is no way that the code in D54359 is related to this working, because it does not run with USB MIDI. Does it work without D54359?

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?

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.