-
Notifications
You must be signed in to change notification settings - Fork 10
Comments on DESIGN_DOC.md #4
Comments
From the perspective of a platform-agnostic settings GUI that isn't concerned with what platform it is running on, it wouldn't make sense to expose all the backend types on every system as an option.
I mean, isn't that exactly what a platform-agnostic abstraction does? Like
Oh yeah, that is a great point. Yeah I'll probably change it so it only scans one backend/device at a time.
Do you mean we should use device IDs or something? A lot of the time the name of the device is the ID, but I suppose adding the actual ID of a device wouldn't hurt.
Right, I suppose that could be confusing. I'll probably use a custom enum in place of
Hmm, I suppose this might be possible. But is it really necessary?
The behavior is already to use "fake" buffers filled with silence for ports and controllers that can't be found. I suppose some backends could just register any invalid controllers and ports with unconnected ports/controllers in the audio server.
Right, definitely. I forgot to add that one.
Rust marks it as an error if it's not a tuple.
Right, the purpose is just to be an estimate. I suppose I can do some name changing to make it more obvious.
Well, a large goal of this is to have everything synced into a single |
I suppose that makes sense. The enum wouldn't be meant to be iterated over though, just something that can be more cleanly matched against programmatically (the UI might need to be slightly different for each backend or you might want to add a textual explanation like in Bitwig). My gripe with CPAL's design is that it is a nightmare to programmatically select a backend that isn't always available, as evidenced by the dance that the examples have to do to support JACK. Even string identifiers is certainly a step up from that.
Mostly they would be dictated by OS of course, but I disagree with the way you've split the code into modules by OS currently. I'm thinking specifically of ASIO. It's a pain to compile, so it probably shouldn't be enabled by default. Same with JACK to some extent. So some backends aren't necessarily available even if the OS is appropriate. I doubt there's much code to be shared between backends on the same OS. CPAL's design seems reasonable in this regard.
Possibly, but maybe it'd make sense to keep device handles open in the driver. That definitely poses its own challenges though.
I don't know.
My main concern with the latency thing is it's not enough: timestamps for audio input and output times are necessary, as they are for MIDI events. I see you've now added a delta on the MIDI events "The amount of time passed, in frames, relative to the start of the process cycle." However, I think that's misguided. The MIDI events might be older than the current audio input buffer, or they may even be newer. There's no guarantee of them being inside the buffer, and live playback either needs to add systematic latency to avoid issues like this, or be slightly off. I don't think the IO lib should worry about such buffering, but rather just provide the events when they are available. Recorded MIDI events should be as precise as they can be, though. |
Yeah, that's fair. I suppose we could return enum values instead of the name of the backend as a String.
Right, backends like Jack and ASIO will be an optional feature.
Hmm, good point. I suppose this ties into whatever Bitwig calls the "MIDI clock". Do you have more insight on the proper way to do this? |
Okay, I commited a new API. Still need to figure out the MIDI clock thing though. |
As of 705d2f
Enumeration
Config
makes sense for JACK though, because the port names can also be customized, same as the client name.Configuration
I think there should be an option to skip input/output functionality. Or is that indicated by an empty vector?
The MIDI part of the API probably needs more fleshing out still.
Startup/run
Variant(u32, u32)
?Wild idea
Doing input and output syncrhonized in the same callback prevents a certain feature that may or may not be desired.
When recording, it is often more important that the recording is flawless, while the live playback (through effects and such) is less important and if it does have dropouts, there's not much that can be done about it. If input and output are instead run asynchronous of each other, it is possible to always keep recording without dropouts regardless of how slowly the effects chain is running.
More specifically, we could have it so that the input side runs on schedule and sends data to be stored on disk (or memory), and also sends it to the output side for further processing. The output side can then slow down and drop out as much as it likes without affecting the input side.
Something akin to this is provided by JACK2 asynchronous mode, though the recording would have to happen in a separate client from the effects. With JACK, it is explicitly stated that asynchronous mode increases latency by one period. Some additional latency is inevitable, so I suppose this should be configurable.
Earlier I thought this might be a common feature in DAWs, but my experience might have been incidental. Even with synchronized I/O, there is some room for the output to drop out before any input data is lost. From what I was able to test (and read code), none of Bitwig, Ardour or Reaper have this feature. So I guess we can happily ignore it.
The text was updated successfully, but these errors were encountered: