From 0aff098541183891b99b74327b5b46b5618212cd Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 11 Oct 2024 10:06:49 +0200 Subject: [PATCH 01/33] Fix IO Thread priority This adds `pbd_pthread_priority` indirection to correctly get the absolute thread priority. and for consistency a 4 letter enum is used. --- libs/ardour/io_tasklist.cc | 2 +- libs/pbd/pbd/pthread_utils.h | 3 ++- libs/pbd/pthread_utils.cc | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libs/ardour/io_tasklist.cc b/libs/ardour/io_tasklist.cc index faa0b02cca..d5dd73894f 100644 --- a/libs/ardour/io_tasklist.cc +++ b/libs/ardour/io_tasklist.cc @@ -76,7 +76,7 @@ IOTaskList::IOTaskList (uint32_t n_threads) _workers.resize (_n_threads); for (uint32_t i = 0; i < _n_threads; ++i) { - if (!use_rt || pbd_realtime_pthread_create (policy, THREAD_IO, 0, &_workers[i], &_worker_thread, this)) { + if (!use_rt || pbd_realtime_pthread_create (policy, PBD_RT_PRI_IOFX, 0, &_workers[i], &_worker_thread, this)) { if (use_rt && i == 0) { PBD::warning << _("IOTaskList: cannot acquire realtime permissions.") << endmsg; } diff --git a/libs/pbd/pbd/pthread_utils.h b/libs/pbd/pbd/pthread_utils.h index 01108861cf..069f9c9c23 100644 --- a/libs/pbd/pbd/pthread_utils.h +++ b/libs/pbd/pbd/pthread_utils.h @@ -58,6 +58,7 @@ # define PBD_RT_PRI_MIDI pbd_pthread_priority (THREAD_MIDI) # define PBD_RT_PRI_PROC pbd_pthread_priority (THREAD_PROC) # define PBD_RT_PRI_CTRL pbd_pthread_priority (THREAD_CTRL) +# define PBD_RT_PRI_IOFX pbd_pthread_priority (THREAD_IOFX) LIBPBD_API int pthread_create_and_store (std::string name, pthread_t *thread, void * (*start_routine)(void *), void * arg, uint32_t stacklimit = 0x80000 /*512kB*/); LIBPBD_API void pthread_cancel_one (pthread_t thread); @@ -73,7 +74,7 @@ enum PBDThreadClass { THREAD_MIDI, // MIDI I/O threads THREAD_PROC, // realtime worker THREAD_CTRL, // Automation watch, BaseUI - THREAD_IO // non-realtime I/O + THREAD_IOFX // non-realtime I/O and regionFX }; LIBPBD_API int pbd_pthread_priority (PBDThreadClass); diff --git a/libs/pbd/pthread_utils.cc b/libs/pbd/pthread_utils.cc index 88e21d2624..721de0a728 100644 --- a/libs/pbd/pthread_utils.cc +++ b/libs/pbd/pthread_utils.cc @@ -348,7 +348,7 @@ pbd_pthread_priority (PBDThreadClass which) case THREAD_CTRL: default: return -14; // THREAD_PRIORITY_HIGHEST (2) - case THREAD_IO: + case THREAD_IOFX: /* https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-libraries/winpthreads/src/sched.c */ return -15; // THREAD_PRIORITY_ABOVE_NORMAL (1) } @@ -372,7 +372,7 @@ pbd_pthread_priority (PBDThreadClass which) return base - 2; case THREAD_CTRL: return base - 3; - case THREAD_IO: + case THREAD_IOFX: return base - 10; } #endif From 6e6511b0284ab054e689bc8fb28f01c1affd0c1d Mon Sep 17 00:00:00 2001 From: g Date: Wed, 9 Oct 2024 23:29:06 +0200 Subject: [PATCH 02/33] ardour.desktop.in add NSM related keys --- gtk2_ardour/ardour.desktop.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gtk2_ardour/ardour.desktop.in b/gtk2_ardour/ardour.desktop.in index 1770bda8bf..faf28a78ca 100644 --- a/gtk2_ardour/ardour.desktop.in +++ b/gtk2_ardour/ardour.desktop.in @@ -8,3 +8,5 @@ MimeType=application/x-ardour; Type=Application Categories=AudioVideo;Audio;AudioEditing;X-Recorders;X-Multitrack;X-Jack; StartupWMClass=Ardour +X-NSM-Capable=true +X-NSM-Exec=@ARDOUR_EXEC@ From f18291c20db85f1f23f3769388d497564b553576 Mon Sep 17 00:00:00 2001 From: cooltehno Date: Fri, 11 Oct 2024 13:48:04 +0300 Subject: [PATCH 03/33] Update blueberry_milk-ardour.colors --- gtk2_ardour/themes/blueberry_milk-ardour.colors | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk2_ardour/themes/blueberry_milk-ardour.colors b/gtk2_ardour/themes/blueberry_milk-ardour.colors index 24916c5943..67647d1be9 100644 --- a/gtk2_ardour/themes/blueberry_milk-ardour.colors +++ b/gtk2_ardour/themes/blueberry_milk-ardour.colors @@ -317,7 +317,7 @@ - + From 8e4398bc37c32199ea3b10aa2f67ea14cd8a4318 Mon Sep 17 00:00:00 2001 From: cooltehno Date: Fri, 11 Oct 2024 13:34:36 +0300 Subject: [PATCH 04/33] Update adwaita_dark-ardour.colors --- gtk2_ardour/themes/adwaita_dark-ardour.colors | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk2_ardour/themes/adwaita_dark-ardour.colors b/gtk2_ardour/themes/adwaita_dark-ardour.colors index 0e8521660f..6468ba8faf 100644 --- a/gtk2_ardour/themes/adwaita_dark-ardour.colors +++ b/gtk2_ardour/themes/adwaita_dark-ardour.colors @@ -326,7 +326,7 @@ - + From 071c5790b0e9a8f701f6cbdeec1cf0848547a1cb Mon Sep 17 00:00:00 2001 From: cooltehno Date: Fri, 11 Oct 2024 13:49:59 +0300 Subject: [PATCH 05/33] Update caineville-ardour.colors --- gtk2_ardour/themes/caineville-ardour.colors | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk2_ardour/themes/caineville-ardour.colors b/gtk2_ardour/themes/caineville-ardour.colors index 65a3c074aa..4a124783d6 100644 --- a/gtk2_ardour/themes/caineville-ardour.colors +++ b/gtk2_ardour/themes/caineville-ardour.colors @@ -318,7 +318,7 @@ - + From 01f945caee3664c4bbf7ca19ae8dbf2dc25ce223 Mon Sep 17 00:00:00 2001 From: cooltehno Date: Fri, 11 Oct 2024 14:11:27 +0300 Subject: [PATCH 06/33] Update xcolors-ardour.colors --- gtk2_ardour/themes/xcolors-ardour.colors | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk2_ardour/themes/xcolors-ardour.colors b/gtk2_ardour/themes/xcolors-ardour.colors index 5df8e64d6c..696215b47c 100644 --- a/gtk2_ardour/themes/xcolors-ardour.colors +++ b/gtk2_ardour/themes/xcolors-ardour.colors @@ -318,7 +318,7 @@ - + From 37ef68f17a358969f6f94fd8eb86b063fd807108 Mon Sep 17 00:00:00 2001 From: cooltehno Date: Fri, 11 Oct 2024 14:10:07 +0300 Subject: [PATCH 07/33] Update diehard3-ardour.colors --- gtk2_ardour/themes/diehard3-ardour.colors | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk2_ardour/themes/diehard3-ardour.colors b/gtk2_ardour/themes/diehard3-ardour.colors index 459a0ee382..a204f6724b 100644 --- a/gtk2_ardour/themes/diehard3-ardour.colors +++ b/gtk2_ardour/themes/diehard3-ardour.colors @@ -319,7 +319,7 @@ - + From 63406c71394c9381d60a76dcb93a3af6cbbd9d9a Mon Sep 17 00:00:00 2001 From: cooltehno Date: Fri, 11 Oct 2024 14:08:03 +0300 Subject: [PATCH 08/33] Update unastudia-ardour.colors --- gtk2_ardour/themes/unastudia-ardour.colors | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk2_ardour/themes/unastudia-ardour.colors b/gtk2_ardour/themes/unastudia-ardour.colors index a989472786..4e29bdcc71 100644 --- a/gtk2_ardour/themes/unastudia-ardour.colors +++ b/gtk2_ardour/themes/unastudia-ardour.colors @@ -317,7 +317,7 @@ - + From c64abef1d0367fe6627b3776522881c06eca3655 Mon Sep 17 00:00:00 2001 From: cooltehno Date: Fri, 11 Oct 2024 13:54:51 +0300 Subject: [PATCH 09/33] Update captain_light-ardour.colors --- gtk2_ardour/themes/captain_light-ardour.colors | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/themes/captain_light-ardour.colors b/gtk2_ardour/themes/captain_light-ardour.colors index fb29b03025..e84afef2c0 100644 --- a/gtk2_ardour/themes/captain_light-ardour.colors +++ b/gtk2_ardour/themes/captain_light-ardour.colors @@ -58,7 +58,7 @@ - + @@ -324,7 +324,7 @@ - + From b88a6733d677bd0f9280213f1ff0eb8ecadda5e6 Mon Sep 17 00:00:00 2001 From: cooltehno Date: Fri, 11 Oct 2024 14:03:40 +0300 Subject: [PATCH 10/33] Update clear_gray-ardour.colors --- gtk2_ardour/themes/clear_gray-ardour.colors | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk2_ardour/themes/clear_gray-ardour.colors b/gtk2_ardour/themes/clear_gray-ardour.colors index aeba333bf4..8f4f2e2ac4 100644 --- a/gtk2_ardour/themes/clear_gray-ardour.colors +++ b/gtk2_ardour/themes/clear_gray-ardour.colors @@ -318,7 +318,7 @@ - + From 9727895fc8403665da3c1695f308d78c1ced5422 Mon Sep 17 00:00:00 2001 From: cooltehno Date: Fri, 11 Oct 2024 14:04:51 +0300 Subject: [PATCH 11/33] Update cubasish-ardour.colors --- gtk2_ardour/themes/cubasish-ardour.colors | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk2_ardour/themes/cubasish-ardour.colors b/gtk2_ardour/themes/cubasish-ardour.colors index 8818f4e6ba..bfd6b1d4a1 100644 --- a/gtk2_ardour/themes/cubasish-ardour.colors +++ b/gtk2_ardour/themes/cubasish-ardour.colors @@ -318,7 +318,7 @@ - + From 944e9720bd9752a5d6914a86df28dbbaca0130af Mon Sep 17 00:00:00 2001 From: cooltehno Date: Fri, 11 Oct 2024 14:06:12 +0300 Subject: [PATCH 12/33] Update recbox-ardour.colors --- gtk2_ardour/themes/recbox-ardour.colors | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk2_ardour/themes/recbox-ardour.colors b/gtk2_ardour/themes/recbox-ardour.colors index f445eb70ed..5c88f7ef64 100644 --- a/gtk2_ardour/themes/recbox-ardour.colors +++ b/gtk2_ardour/themes/recbox-ardour.colors @@ -319,7 +319,7 @@ - + From fd8808d7b8c9ab095188128883b0d9011ea8e080 Mon Sep 17 00:00:00 2001 From: John Emmas Date: Sun, 13 Oct 2024 11:39:48 +0100 Subject: [PATCH 13/33] Minor declaration issue that upsets MSVC/c++17 --- libs/pbd/pbd/msvc_pbd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/pbd/pbd/msvc_pbd.h b/libs/pbd/pbd/msvc_pbd.h index b4ad77363f..ed52b55b0a 100644 --- a/libs/pbd/pbd/msvc_pbd.h +++ b/libs/pbd/pbd/msvc_pbd.h @@ -176,7 +176,7 @@ typedef unsigned int nfds_t; extern "C" { #endif /* __cplusplus */ -LIBPBD_API int __cdecl gettimeofday(struct timeval *__restrict tv, __timezone_ptr_t tz); +LIBPBD_API int __cdecl gettimeofday(struct timeval *__restrict tv, __timezone_ptr_t tz) __THROW; LIBPBD_API ssize_t PBD_APICALLTYPE pread(int handle, void *buf, size_t nbytes, off_t offset); LIBPBD_API ssize_t PBD_APICALLTYPE pwrite(int handle, const void *buf, size_t nbytes, off_t offset); From 63d3d1ff3d1eb5dc06ea9cec378f4bd1d3c33bc0 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 14 Oct 2024 17:57:15 +0200 Subject: [PATCH 14/33] Initialize fader's numeric entry adjustment Previously the internal adjustment used for numeric entry was left at 0 if the BarController's adjustment was never modified. --- libs/widgets/slider_controller.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/widgets/slider_controller.cc b/libs/widgets/slider_controller.cc index 9adf823d58..4110ff1844 100644 --- a/libs/widgets/slider_controller.cc +++ b/libs/widgets/slider_controller.cc @@ -57,6 +57,8 @@ SliderController::SliderController (Gtk::Adjustment *adj, std::shared_ptrinterface_to_internal(adj->get_page_increment()) - _ctrl->lower ()); } + ctrl_adjusted (); + adj->signal_value_changed().connect (sigc::mem_fun(*this, &SliderController::ctrl_adjusted)); _spin_adj.signal_value_changed().connect (sigc::mem_fun(*this, &SliderController::spin_adjusted)); From 87fdec1c51e0ca865eda3794bc7f5cd768aee559 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 14 Oct 2024 20:59:59 +0200 Subject: [PATCH 15/33] Add preference to configure Disk I/O Thread priority --- gtk2_ardour/rc_option_editor.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index e360b4a137..424e13a5f5 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -4950,6 +4950,19 @@ These settings will only take effect after %1 is restarted.\n\ procs->set_note (string_compose (_("This setting will only take effect when %1 is restarted."), PROGRAM_NAME)); add_option (_("Performance"), procs); + +#ifndef PLATFORM_WINDOWS + ComboOption* iotp = new ComboOption ( + "io-thread-policy", + _("Disk I/O thread scheduling policy"), + sigc::mem_fun (*_rc_config, &RCConfiguration::get_io_thread_policy), + sigc::mem_fun (*_rc_config, &RCConfiguration::set_io_thread_policy) + ); + iotp->add (0, _("No priority")); + iotp->add (1, _("Realtime (FIFO)")); + iotp->add (1, _("Realtime (Round Robin)")); + add_option (_("Performance"), iotp); +#endif } /* Image cache size */ From 8115578d4e86223c2fb66f9423ce68469bb6895d Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 14 Oct 2024 21:49:56 +0200 Subject: [PATCH 16/33] Add RT thread priority debugging --- libs/ardour/io_tasklist.cc | 2 +- libs/backends/alsa/alsa_audiobackend.cc | 4 ++-- libs/backends/alsa/alsa_midi.cc | 2 +- libs/backends/alsa/alsa_slave.cc | 2 +- libs/backends/coreaudio/coreaudio_backend.cc | 2 +- libs/backends/dummy/dummy_audiobackend.cc | 4 ++-- libs/backends/portaudio/portaudio_backend.cc | 4 ++-- libs/backends/portaudio/winmmemidi_output_device.cc | 2 +- libs/backends/pulseaudio/pulseaudio_backend.cc | 4 ++-- libs/pbd/pbd/pthread_utils.h | 1 + libs/pbd/pthread_utils.cc | 3 ++- 11 files changed, 16 insertions(+), 14 deletions(-) diff --git a/libs/ardour/io_tasklist.cc b/libs/ardour/io_tasklist.cc index d5dd73894f..69582be615 100644 --- a/libs/ardour/io_tasklist.cc +++ b/libs/ardour/io_tasklist.cc @@ -76,7 +76,7 @@ IOTaskList::IOTaskList (uint32_t n_threads) _workers.resize (_n_threads); for (uint32_t i = 0; i < _n_threads; ++i) { - if (!use_rt || pbd_realtime_pthread_create (policy, PBD_RT_PRI_IOFX, 0, &_workers[i], &_worker_thread, this)) { + if (!use_rt || pbd_realtime_pthread_create ("I/O", policy, PBD_RT_PRI_IOFX, 0, &_workers[i], &_worker_thread, this)) { if (use_rt && i == 0) { PBD::warning << _("IOTaskList: cannot acquire realtime permissions.") << endmsg; } diff --git a/libs/backends/alsa/alsa_audiobackend.cc b/libs/backends/alsa/alsa_audiobackend.cc index 67794bef9d..d81fbab9ee 100644 --- a/libs/backends/alsa/alsa_audiobackend.cc +++ b/libs/backends/alsa/alsa_audiobackend.cc @@ -952,7 +952,7 @@ AlsaAudioBackend::_start (bool for_latency_measurement) _run = true; _port_change_flag.store (0); - if (pbd_realtime_pthread_create (PBD_SCHED_FIFO, PBD_RT_PRI_MAIN, PBD_RT_STACKSIZE_PROC, + if (pbd_realtime_pthread_create ("ALSA Main", PBD_SCHED_FIFO, PBD_RT_PRI_MAIN, PBD_RT_STACKSIZE_PROC, &_main_thread, pthread_process, this)) { if (pbd_pthread_create (PBD_RT_STACKSIZE_PROC, &_main_thread, pthread_process, this)) { PBD::error << _("AlsaAudioBackend: failed to create process thread.") << endmsg; @@ -1152,7 +1152,7 @@ AlsaAudioBackend::create_process_thread (boost::function func) pthread_t thread_id; ThreadData* td = new ThreadData (this, func, PBD_RT_STACKSIZE_PROC); - if (pbd_realtime_pthread_create (PBD_SCHED_FIFO, PBD_RT_PRI_PROC, PBD_RT_STACKSIZE_PROC, &thread_id, alsa_process_thread, td)) { + if (pbd_realtime_pthread_create ("ALSA Proc", PBD_SCHED_FIFO, PBD_RT_PRI_PROC, PBD_RT_STACKSIZE_PROC, &thread_id, alsa_process_thread, td)) { if (pbd_pthread_create (PBD_RT_STACKSIZE_PROC, &thread_id, alsa_process_thread, td)) { PBD::error << _("AudioEngine: cannot create process thread.") << endmsg; return -1; diff --git a/libs/backends/alsa/alsa_midi.cc b/libs/backends/alsa/alsa_midi.cc index 272f391682..15d25cc64b 100644 --- a/libs/backends/alsa/alsa_midi.cc +++ b/libs/backends/alsa/alsa_midi.cc @@ -73,7 +73,7 @@ static void * pthread_process (void *arg) int AlsaMidiIO::start () { - if (pbd_realtime_pthread_create (PBD_SCHED_FIFO, PBD_RT_PRI_MIDI, PBD_RT_STACKSIZE_HELP, + if (pbd_realtime_pthread_create ("ALSA MIDI", PBD_SCHED_FIFO, PBD_RT_PRI_MIDI, PBD_RT_STACKSIZE_HELP, &_main_thread, pthread_process, this)) { if (pbd_pthread_create (PBD_RT_STACKSIZE_HELP, &_main_thread, pthread_process, this)) { diff --git a/libs/backends/alsa/alsa_slave.cc b/libs/backends/alsa/alsa_slave.cc index bc8a1bfd15..6f1025e1d9 100644 --- a/libs/backends/alsa/alsa_slave.cc +++ b/libs/backends/alsa/alsa_slave.cc @@ -111,7 +111,7 @@ AlsaAudioSlave::start () } _run = true; - if (pbd_realtime_pthread_create (PBD_SCHED_FIFO, PBD_RT_PRI_MAIN, PBD_RT_STACKSIZE_HELP, + if (pbd_realtime_pthread_create ("ALSA Slave", PBD_SCHED_FIFO, PBD_RT_PRI_MAIN, PBD_RT_STACKSIZE_HELP, &_thread, _process_thread, this)) { if (pbd_pthread_create (PBD_RT_STACKSIZE_HELP, &_thread, _process_thread, this)) { diff --git a/libs/backends/coreaudio/coreaudio_backend.cc b/libs/backends/coreaudio/coreaudio_backend.cc index a81b7d82d6..f9c245c6be 100644 --- a/libs/backends/coreaudio/coreaudio_backend.cc +++ b/libs/backends/coreaudio/coreaudio_backend.cc @@ -829,7 +829,7 @@ CoreAudioBackend::create_process_thread (boost::function func) } #endif - if (pbd_realtime_pthread_create (PBD_SCHED_FIFO, PBD_RT_PRI_PROC, PBD_RT_STACKSIZE_PROC, + if (pbd_realtime_pthread_create ("CoreAudio Proc", PBD_SCHED_FIFO, PBD_RT_PRI_PROC, PBD_RT_STACKSIZE_PROC, &thread_id, coreaudio_process_thread, td)) { if (pbd_pthread_create (PBD_RT_STACKSIZE_PROC, &thread_id, coreaudio_process_thread, td)) { PBD::error << _("AudioEngine: cannot create process thread.") << endmsg; diff --git a/libs/backends/dummy/dummy_audiobackend.cc b/libs/backends/dummy/dummy_audiobackend.cc index c20403613e..ae1e8edbe5 100644 --- a/libs/backends/dummy/dummy_audiobackend.cc +++ b/libs/backends/dummy/dummy_audiobackend.cc @@ -431,7 +431,7 @@ DummyAudioBackend::_start (bool /*for_latency_measurement*/) _port_change_flag.store (0); bool ok = _realtime; - if (_realtime && pbd_realtime_pthread_create (PBD_SCHED_FIFO, PBD_RT_PRI_MAIN, PBD_RT_STACKSIZE_PROC, &_main_thread, pthread_process, this)) { + if (_realtime && pbd_realtime_pthread_create ("Dummy Main", PBD_SCHED_FIFO, PBD_RT_PRI_MAIN, PBD_RT_STACKSIZE_PROC, &_main_thread, pthread_process, this)) { PBD::warning << _("DummyAudioBackend: failed to acquire realtime permissions.") << endmsg; ok = false; } @@ -529,7 +529,7 @@ DummyAudioBackend::create_process_thread (boost::function func) pthread_t thread_id; ThreadData* td = new ThreadData (this, func, PBD_RT_STACKSIZE_PROC); - bool ok = _realtime && 0 == pbd_realtime_pthread_create (PBD_SCHED_FIFO, PBD_RT_PRI_PROC, PBD_RT_STACKSIZE_PROC, &thread_id, dummy_process_thread, td); + bool ok = _realtime && 0 == pbd_realtime_pthread_create ("Dummy Proc", PBD_SCHED_FIFO, PBD_RT_PRI_PROC, PBD_RT_STACKSIZE_PROC, &thread_id, dummy_process_thread, td); if (!ok && pbd_pthread_create (PBD_RT_STACKSIZE_PROC, &thread_id, dummy_process_thread, td)) { PBD::error << _("AudioEngine: cannot create process thread.") << endmsg; return -1; diff --git a/libs/backends/portaudio/portaudio_backend.cc b/libs/backends/portaudio/portaudio_backend.cc index c8268a5045..66c6d56f45 100644 --- a/libs/backends/portaudio/portaudio_backend.cc +++ b/libs/backends/portaudio/portaudio_backend.cc @@ -775,7 +775,7 @@ PortAudioBackend::process_callback(const float* input, bool PortAudioBackend::start_blocking_process_thread () { - if (pbd_realtime_pthread_create (PBD_SCHED_FIFO, PBD_RT_PRI_MAIN, PBD_RT_STACKSIZE_PROC, + if (pbd_realtime_pthread_create ("PortAudio Main", PBD_SCHED_FIFO, PBD_RT_PRI_MAIN, PBD_RT_STACKSIZE_PROC, &_main_blocking_thread, blocking_thread_func, this)) { if (pbd_pthread_create (PBD_RT_STACKSIZE_PROC, &_main_blocking_thread, blocking_thread_func, this)) @@ -1103,7 +1103,7 @@ PortAudioBackend::create_process_thread (boost::function func) pthread_t thread_id; ThreadData* td = new ThreadData (this, func, PBD_RT_STACKSIZE_PROC); - if (pbd_realtime_pthread_create (PBD_SCHED_FIFO, PBD_RT_PRI_PROC, PBD_RT_STACKSIZE_PROC, + if (pbd_realtime_pthread_create ("PortAudio Proc", PBD_SCHED_FIFO, PBD_RT_PRI_PROC, PBD_RT_STACKSIZE_PROC, &thread_id, portaudio_process_thread, td)) { if (pbd_pthread_create (PBD_RT_STACKSIZE_PROC, &thread_id, portaudio_process_thread, td)) { DEBUG_AUDIO("Cannot create process thread."); diff --git a/libs/backends/portaudio/winmmemidi_output_device.cc b/libs/backends/portaudio/winmmemidi_output_device.cc index 316afce614..bd70d7c9d7 100644 --- a/libs/backends/portaudio/winmmemidi_output_device.cc +++ b/libs/backends/portaudio/winmmemidi_output_device.cc @@ -230,7 +230,7 @@ WinMMEMidiOutputDevice::start_midi_output_thread () m_thread_quit = false; // TODO Use native threads - if (pbd_realtime_pthread_create (PBD_SCHED_FIFO, PBD_RT_PRI_MIDI, PBD_RT_STACKSIZE_HELP, + if (pbd_realtime_pthread_create ("WinMME Output", PBD_SCHED_FIFO, PBD_RT_PRI_MIDI, PBD_RT_STACKSIZE_HELP, &m_output_thread_handle, midi_output_thread, this)) { return false; } diff --git a/libs/backends/pulseaudio/pulseaudio_backend.cc b/libs/backends/pulseaudio/pulseaudio_backend.cc index da4a2d0027..9d4ea88014 100644 --- a/libs/backends/pulseaudio/pulseaudio_backend.cc +++ b/libs/backends/pulseaudio/pulseaudio_backend.cc @@ -584,7 +584,7 @@ PulseAudioBackend::_start (bool /*for_latency_measurement*/) _run = true; _port_change_flag.store (0); - if (pbd_realtime_pthread_create (PBD_SCHED_FIFO, PBD_RT_PRI_MAIN, PBD_RT_STACKSIZE_PROC, + if (pbd_realtime_pthread_create ("PulseAudio Main", PBD_SCHED_FIFO, PBD_RT_PRI_MAIN, PBD_RT_STACKSIZE_PROC, &_main_thread, pthread_process, this)) { if (pbd_pthread_create (PBD_RT_STACKSIZE_PROC, &_main_thread, pthread_process, this)) { PBD::error << _("PulseAudioBackend: failed to create process thread.") << endmsg; @@ -703,7 +703,7 @@ PulseAudioBackend::create_process_thread (boost::function func) pthread_t thread_id; ThreadData* td = new ThreadData (this, func, PBD_RT_STACKSIZE_PROC); - if (pbd_realtime_pthread_create (PBD_SCHED_FIFO, PBD_RT_PRI_PROC, PBD_RT_STACKSIZE_PROC, + if (pbd_realtime_pthread_create ("PulseAudio Proc", PBD_SCHED_FIFO, PBD_RT_PRI_PROC, PBD_RT_STACKSIZE_PROC, &thread_id, pulse_process_thread, td)) { if (pbd_pthread_create (PBD_RT_STACKSIZE_PROC, &thread_id, pulse_process_thread, td)) { PBD::error << _("AudioEngine: cannot create process thread.") << endmsg; diff --git a/libs/pbd/pbd/pthread_utils.h b/libs/pbd/pbd/pthread_utils.h index 069f9c9c23..181dcf9ca8 100644 --- a/libs/pbd/pbd/pthread_utils.h +++ b/libs/pbd/pbd/pthread_utils.h @@ -87,6 +87,7 @@ LIBPBD_API int pbd_pthread_create ( LIBPBD_API int pbd_realtime_pthread_create ( + std::string const& debug_name, const int policy, int priority, const size_t stacksize, pthread_t *thread, void *(*start_routine) (void *), diff --git a/libs/pbd/pthread_utils.cc b/libs/pbd/pthread_utils.cc index 721de0a728..6a72a284ca 100644 --- a/libs/pbd/pthread_utils.cc +++ b/libs/pbd/pthread_utils.cc @@ -396,6 +396,7 @@ pbd_absolute_rt_priority (int policy, int priority) int pbd_realtime_pthread_create ( + std::string const& debug_name, const int policy, int priority, const size_t stacksize, pthread_t* thread, void* (*start_routine) (void*), @@ -416,7 +417,7 @@ pbd_realtime_pthread_create ( if (stacksize > 0) { pthread_attr_setstacksize (&attr, stacksize + pbd_stack_size ()); } - DEBUG_TRACE (PBD::DEBUG::Threads, string_compose ("Start Realtime Thread policy = %1 priority = %2 stacksize = 0x%3%4\n", policy, parm.sched_priority, std::hex, stacksize)); + DEBUG_TRACE (PBD::DEBUG::Threads, string_compose ("Start RT Thread: '%1' policy = %2 priority = %3 stacksize = 0x%4%5\n", debug_name, policy, parm.sched_priority, std::hex, stacksize)); rv = pthread_create (thread, &attr, start_routine, arg); pthread_attr_destroy (&attr); From 6a2d3fcbecf60e65b6558cd1a7c87b43686231b7 Mon Sep 17 00:00:00 2001 From: Daniel Appelt Date: Sat, 12 Oct 2024 20:29:13 +0200 Subject: [PATCH 17/33] Add script that duplicates regions on the grid --- share/scripts/duplicate_to_grid.lua | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 share/scripts/duplicate_to_grid.lua diff --git a/share/scripts/duplicate_to_grid.lua b/share/scripts/duplicate_to_grid.lua new file mode 100644 index 0000000000..3139af7490 --- /dev/null +++ b/share/scripts/duplicate_to_grid.lua @@ -0,0 +1,37 @@ +ardour { + ["type"] = "EditorAction", + name = "Duplicate to grid", + version = "0.1.0", + license = "MIT", + author = "Daniel Appelt", + description = [[Duplicate region to grid]] +} + +function factory () return function () + -- Get first selected region + local regionList = Editor:get_selection().regions:regionlist() + local region = regionList:front() + + -- Bail out if no region was selected + if region:isnil() then + LuaDialog.Message("Duplicate to grid", "Please select a region first!", + LuaDialog.MessageType.Info, LuaDialog.ButtonType.Close):run() + return + end + + -- Create duplicate of region + local playlist = region:playlist() + local curPos = region:position() + local curBeat = Editor:get_grid_type_as_beats(true, curPos) + local nextPos = Temporal.timepos_t.from_ticks(curPos:ticks() + curBeat:to_ticks()) + -- gap could be used to create mulitple duplicates at once + local gap = Temporal.timecnt_t.from_ticks(curBeat:to_ticks()) + playlist:duplicate(region, nextPos, gap, 1) + + -- Change selection to duplicate to allow repeated application + local selectionList = ArdourUI.SelectionList() + region = playlist:find_next_region(curPos, ARDOUR.RegionPoint.Start, 1) + local regionView = Editor:regionview_from_region(region) + selectionList:push_back(regionView) + Editor:set_selection(selectionList, ArdourUI.SelectionOp.Set) +end end From eb87b0e2ebb083f6b7faef8955a731099c684b83 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 14 Oct 2024 22:52:37 +0200 Subject: [PATCH 18/33] Remove old safety check These days it only produces false positives (locate at start of session export). We leave `ENSURE_PROCESS_THREAD` in place, since it may come in handy at some point (eg. static analysis, documentation) --- libs/ardour/session_transport.cc | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index 22fc3ee670..02df6e0f59 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -73,18 +73,7 @@ using namespace ARDOUR; using namespace PBD; using namespace Temporal; -#ifdef NDEBUG -# define ENSURE_PROCESS_THREAD do {} while (0) -#else -# define ENSURE_PROCESS_THREAD \ - do { \ - if (!AudioEngine::instance()->in_process_thread() \ - && !loading ()) { \ - PBD::stacktrace (std::cerr, 30); \ - } \ - } while (0) -#endif - +#define ENSURE_PROCESS_THREAD do {} while (0) #define TFSM_EVENT(evtype) { _transport_fsm->enqueue (new TransportFSM::Event (evtype)); } #define TFSM_ROLL() { _transport_fsm->enqueue (new TransportFSM::Event (TransportFSM::StartTransport)); } From 57c5aa95f7b066a84683f2d93b26639e4d85222f Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Fri, 26 Jul 2024 21:08:20 +0200 Subject: [PATCH 19/33] preferences: Don't lowercase 'ardour' in the 'monitoring' list between 'Audio Driver' and 'Audio Hardware' c7ec2bb gave the other "Record monitoring handled by" options nice title casing. Now allow the application name to use a similar style. --- gtk2_ardour/rc_option_editor.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index 424e13a5f5..f14e7834cf 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -4354,7 +4354,6 @@ These settings will only take effect after %1 is restarted.\n\ } string prog (PROGRAM_NAME); - boost::algorithm::to_lower (prog); mm->add (SoftwareMonitoring, string_compose (_("%1"), prog)); mm->add (ExternalMonitoring, _("Audio Hardware")); From b7249c8fe7363fc2fb41b7b9910113c940a24709 Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Thu, 12 Sep 2024 21:20:48 +0200 Subject: [PATCH 20/33] build: Set _POSIX_C_SOURCE=200809L instead of comment about -std=gnu99 in 8fea1ea42ec We are converging towards setting it globally. --- libs/hidapi/wscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/hidapi/wscript b/libs/hidapi/wscript index 459327ebed..a85dd53058 100644 --- a/libs/hidapi/wscript +++ b/libs/hidapi/wscript @@ -35,6 +35,7 @@ def build(bld): autowaf.ensure_visible_symbols (obj, False) obj.export_includes = ['hidapi'] obj.includes = ['hidapi'] + obj.defines = ['_POSIX_C_SOURCE=200809L'] obj.name = 'hidapi' obj.target = 'hidapi' obj.vnum = HIDAPI_VERSION @@ -51,7 +52,6 @@ def build(bld): obj.source = 'mac/hid.c' obj.framework = [ 'IOKit', 'CoreFoundation' ] else: - # with '-strict' this needs "-std=gnu99" to compile w/o warnings obj.source = 'linux/hid.c' if re.search ("linux", sys.platform) != None: obj.uselib = 'UDEV' From 3171eb5aa104572256a6870a6bb58eb89ddb4e81 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 15 Oct 2024 00:35:50 +0200 Subject: [PATCH 21/33] C++17 requires macOS 10.13 or later --- wscript | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wscript b/wscript index bf434811b2..2ea20126ec 100644 --- a/wscript +++ b/wscript @@ -748,9 +748,9 @@ int main() { return 0; }''', elif conf.env['build_target'] in ['bigsur'] and not opt.arm64: compiler_flags.extend( - ("-DMAC_OS_X_VERSION_MAX_ALLOWED=101100", - "-mmacosx-version-min=10.11")) - linker_flags.append("-mmacosx-version-min=10.11") + ("-DMAC_OS_X_VERSION_MAX_ALLOWED=101300", + "-mmacosx-version-min=10.13")) + linker_flags.append("-mmacosx-version-min=10.13") elif conf.env['build_target'] in ['bigsur', 'monterey', 'ventura', 'sonoma', 'sequoia']: compiler_flags.extend( From 5c763c99baba62ae05454f411f10605bedd63eac Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Sun, 25 Aug 2024 17:03:18 +0200 Subject: [PATCH 22/33] FaderPort8: Use explicit "Port 1" for FP8 too 84e38b4c65c made the same change for FP16. It has apparently not been necessary for FP8 so far, because backends have happened to report "Port 1" before the control port. But that is not necessarily the case. It failed for me when playing around. Change FP8 handling to also not make assumptions about the device order returned by the backend. --- libs/surfaces/faderport8/faderport8.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/surfaces/faderport8/faderport8.cc b/libs/surfaces/faderport8/faderport8.cc index 852697f311..c204eba06e 100644 --- a/libs/surfaces/faderport8/faderport8.cc +++ b/libs/surfaces/faderport8/faderport8.cc @@ -117,7 +117,7 @@ FaderPort8::probe (std::string& i, std::string& o) #elif defined FADERPORT2 "PreSonus FP2" #else - "PreSonus FP8" + "PreSonus FP8 Port 1" #endif ; From 99ba70384aa99fa5b1045db1017d816d510a8167 Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Mon, 7 Oct 2024 21:36:51 +0200 Subject: [PATCH 23/33] FaderPort8: Improve DEBUG_TRACE messages --- libs/surfaces/faderport8/faderport8.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/surfaces/faderport8/faderport8.cc b/libs/surfaces/faderport8/faderport8.cc index c204eba06e..e20ad05345 100644 --- a/libs/surfaces/faderport8/faderport8.cc +++ b/libs/surfaces/faderport8/faderport8.cc @@ -465,7 +465,7 @@ FaderPort8::connection_handler (std::string name1, std::string name2) string no = ARDOUR::AudioEngine::instance()->make_port_name_non_relative (std::shared_ptr(_output_port)->name()); if (ni == name1 || ni == name2) { - DEBUG_TRACE (DEBUG::FaderPort8, string_compose ("Connection notify %1 and %2\n", name1, name2)); + DEBUG_TRACE (DEBUG::FaderPort8, string_compose ("Connection notify inputs '%1' and '%2'\n", name1, name2)); if (_input_port->connected ()) { if (_connection_state & InputConnected) { return false; @@ -475,7 +475,7 @@ FaderPort8::connection_handler (std::string name1, std::string name2) _connection_state &= ~InputConnected; } } else if (no == name1 || no == name2) { - DEBUG_TRACE (DEBUG::FaderPort8, string_compose ("Connection notify %1 and %2\n", name1, name2)); + DEBUG_TRACE (DEBUG::FaderPort8, string_compose ("Connection notify outputs '%1' and '%2'\n", name1, name2)); if (_output_port->connected ()) { if (_connection_state & OutputConnected) { return false; @@ -486,7 +486,7 @@ FaderPort8::connection_handler (std::string name1, std::string name2) } } else { #ifdef VERBOSE_DEBUG - DEBUG_TRACE (DEBUG::FaderPort8, string_compose ("Connections between %1 and %2 changed, but I ignored it\n", name1, name2)); + DEBUG_TRACE (DEBUG::FaderPort8, string_compose ("Connections between '%1' and '%2' changed, but I ignored it\n", name1, name2)); #endif /* not our ports */ return false; From 0d4bce8663caf94dc78c0f3820ea27927c07040c Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Sun, 28 Jul 2024 00:58:11 +0200 Subject: [PATCH 24/33] backends: Fix class name in debug and error messages for set_latency_range and get_latency_range traces --- libs/backends/alsa/alsa_audiobackend.cc | 4 ++-- libs/backends/coreaudio/coreaudio_backend.cc | 4 ++-- libs/backends/dummy/dummy_audiobackend.cc | 4 ++-- libs/backends/portaudio/portaudio_backend.cc | 4 ++-- libs/backends/pulseaudio/pulseaudio_backend.cc | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libs/backends/alsa/alsa_audiobackend.cc b/libs/backends/alsa/alsa_audiobackend.cc index d81fbab9ee..55432e5857 100644 --- a/libs/backends/alsa/alsa_audiobackend.cc +++ b/libs/backends/alsa/alsa_audiobackend.cc @@ -1666,7 +1666,7 @@ AlsaAudioBackend::set_latency_range (PortEngine::PortHandle port_handle, bool fo { BackendPortPtr port = std::dynamic_pointer_cast (port_handle); if (!valid_port (port)) { - DEBUG_TRACE (PBD::DEBUG::BackendPorts, "AlsaPort::set_latency_range (): invalid port."); + DEBUG_TRACE (PBD::DEBUG::BackendPorts, "AlsaAudioBackend::set_latency_range (): invalid port."); return; } port->set_latency_range (latency_range, for_playback); @@ -1679,7 +1679,7 @@ AlsaAudioBackend::get_latency_range (PortEngine::PortHandle port_handle, bool fo LatencyRange r; if (!valid_port (port)) { - DEBUG_TRACE (PBD::DEBUG::BackendPorts, "AlsaPort::get_latency_range (): invalid port."); + DEBUG_TRACE (PBD::DEBUG::BackendPorts, "AlsaAudioBackend::get_latency_range (): invalid port."); r.min = 0; r.max = 0; return r; diff --git a/libs/backends/coreaudio/coreaudio_backend.cc b/libs/backends/coreaudio/coreaudio_backend.cc index f9c245c6be..d939bd97eb 100644 --- a/libs/backends/coreaudio/coreaudio_backend.cc +++ b/libs/backends/coreaudio/coreaudio_backend.cc @@ -1158,7 +1158,7 @@ CoreAudioBackend::set_latency_range (PortEngine::PortHandle port_handle, bool fo { std::shared_ptr port = std::dynamic_pointer_cast (port_handle); if (!valid_port (port)) { - DEBUG_TRACE (PBD::DEBUG::BackendPorts, "BackendPort::set_latency_range (): invalid port."); + DEBUG_TRACE (PBD::DEBUG::BackendPorts, "CoreAudioBackend::set_latency_range (): invalid port."); return; } port->set_latency_range (latency_range, for_playback); @@ -1170,7 +1170,7 @@ CoreAudioBackend::get_latency_range (PortEngine::PortHandle port_handle, bool fo std::shared_ptr port = std::dynamic_pointer_cast (port_handle); LatencyRange r; if (!valid_port (port)) { - DEBUG_TRACE (PBD::DEBUG::BackendPorts, "BackendPort::get_latency_range (): invalid port."); + DEBUG_TRACE (PBD::DEBUG::BackendPorts, "CoreAudioBackend::get_latency_range (): invalid port."); r.min = 0; r.max = 0; return r; diff --git a/libs/backends/dummy/dummy_audiobackend.cc b/libs/backends/dummy/dummy_audiobackend.cc index ae1e8edbe5..9c6f961e96 100644 --- a/libs/backends/dummy/dummy_audiobackend.cc +++ b/libs/backends/dummy/dummy_audiobackend.cc @@ -846,7 +846,7 @@ DummyAudioBackend::set_latency_range (PortEngine::PortHandle port_handle, bool f { BackendPortPtr port = std::dynamic_pointer_cast (port_handle); if (!valid_port (port)) { - DEBUG_TRACE (PBD::DEBUG::BackendPorts, "DummyPort::set_latency_range (): invalid port."); + DEBUG_TRACE (PBD::DEBUG::BackendPorts, "DummyAudioBackend::set_latency_range (): invalid port."); return; } port->set_latency_range (latency_range, for_playback); @@ -858,7 +858,7 @@ DummyAudioBackend::get_latency_range (PortEngine::PortHandle port_handle, bool f LatencyRange r; BackendPortPtr port = std::dynamic_pointer_cast (port_handle); if (!valid_port (port)) { - DEBUG_TRACE (PBD::DEBUG::BackendPorts, "DummyPort::get_latency_range (): invalid port."); + DEBUG_TRACE (PBD::DEBUG::BackendPorts, "DummyAudioBackend::get_latency_range (): invalid port."); r.min = 0; r.max = 0; return r; diff --git a/libs/backends/portaudio/portaudio_backend.cc b/libs/backends/portaudio/portaudio_backend.cc index 66c6d56f45..5bc0a9cace 100644 --- a/libs/backends/portaudio/portaudio_backend.cc +++ b/libs/backends/portaudio/portaudio_backend.cc @@ -1428,7 +1428,7 @@ PortAudioBackend::set_latency_range (PortEngine::PortHandle port_handle, bool fo { std::shared_ptr port = std::dynamic_pointer_cast(port_handle); if (!valid_port (port)) { - DEBUG_PORTS("BackendPort::set_latency_range (): invalid port.\n"); + DEBUG_PORTS ("PortAudioBackend::set_latency_range (): invalid port.\n"); return; } port->set_latency_range (latency_range, for_playback); @@ -1440,7 +1440,7 @@ PortAudioBackend::get_latency_range (PortEngine::PortHandle port_handle, bool fo std::shared_ptr port = std::dynamic_pointer_cast(port_handle); LatencyRange r; if (!valid_port (port)) { - DEBUG_PORTS("BackendPort::get_latency_range (): invalid port.\n"); + DEBUG_PORTS ("PortAudioBackend::get_latency_range (): invalid port.\n"); r.min = 0; r.max = 0; return r; diff --git a/libs/backends/pulseaudio/pulseaudio_backend.cc b/libs/backends/pulseaudio/pulseaudio_backend.cc index 9d4ea88014..e6fd11b399 100644 --- a/libs/backends/pulseaudio/pulseaudio_backend.cc +++ b/libs/backends/pulseaudio/pulseaudio_backend.cc @@ -895,7 +895,7 @@ PulseAudioBackend::set_latency_range (PortEngine::PortHandle port_handle, bool f { BackendPortPtr port = std::dynamic_pointer_cast (port_handle); if (!valid_port (port)) { - PBD::error << _("PulsePort::set_latency_range (): invalid port.") << endmsg; + PBD::error << _("PulseAudioBackend::set_latency_range (): invalid port.") << endmsg; } port->set_latency_range (latency_range, for_playback); } @@ -907,7 +907,7 @@ PulseAudioBackend::get_latency_range (PortEngine::PortHandle port_handle, bool f LatencyRange r; if (!valid_port (port)) { - PBD::error << _("PulsePort::get_latency_range (): invalid port.") << endmsg; + PBD::error << _("PulseAudioBackend::get_latency_range (): invalid port.") << endmsg; r.min = 0; r.max = 0; return r; From 2d0f472af5ebe427526093d276788d7a1514254e Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 15 Oct 2024 00:57:10 +0200 Subject: [PATCH 25/33] Consolidate macOS version parser --- wscript | 109 +++++++++++++++++++++++--------------------------------- 1 file changed, 44 insertions(+), 65 deletions(-) diff --git a/wscript b/wscript index 2ea20126ec..bda5222227 100644 --- a/wscript +++ b/wscript @@ -195,6 +195,48 @@ def fetch_tarball_revision_date(): return rev, date +def parse_macos_version(version): + # The [.] matches to the dot after the major version, "." would match any character + if re.search ("^[0-7][.]", version) is not None: + return 'panther' + elif re.search ("^8[.]", version) is not None: + return 'tiger' + elif re.search ("^9[.]", version) is not None: + return 'leopard' + elif re.search ("^10[.]", version) is not None: + return 'snowleopard' + elif re.search ("^11[.]", version) is not None: + return 'lion' + elif re.search ("^12[.]", version) is not None: + return 'mountainlion' + elif re.search ("^13[.]", version) is not None: + return 'mavericks' + elif re.search ("^14[.]", version) is not None: + return 'yosemite' + elif re.search ("^15[.]", version) is not None: + return 'el_capitan' + elif re.search ("^16[.]", version) is not None: + return 'sierra' + elif re.search ("^17[.]", version) is not None: + return 'high_sierra' + elif re.search ("^18[.]", version) is not None: + return 'mojave' + elif re.search ("^19[.]", version) is not None: + return 'catalina' + elif re.search ("^20[.]", version) is not None: + return 'bigsur' + elif re.search ("^21[.]", version) is not None: + return 'monterey' + elif re.search ("^22[.]", version) is not None: + return 'ventura' + elif re.search ("^23[.]", version) is not None: + return 'sonoma' + elif re.search ("^24[.]", version) is not None: + return 'sequoia' + else: + return 'sequoia' + + def set_version (from_file = False): def sanitize(s): # round-trip to remove anything in the string that is not encodable in @@ -470,75 +512,12 @@ int main() { return 0; }''', # OSX if platform == 'darwin': - if re.search ("^13[.]", version) is not None: - conf.env['build_host'] = 'mavericks' - elif re.search ("^14[.]", version) is not None: - conf.env['build_host'] = 'yosemite' - elif re.search ("^15[.]", version) is not None: - conf.env['build_host'] = 'el_capitan' - elif re.search ("^16[.]", version) is not None: - conf.env['build_host'] = 'sierra' - elif re.search ("^17[.]", version) is not None: - conf.env['build_host'] = 'high_sierra' - elif re.search ("^18[.]", version) is not None: - conf.env['build_host'] = 'mojave' - elif re.search ("^19[.]", version) is not None: - conf.env['build_host'] = 'catalina' - elif re.search ("^20[.]", version) is not None: - conf.env['build_host'] = 'bigsur' - elif re.search ("^21[.]", version) is not None: - conf.env['build_host'] = 'monterey' - elif re.search ("^22[.]", version) is not None: - conf.env['build_host'] = 'ventura' - elif re.search ("^23[.]", version) is not None: - conf.env['build_host'] = 'sonoma' - elif re.search ("^24[.]", version) is not None: - conf.env['build_host'] = 'sequoia' - else: - conf.env['build_host'] = 'irrelevant' + conf.env['build_host'] = parse_macos_version (version) # Autodetect if opt.dist_target == 'auto': if platform == 'darwin': - # The [.] matches to the dot after the major version, "." would match any character - if re.search ("^[0-7][.]", version) is not None: - conf.env['build_target'] = 'panther' - elif re.search ("^8[.]", version) is not None: - conf.env['build_target'] = 'tiger' - elif re.search ("^9[.]", version) is not None: - conf.env['build_target'] = 'leopard' - elif re.search ("^10[.]", version) is not None: - conf.env['build_target'] = 'snowleopard' - elif re.search ("^11[.]", version) is not None: - conf.env['build_target'] = 'lion' - elif re.search ("^12[.]", version) is not None: - conf.env['build_target'] = 'mountainlion' - elif re.search ("^13[.]", version) is not None: - conf.env['build_target'] = 'mavericks' - elif re.search ("^14[.]", version) is not None: - conf.env['build_target'] = 'yosemite' - elif re.search ("^15[.]", version) is not None: - conf.env['build_target'] = 'el_capitan' - elif re.search ("^16[.]", version) is not None: - conf.env['build_target'] = 'sierra' - elif re.search ("^17[.]", version) is not None: - conf.env['build_target'] = 'high_sierra' - elif re.search ("^18[.]", version) is not None: - conf.env['build_target'] = 'mojave' - elif re.search ("^19[.]", version) is not None: - conf.env['build_target'] = 'catalina' - elif re.search ("^20[.]", version) is not None: - conf.env['build_target'] = 'bigsur' - elif re.search ("^21[.]", version) is not None: - conf.env['build_target'] = 'monterey' - elif re.search ("^22[.]", version) is not None: - conf.env['build_target'] = 'ventura' - elif re.search ("^23[.]", version) is not None: - conf.env['build_target'] = 'sonoma' - elif re.search ("^24[.]", version) is not None: - conf.env['build_target'] = 'sequoia' - else: - conf.env['build_target'] = 'catalina' + conf.env['build_target'] = parse_macos_version (version) else: match = re.search( "(?Pi[0-6]86|x86_64|powerpc|ppc|ppc64|arm|s390x?)", From cab7fdf3d069fe4ae335723aa013e2be709c27b1 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 15 Oct 2024 09:36:35 -0600 Subject: [PATCH 26/33] when d-n-d'ing SMF, use file & track name for the new sources and regions --- gtk2_ardour/editor_canvas.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index f873b00ddf..398f5d96f7 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -442,11 +442,11 @@ Editor::drop_paths_part_two (const vector& paths, timepos_t const & p, d /* drop onto canvas background: create new tracks */ InstrumentSelector is(InstrumentSelector::ForTrackDefault); // instantiation builds instrument-list and sets default. - do_import (midi_paths, Editing::ImportDistinctFiles, ImportAsTrack, SrcBest, SMFTrackNumber, SMFTempoIgnore, pos, is.selected_instrument()); + do_import (midi_paths, Editing::ImportDistinctFiles, ImportAsTrack, SrcBest, SMFFileAndTrackName, SMFTempoIgnore, pos, is.selected_instrument()); if (UIConfiguration::instance().get_only_copy_imported_files() || copy) { do_import (audio_paths, Editing::ImportDistinctFiles, Editing::ImportAsTrack, - SrcBest, SMFTrackName, SMFTempoIgnore, pos); + SrcBest, SMFFileAndTrackName, SMFTempoIgnore, pos); } else { do_embed (audio_paths, Editing::ImportDistinctFiles, ImportAsTrack, pos); } From 3221e9bc85f995db78e1923ce2bd0b494516b59a Mon Sep 17 00:00:00 2001 From: Alexandre Prokoudine Date: Wed, 16 Oct 2024 00:00:28 +0200 Subject: [PATCH 27/33] MIDI map for M-Audio Axiom 49 MkII by Francois-Xavier Thomas --- share/midi_maps/M-Audio_Axiom_49_mkII.map | 53 +++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 share/midi_maps/M-Audio_Axiom_49_mkII.map diff --git a/share/midi_maps/M-Audio_Axiom_49_mkII.map b/share/midi_maps/M-Audio_Axiom_49_mkII.map new file mode 100644 index 0000000000..03b8ba9498 --- /dev/null +++ b/share/midi_maps/M-Audio_Axiom_49_mkII.map @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 5c2e1bd8073b3904efdf30f47720facf98c8ff18 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 15 Oct 2024 21:06:15 -0600 Subject: [PATCH 28/33] fix another case where SMF are imported and named incorrectly --- gtk2_ardour/editor_canvas.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index 398f5d96f7..0ab7c0cd5b 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -457,11 +457,11 @@ Editor::drop_paths_part_two (const vector& paths, timepos_t const & p, d if (tv->track()) { do_import (midi_paths, Editing::ImportSerializeFiles, ImportToTrack, - SrcBest, SMFTrackNumber, SMFTempoIgnore, pos, std::shared_ptr(), tv->track ()); + SrcBest, SMFFileAndTrackName, SMFTempoIgnore, pos, std::shared_ptr(), tv->track ()); if (UIConfiguration::instance().get_only_copy_imported_files() || copy) { do_import (audio_paths, Editing::ImportSerializeFiles, Editing::ImportToTrack, - SrcBest, SMFTrackName, SMFTempoIgnore, pos, std::shared_ptr(), tv->track ()); + SrcBest, SMFFileAndTrackName, SMFTempoIgnore, pos, std::shared_ptr(), tv->track ()); } else { do_embed (audio_paths, Editing::ImportSerializeFiles, ImportToTrack, pos, std::shared_ptr(), tv->track ()); } From 614977191030a4cfe9f1f32876b90467e22544b3 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 15 Oct 2024 22:35:04 -0600 Subject: [PATCH 29/33] fix yet more cases where SMF are imported and named incorrectly --- gtk2_ardour/editor_sources.cc | 2 +- gtk2_ardour/export_dialog.cc | 2 +- gtk2_ardour/trigger_page.cc | 4 ++-- libs/ardour/triggerbox.cc | 2 +- share/scripts/s_import_files.lua | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gtk2_ardour/editor_sources.cc b/gtk2_ardour/editor_sources.cc index dfeebc1a86..3d6a38a8bb 100644 --- a/gtk2_ardour/editor_sources.cc +++ b/gtk2_ardour/editor_sources.cc @@ -294,7 +294,7 @@ EditorSources::drag_data_received (const RefPtr& context, if (UIConfiguration::instance ().get_only_copy_imported_files () || copy) { _editor->do_import (paths, Editing::ImportDistinctFiles, Editing::ImportAsRegion, - SrcBest, SMFTrackNumber, SMFTempoIgnore, pos); + SrcBest, SMFFileAndTrackName, SMFTempoIgnore, pos); } else { _editor->do_embed (paths, Editing::ImportDistinctFiles, Editing::ImportAsRegion, pos); } diff --git a/gtk2_ardour/export_dialog.cc b/gtk2_ardour/export_dialog.cc index ef466f4305..113a295da7 100644 --- a/gtk2_ardour/export_dialog.cc +++ b/gtk2_ardour/export_dialog.cc @@ -423,7 +423,7 @@ ExportDialog::show_progress () for (auto const& x : _files_to_reimport) { timepos_t pos (x.first); Editing::ImportDisposition disposition = Editing::ImportDistinctFiles; - editor.do_import (x.second, disposition, Editing::ImportAsTrack, SrcBest, SMFTrackNumber, SMFTempoIgnore, pos); + editor.do_import (x.second, disposition, Editing::ImportAsTrack, SrcBest, SMFFileAndTrackName, SMFTempoIgnore, pos); } } diff --git a/gtk2_ardour/trigger_page.cc b/gtk2_ardour/trigger_page.cc index db7ba152de..4857ce89a9 100644 --- a/gtk2_ardour/trigger_page.cc +++ b/gtk2_ardour/trigger_page.cc @@ -730,8 +730,8 @@ TriggerPage::drop_paths_part_two (std::vector paths) } timepos_t pos (0); Editing::ImportDisposition disposition = Editing::ImportSerializeFiles; // or Editing::ImportDistinctFiles // TODO use drop modifier? config? - PublicEditor::instance().do_import (midi_paths, disposition, Editing::ImportAsTrigger, SrcBest, SMFTrackNumber, SMFTempoIgnore, pos, _trigger_clip_picker.instrument_plugin ()); - PublicEditor::instance().do_import (audio_paths, disposition, Editing::ImportAsTrigger, SrcBest, SMFTrackNumber, SMFTempoIgnore, pos); + PublicEditor::instance().do_import (midi_paths, disposition, Editing::ImportAsTrigger, SrcBest, SMFFileAndTrackName, SMFTempoIgnore, pos, _trigger_clip_picker.instrument_plugin ()); + PublicEditor::instance().do_import (audio_paths, disposition, Editing::ImportAsTrigger, SrcBest, SMFFileAndTrackName, SMFTempoIgnore, pos); } bool diff --git a/libs/ardour/triggerbox.cc b/libs/ardour/triggerbox.cc index 7656be5a2f..12695e9241 100644 --- a/libs/ardour/triggerbox.cc +++ b/libs/ardour/triggerbox.cc @@ -3644,7 +3644,7 @@ TriggerBox::set_from_path (uint32_t slot, std::string const & path) status.replace_existing_source = false; status.split_midi_channels = false; status.import_markers = false; - status.midi_track_name_source = ARDOUR::SMFTrackNumber; + status.midi_track_name_source = ARDOUR::SMFFileAndTrackName; _session.import_files (status); diff --git a/share/scripts/s_import_files.lua b/share/scripts/s_import_files.lua index 2a2ce4f797..a402ea0809 100644 --- a/share/scripts/s_import_files.lua +++ b/share/scripts/s_import_files.lua @@ -8,7 +8,7 @@ function factory (params) return function () local pos = Temporal.timepos_t(0) Editor:do_import (files, Editing.ImportDistinctFiles, Editing.ImportAsTrack, ARDOUR.SrcQuality.SrcBest, - ARDOUR.MidiTrackNameSource.SMFTrackName, ARDOUR.MidiTempoMapDisposition.SMFTempoIgnore, + ARDOUR.MidiTrackNameSource.SMFFileAndTrackName, ARDOUR.MidiTempoMapDisposition.SMFTempoIgnore, pos, ARDOUR.PluginInfo(), ARDOUR.Track(), false) end end From d525f8d60ce6cc2968206c10997917f4203080f5 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 16 Oct 2024 18:29:37 +0200 Subject: [PATCH 30/33] Only enable RegionFX in debug builds for the time being This reverts commit 14ff2f2e68e8a1e45ba80b16674edccffc6438c2. --- gtk2_ardour/audio_region_editor.cc | 2 ++ gtk2_ardour/region_editor.cc | 4 ++++ libs/ardour/luabindings.cc | 2 ++ 3 files changed, 8 insertions(+) diff --git a/gtk2_ardour/audio_region_editor.cc b/gtk2_ardour/audio_region_editor.cc index d8bb8e8af8..3f3d487876 100644 --- a/gtk2_ardour/audio_region_editor.cc +++ b/gtk2_ardour/audio_region_editor.cc @@ -98,6 +98,7 @@ AudioRegionEditor::AudioRegionEditor (Session* s, AudioRegionView* arv) _table.attach (_fade_before_fx_toggle, 2, 3, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); ++_table_row; +#ifndef NDEBUG // disable region Fx for now _region_line_label.set_name ("AudioRegionEditorLabel"); _region_line_label.set_text (_("Region Line:")); _region_line_label.set_alignment (1, 0.5); @@ -105,6 +106,7 @@ AudioRegionEditor::AudioRegionEditor (Session* s, AudioRegionView* arv) _table.attach (_region_line, 1, 2, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); _table.attach (_show_on_touch, 2, 3, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); ++_table_row; +#endif UI::instance()->set_tip (_polarity_toggle, _("Invert the signal polarity (180deg phase shift)")); UI::instance()->set_tip (_fade_before_fx_toggle, _("Apply region effects after the region fade.\nThis is useful if the effect(s) have tail, which would otherwise be faded out by the region fade (e.g. reverb, delay)")); diff --git a/gtk2_ardour/region_editor.cc b/gtk2_ardour/region_editor.cc index af85c7f562..a12e2cdd69 100644 --- a/gtk2_ardour/region_editor.cc +++ b/gtk2_ardour/region_editor.cc @@ -187,8 +187,10 @@ RegionEditor::RegionEditor (Session* s, RegionView* rv) _table.attach (_sources, 1, 2, _table_row, _table_row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL); ++_table_row; +#ifndef NDEBUG // disable region FX for now _table.attach (region_fx_label, 2, 3, 0, 1, Gtk::FILL, Gtk::FILL); _table.attach (_region_fx_box, 2, 3, 1, _table_row + 2, Gtk::FILL, Gtk::FILL); +#endif get_vbox()->pack_start (_table, true, true); @@ -230,11 +232,13 @@ RegionEditor::RegionEditor (Session* s, RegionView* rv) spin_arrow_grab = false; +#ifndef NDEBUG // disable region FX for now /* for now only audio region effects are supported */ if (std::dynamic_pointer_cast (_region)) { region_fx_label.show (); _region_fx_box.show (); } +#endif connect_editor_events (); } diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc index 5595f018d8..5a6dc3b772 100644 --- a/libs/ardour/luabindings.cc +++ b/libs/ardour/luabindings.cc @@ -1654,10 +1654,12 @@ LuaBindings::common (lua_State* L) .addFunction ("has_transients", &Region::has_transients) .addFunction ("transients", (AnalysisFeatureList (Region::*)())&Region::transients) +#ifndef NDEBUG // disable region FX for now .addFunction ("load_plugin", &Region::load_plugin) .addFunction ("add_plugin", &Region::add_plugin) .addFunction ("remove_plugin", &Region::add_plugin) .addFunction ("nth_plugin", &Region::nth_plugin) +#endif /* editing operations */ .addFunction ("set_length", &Region::set_length) From 0a0848b2d61105ae27c8713d06e782bee34f2778 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 16 Oct 2024 20:20:50 +0200 Subject: [PATCH 31/33] Set LiveTrax binary name when packaging --- tools/linux_packaging/build | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/linux_packaging/build b/tools/linux_packaging/build index 16e7771214..2e1e15a9ac 100755 --- a/tools/linux_packaging/build +++ b/tools/linux_packaging/build @@ -76,6 +76,7 @@ while [ $# -gt 0 ] ; do STRIP=all ; WITH_NLS=1 ; APPNAME=LiveTrax ; + EXENAME=LiveTrax ; shift ;; --vbm) VBM=1 From b6cb7583579b0c7ea8208332cb43ca0907836204 Mon Sep 17 00:00:00 2001 From: John Emmas Date: Thu, 17 Oct 2024 12:07:05 +0100 Subject: [PATCH 32/33] Another minor tweak to fix a build issue with MSVC/c++17 Fixes a conflict between 'std::byte' (new in c++17) and earlier declarations / typedef's that defined 'byte' --- libs/fst/vst3-scanner.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/fst/vst3-scanner.cc b/libs/fst/vst3-scanner.cc index 34e8faa3a6..017cc3a9c4 100644 --- a/libs/fst/vst3-scanner.cc +++ b/libs/fst/vst3-scanner.cc @@ -23,6 +23,7 @@ #include #ifdef PLATFORM_WINDOWS +#include #include #else #include From 0986b8d1e83c7da985c023375b266f7930985e42 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 17 Oct 2024 15:36:29 +0200 Subject: [PATCH 33/33] Revert "Only enable RegionFX in debug builds for the time being" This reverts commit d525f8d60ce6cc2968206c10997917f4203080f5. --- gtk2_ardour/audio_region_editor.cc | 2 -- gtk2_ardour/region_editor.cc | 4 ---- libs/ardour/luabindings.cc | 2 -- 3 files changed, 8 deletions(-) diff --git a/gtk2_ardour/audio_region_editor.cc b/gtk2_ardour/audio_region_editor.cc index 3f3d487876..d8bb8e8af8 100644 --- a/gtk2_ardour/audio_region_editor.cc +++ b/gtk2_ardour/audio_region_editor.cc @@ -98,7 +98,6 @@ AudioRegionEditor::AudioRegionEditor (Session* s, AudioRegionView* arv) _table.attach (_fade_before_fx_toggle, 2, 3, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); ++_table_row; -#ifndef NDEBUG // disable region Fx for now _region_line_label.set_name ("AudioRegionEditorLabel"); _region_line_label.set_text (_("Region Line:")); _region_line_label.set_alignment (1, 0.5); @@ -106,7 +105,6 @@ AudioRegionEditor::AudioRegionEditor (Session* s, AudioRegionView* arv) _table.attach (_region_line, 1, 2, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); _table.attach (_show_on_touch, 2, 3, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); ++_table_row; -#endif UI::instance()->set_tip (_polarity_toggle, _("Invert the signal polarity (180deg phase shift)")); UI::instance()->set_tip (_fade_before_fx_toggle, _("Apply region effects after the region fade.\nThis is useful if the effect(s) have tail, which would otherwise be faded out by the region fade (e.g. reverb, delay)")); diff --git a/gtk2_ardour/region_editor.cc b/gtk2_ardour/region_editor.cc index a12e2cdd69..af85c7f562 100644 --- a/gtk2_ardour/region_editor.cc +++ b/gtk2_ardour/region_editor.cc @@ -187,10 +187,8 @@ RegionEditor::RegionEditor (Session* s, RegionView* rv) _table.attach (_sources, 1, 2, _table_row, _table_row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL); ++_table_row; -#ifndef NDEBUG // disable region FX for now _table.attach (region_fx_label, 2, 3, 0, 1, Gtk::FILL, Gtk::FILL); _table.attach (_region_fx_box, 2, 3, 1, _table_row + 2, Gtk::FILL, Gtk::FILL); -#endif get_vbox()->pack_start (_table, true, true); @@ -232,13 +230,11 @@ RegionEditor::RegionEditor (Session* s, RegionView* rv) spin_arrow_grab = false; -#ifndef NDEBUG // disable region FX for now /* for now only audio region effects are supported */ if (std::dynamic_pointer_cast (_region)) { region_fx_label.show (); _region_fx_box.show (); } -#endif connect_editor_events (); } diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc index 5a6dc3b772..5595f018d8 100644 --- a/libs/ardour/luabindings.cc +++ b/libs/ardour/luabindings.cc @@ -1654,12 +1654,10 @@ LuaBindings::common (lua_State* L) .addFunction ("has_transients", &Region::has_transients) .addFunction ("transients", (AnalysisFeatureList (Region::*)())&Region::transients) -#ifndef NDEBUG // disable region FX for now .addFunction ("load_plugin", &Region::load_plugin) .addFunction ("add_plugin", &Region::add_plugin) .addFunction ("remove_plugin", &Region::add_plugin) .addFunction ("nth_plugin", &Region::nth_plugin) -#endif /* editing operations */ .addFunction ("set_length", &Region::set_length)