Issue when writing a duplex ALSA_seq driver with fluid-style routing #1263
Unanswered
albedozero
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello - I've been experimenting with writing my own duplex ALSA sequencer client that could filter/transform MIDI events, then echo the routed events to other subscribed ports and/or pass them on to a fluid_synth, for purposes similar to what @denybear outlined in #1198. I cribbed heavily from fluid_alsa.c and fluid_midi_router.c, so I thought perhaps someone here might have insight into the issue I encountered.
The issue is that I can output routed events to the buffer with
snd_seq_event_output()
, but trying to drain the buffer to the sequencer withsnd_seq_drain_output()
returns-EINVAL
. Looking at the alsa lib code, I think this is supposed to mean the output buffer is somehow invalid or inaccessible. A simple test output program I wrote in the source folder linked above works fine, so the only thing I can think of is that because the function to output MIDI events to the sequencer must be called while looping through the router rules, the rules_mutex is somehow blocking access to the appropriate memory location. Anyone here have the knowledge/insight to confirm or set me straight? Thanks for your time!Beta Was this translation helpful? Give feedback.
All reactions