This would later trigger an assert() in MidiRingBuffer<T>::read
when reading the status-byte, and cause undefined behavior down
in optimized builds.
It is unsure if this can happen, but it may explain
https://marcan.st/paste/LHDXNQ9x.txt
The file linked from the bug report has a meter-change
in the middle of a bar. Ardour maps this back to the previous
bar, which already has a meter-change. Session load fails with
"Multiple meter definitions found at 473"
The tempo-map of the file ends like this:
```
Meter 11/32 @227040 (beat 473)
Meter 4 / 4 @227680 (beat 483.666667)
```
This potentially breaks various assumptions (e.g. no resampling,
fixed buffersize) when the stream is moved to a different device.
Then again it's pulseaudio, which is unsuitable for pro-audio to
begin with.
This uses an atomic counter and spins only on the writer side, which
preserves realtime behavior on the reader side. The spinning yields (by
using the same Boost function from Boost spinlocks) to be
scheduler-friendly.
Fixing this bug also lets us be able to confidently drop garbage early
in the writer if appropriate, so do that and avoid keeping dead wood if
possible.
This reverts commit f95439a502:
"add spinlock to RCU manager to protect concurrent reader() and update() calls"
This can happen if the buffers have different sizes.
This fixes crashes that bisected to 7c37a18b7, but it is not the root
cause; it just happened to make things worse.
This fixes an issue with some soundcards e.g. "AxeFx III".
Device configuration fails unless set_hwpar() is performed
for the capture device before configuring the playack
device (half duplex is fine, too).
When a route's output is connected to multiple busses, re-establishing
port-connections on session-load calls Route::output_change_handler
multiple times.
Implicit solo counts are saved and restored by the route's SoloControl,
however the output_change_handler invalidated it on session load.
Since connections are restored iteratively, counting soloed downstream
routes will yield an incorrect result until all connections are
established.
This fixes the issue that implicit solo is lost on session-reload
in case a route has multiple connections with different up/downstream
solo states.
* Include main-out channel-count when bouncing the output
* Do not de-activate disk-reader and mains-out when freezing a track
* Ignore meter when counting channels