Closed perexg closed 3 years ago
@perexg No, please don't!
This: 1) Is more complicated, 2) gives worse performance, 3) is a potential SIGBUS on platforms where unaligned access is not allowed
Remember that reading rawmidi might be done from extremely latency sensitive threads; and we don't give any real time guarantees in alsa-lib. So even if there is not much performance overhead right now, we don't guarantee that it won't be later on.
I know that alsa-lib hides the fields of other structs, and most of the time, I've found that to be unnecessary complicated there as well. Making bad decisions in the past should not be an argument to make the same bad decision again just to be consistent with previous bad decisions. Ok?
And 4) it's not compatible with other frame types we might add in the future
The new redesigned API is available in https://github.com/alsa-project/alsa-lib/pull/179 . Closing this.
The frame structure should be hidden. Remove it and add snd_rawmidi_decode_frame0() which returns the timestamp and the midi chunk pointer to the application.
BugLink: https://github.com/alsa-project/alsa-lib/issues/172