I think ALSA would be better if it had actual documentation for more than like 10% of it.
-
I think ALSA would be better if it had actual documentation for more than like 10% of it.
-
I think ALSA would be better if it had actual documentation for more than like 10% of it.
today I learned that if you use snd_seq_create_simple_port to create a MIDI input port, it will just use the direct queue by default, which means there's no buffering of input events. If you don't process them continuously they just drop, which results in fun things like stuck notes.
-
today I learned that if you use snd_seq_create_simple_port to create a MIDI input port, it will just use the direct queue by default, which means there's no buffering of input events. If you don't process them continuously they just drop, which results in fun things like stuck notes.
that's one cursed ALSA MIDI mystery down. the remaining one is "why does the midi sequencer speed sometimes speedup significantly"
-
that's one cursed ALSA MIDI mystery down. the remaining one is "why does the midi sequencer speed sometimes speedup significantly"
@aeva super worried about when I have to actually work with this thing
-
@aeva super worried about when I have to actually work with this thing
@mcc so, I'm not totally sure this isn't just my imagination, but I think switching my laptop's power mode from "balanced" to "performance" while running on battery causes the problem to get worse, which is how I arrived that at my current theory which is that ALSA is not using a stable clock for the MIDI sequencer.
-
@mcc so, I'm not totally sure this isn't just my imagination, but I think switching my laptop's power mode from "balanced" to "performance" while running on battery causes the problem to get worse, which is how I arrived that at my current theory which is that ALSA is not using a stable clock for the MIDI sequencer.
@mcc My other theory is that this might be a consequence of having the jack audio thread crank the synthesizer, which in turn reads events off the ALSA input port, which means an intermittent batched processing thing is periodically polling a real time event source. However, I am under the impression that the audio thread wakes at a fixed cadence, and this wouldn't ever cause the song to get faster just compressed in weird ways, which is not what it sounds like.
-
@mcc My other theory is that this might be a consequence of having the jack audio thread crank the synthesizer, which in turn reads events off the ALSA input port, which means an intermittent batched processing thing is periodically polling a real time event source. However, I am under the impression that the audio thread wakes at a fixed cadence, and this wouldn't ever cause the song to get faster just compressed in weird ways, which is not what it sounds like.
@mcc my best guess on how to solve this is to turn off timestamps on the input port's queue (which preserves the timestamps written by sequencer applications, and then figure out how to translate the two different disjoint timestamp formats into relative time offsets so I can use the audio thread's cadence to regulate playback.
Or see if there's some way for me to tell ALSA when to advance the input queue and by how much (so far as I can tell there is no such mechanism)
-
@mcc my best guess on how to solve this is to turn off timestamps on the input port's queue (which preserves the timestamps written by sequencer applications, and then figure out how to translate the two different disjoint timestamp formats into relative time offsets so I can use the audio thread's cadence to regulate playback.
Or see if there's some way for me to tell ALSA when to advance the input queue and by how much (so far as I can tell there is no such mechanism)
@mcc a third option is I don't use ALSA for playing MIDI files and instead build that functionality into mollytime directly, and just treat ALSA as a means of connecting to MIDI hardware.
This is probably the best option, for also being the most portable :/
-
undefined oblomov@sociale.network shared this topic