-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure input capture channels for a layer #254
Conversation
@@ -38,7 +38,7 @@ | |||
# Configure logging | |||
#------------------------------------------------------------------------------- | |||
|
|||
log_level = logging.WARNING |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's take this out before merging :-)
|
||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the try:
should also be removed here (was for debugging only).
However, I found that if audio_autoconnect()
throws an exception, two problems occur:
- The exception doesn't make its way into the systemd journal logs (perhaps it's eaten or delayed?)
- The mutex is never released so the UI freezes
That's for a different PR of course; any ideas on how to approach this?
There is only ONE input (root) plugin on every FX layer, so the only info we need to store is what capture channels are "enabled" for this layer: 1, 2, or both. That's all. The autoconnector will do its task and will connect everything accordingly to the number of input channels on the root input plugin. |
The decision to make the data model store routing decisions, rather than make them dynamically each time, was made purposefully. This enables us to evolve the UI separately from the data model, e.g. to implement more complex routing cases later. Routing logic need not be hidden from the user completely; a Zynthian user can be expected to know what "Mono" or "Stereo" means. Please see the following screen shots of this branch: If instead a multi-select is presented, and 4 capture inputs are available, it also becomes less obvious to the user that only 2 'X'es should be selected. A second problem is that auto-detecting whether an LV2 is mono or stereo is hard to do reliably. Take for example the LSP Sidechain Mono Compressor (not currently in zynthian, but it's open source and popular). It has 2 audio inputs, but is not stereo. |
This commit adds the ability to configure which capture inputs route to the top input on an effects layer. Internally, this is stored in a "audio_in" dict that precisely specifies which capture inputs are connected to which LV2 input(s). To the user, a simplified list of mono / stereo choices are provided, depending on the number of capture inputs and number of LV2 inputs.
7d63507
to
0568814
Compare
Hi @jypma ! Your solution is good. I like it (the first one too!). The problem with this one is that it doesn't scale if we decide to add support for more than 2 audio channels. And then we would need to add code to migrate snapshots ... I would prefer a more "raw" approach, with the minimal coding complexity, keeping the same approach it's been used on the "Audio Out" routing. Having different approaches will create confusion ... Regarding the problem of detecting whether an LV2 is mono or stereo, it's a marginal problem and it could be solved by using a simple "gain" element as root. Anyway, i think this should be addressed by LV2 specification... |
OK! Please, don't work on this until i release a basic implementation with the same approach than the current output routing. After that, we can open the discussion and see if more functionality is wanted/desirable and, in such a case, improve both routing tools (output and capture) at once. |
Sure thing! Thanks a lot for the discussion so far. I actually did realize there's a case that my current "simple" setup doesn't cover: combining (adding) two capture channels into one mono plugin. The "X-es" approach would more naturally allow for that. Though, how would we handle the UX of having 4 capture channels listed, but limiting the selection to only 2 of them? Tying in to the coding discussion we were trying to get started, would this be a case to start experimenting with unit tests? |
It was a pleasure ... and believe me, you make me think about future approaches on zynthian's routing. You put good ideas over the desk ... ;-)
BTW, the basic "raw" implementation is commited. Perhaps you find interesting the autoconnect fragment that manage the capture connections. I tried to add support for more than 2 capture channels. And also extended this support to system output connections. But it must be tested with multi-channel cards...
I didn't. If you select more than 2 channels, they will be down-mixed. But i limited the number of input ports on root plugins that will be connected to 2 ... so ...
I really like the idea of unit tests, but it takes a lot of time to create and maintain!! Of course, you and everybody are very very welcome to add unit tests. I've already added some unit tests to the MIDI-filter rule parser: zynthian-ui/zyngine/zynthian_midi_filter.py Line 292 in 7a4bfdf
Perhaps this could be used as example. The "unittest" python module is really simple & clean to use ... The best! |
This commit adds the ability to configure which capture inputs route to
the top input on an effects layer.
Internally, this is stored in a "audio_in" dict that precisely specifies
which capture inputs are connected to which LV2 input(s).
To the user, a simplified list of mono / stereo choices are provided,
depending on the number of capture inputs and number of LV2 inputs.
Supersedes #253 and implements the "simple UI" idea from there.
TODO
audio_in
in snapshot state, once agreed on the format