From 2a808322438a32d8d81476e15629abf68c6ba2f5 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 10 Apr 2020 09:53:44 -0600 Subject: [PATCH] add port connect/add/remove callbacks to the ALSA backend This fixes issues with new ports not (always) appearing in port matrices (and presumably elsewhere too) --- libs/backends/alsa/alsa_audiobackend.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/libs/backends/alsa/alsa_audiobackend.cc b/libs/backends/alsa/alsa_audiobackend.cc index d8ceb7f796..5d07bc1419 100644 --- a/libs/backends/alsa/alsa_audiobackend.cc +++ b/libs/backends/alsa/alsa_audiobackend.cc @@ -2210,9 +2210,13 @@ AlsaAudioPort::AlsaAudioPort (AlsaAudioBackend &b, const std::string& name, Port { memset (_buffer, 0, sizeof (_buffer)); mlock (_buffer, sizeof (_buffer)); + _backend.port_connect_add_remove_callback (); // XXX -> RT } -AlsaAudioPort::~AlsaAudioPort () { } +AlsaAudioPort::~AlsaAudioPort () +{ + _backend.port_connect_add_remove_callback (); // XXX -> RT +} void* AlsaAudioPort::get_buffer (pframes_t n_samples) @@ -2253,9 +2257,14 @@ AlsaMidiPort::AlsaMidiPort (AlsaAudioBackend &b, const std::string& name, PortFl _buffer[0].reserve(256); _buffer[1].reserve(256); _buffer[2].reserve(256); + + _backend.port_connect_add_remove_callback (); // XXX -> RT } -AlsaMidiPort::~AlsaMidiPort () { } +AlsaMidiPort::~AlsaMidiPort () +{ + _backend.port_connect_add_remove_callback (); // XXX -> RT +} struct MidiEventSorter { bool operator() (AlsaMidiEvent const& a, AlsaMidiEvent const& b) {