Commit graph

15600 commits

Author SHA1 Message Date
Robin Gareus
4eba86b503
Fix libwebsockets compat
LWS_CALLBACK_HTTP_CONFIRM_UPGRADE is only available since v3.1.0
2020-02-27 23:58:00 +01:00
Robin Gareus
0b027f7678
Fix removal of punch range
set_auto_punch_location() is a NO-OP when there's no punch range.
This disconnects `punch_connections`, clears session-events,
and emits auto_punch_location_changed().
2020-02-27 22:23:59 +01:00
Robin Gareus
08559abc10
Add signals to indicate Punch/Loop constraints
This is in preparation for GUI sensitivity of Loop and Punch actions.
2020-02-27 22:16:12 +01:00
Luciano Iam
ef512d412d
Avoid occasional response delay when handling HTTP in the websockets surface 2020-02-27 03:42:54 +01:00
Luciano Iam
0921cf8939
Make previous commit 81ecc2b compatible with libwebsockets==2 2020-02-27 03:42:54 +01:00
Luciano Iam
ec8e0f8ee5
Gracefully reject HTTP requests reaching the websockets surface 2020-02-27 03:42:54 +01:00
Robin Gareus
bc2cbfc7ec
Prevent concurrent loop and punch recording (backend)
This also prevents switching between punch-in/out record
and looping without transport-stop.
2020-02-27 02:36:16 +01:00
R
8702ff2189
Add support for Lua DSP scripts with multiple MIDI outputs 2020-02-26 20:28:54 +01:00
Robin Gareus
c3fe0cd95e
Consolidate loop en/disable calls 2020-02-26 20:15:00 +01:00
Robin Gareus
d27cdb3855
Fix DSP::process_map() plugin-pin I/O map handing
The previous approach failed in case where PluginInsert
uses no-inplace buffers with a linear map.
Since buffers are replicated up to a total of number of
all (inputs + outputs), the number of output buffers
could not be determined. There was insufficient information
using the I/O map alone.

With a known number of outputs processing and applying
the i/o map is also a lot easier and faster.

This break the API of process_map().
2020-02-26 17:50:08 +01:00
Robin Gareus
a5c956883d
Add Lua bindings for libardour amp's simple gain 2020-02-26 17:49:54 +01:00
Robin Gareus
f372cc0bf2
Fix PI bypass, fix apply linear pin-connections
Previously this could assert(), copying a buffer to itself.
2020-02-26 17:49:01 +01:00
Robin Gareus
35605ee763
Remove easter-egg
Every day can be x-mas day, how else can we be lovers? :)
2020-02-26 04:03:10 +01:00
Robin Gareus
69059d7b1b
Fix Conditional jump or move depends on uninitialised value(s)
(valgrind trace, line-numbers from mixbus+6.0-190-g0ec6bc35a)
This may happen initially for unconnected graph nodes,
e.g. Foldback Busses from ARDOUR::Session::post_engine_init().

==29797== Conditional jump or move depends on uninitialised value(s)
==29797==    at 0x6167D3F: trace_terminal(boost::shared_ptr<ARDOUR::Route>, boost::shared_ptr<ARDOUR::Route>, bool) (session.cc:2174)
==29797==    by 0x6167D99: trace_terminal(boost::shared_ptr<ARDOUR::Route>, boost::shared_ptr<ARDOUR::Route>, bool) (session.cc:2174)
==29797==    by 0x6167D99: trace_terminal(boost::shared_ptr<ARDOUR::Route>, boost::shared_ptr<ARDOUR::Route>, bool) (session.cc:2174)
==29797==    by 0x616890D: ARDOUR::Session::resort_routes_using(boost::shared_ptr<std::__cxx11::list<boost::shared_ptr<ARDOUR::Route>, std::allocator<boost::shared_ptr<ARDOUR::Route> > > >) (session.cc:2289)
2020-02-26 01:44:23 +01:00
Robin Gareus
98d7d04ae7
Fix potential memory corruption at session close
(valgrind trace, line-numbers from mixbus+6.0-190-g0ec6bc35a)
==29797== Invalid write of size 4
==29797==    at 0x619BB3F: boost::dynamic_bitset<unsigned int, std::allocator<unsigned int> >::reference::do_reset() (dynamic_bitset.hpp:120)
==29797==    by 0x6196002: boost::dynamic_bitset<unsigned int, std::allocator<unsigned int> >::reference::do_assign(bool) (dynamic_bitset.hpp:122)
==29797==    by 0x618F670: boost::dynamic_bitset<unsigned int, std::allocator<unsigned int> >::reference::operator=(bool) (dynamic_bitset.hpp:107)
==29797==    by 0x617E426: ARDOUR::Session::unmark_send_id(unsigned int) (session.cc:5633)
==29797==    by 0x6156714: ARDOUR::Send::~Send() (send.cc:125)
==29797==    by 0x5CE12A7: ARDOUR::InternalSend::~InternalSend() (internal_send.cc:71)
==29797==    by 0x5CE1319: ARDOUR::InternalSend::~InternalSend() (internal_send.cc:76)
==29797==    by 0x1556128: void boost::checked_delete<ARDOUR::InternalSend>(ARDOUR::InternalSend*) (checked_delete.hpp:34)
==29797==    by 0x155E689: boost::detail::sp_counted_impl_p<ARDOUR::InternalSend>::dispose() (sp_counted_impl.hpp:92)
==29797==    by 0xCC0E30: boost::detail::sp_counted_base::release() (sp_counted_base_std_atomic.hpp:110)
==29797==    by 0xCC0EA6: boost::detail::shared_count::~shared_count() (shared_count.hpp:426)
==29797==    by 0x134BD15: boost::shared_ptr<ARDOUR::InternalSend>::~shared_ptr() (shared_ptr.hpp:366)
==29797==    by 0x60FACC1: ARDOUR::Route::~Route() (route.cc:498)
==29797==    by 0x60FAF4D: ARDOUR::Route::~Route() (route.cc:517)
==29797==    by 0x166144C: void boost::checked_delete<ARDOUR::Route>(ARDOUR::Route*) (checked_delete.hpp:34)
==29797==    by 0x166338F: boost::detail::sp_counted_impl_p<ARDOUR::Route>::dispose() (sp_counted_impl.hpp:92)
==29797==    by 0xCC0E30: boost::detail::sp_counted_base::release() (sp_counted_base_std_atomic.hpp:110)
==29797==    by 0xCC0EA6: boost::detail::shared_count::~shared_count() (shared_count.hpp:426)
==29797==    by 0xCD2385: boost::shared_ptr<ARDOUR::Route>::~shared_ptr() (shared_ptr.hpp:366)
==29797==    by 0x615D0E5: ARDOUR::Session::~Session() (session.cc:455)
==29797==    by 0x615D4A3: ARDOUR::Session::~Session() (session.cc:461)
2020-02-26 01:35:50 +01:00
Robin Gareus
61b6b740bc
Fix deadlock, shared_ptr d'tor called from ScopedConnectionList d'tor
See https://ardour.org/styleguide.html #10
https://pastebin.com/gJfrNhL2
2020-02-25 22:55:59 +01:00
Robin Gareus
bcfe16610a
Consolidate shared-ptr debugging 2020-02-25 22:23:30 +01:00
Robin Gareus
9e6435ff14
Fix mem-leak, Playlist/Region SessionHandleRef
When a playlist is deleted and drops_references(), any
undo/redo StatefulDiffCommand referncing playlist invoke
Destructible::drop_references() of the Command.

This leads to command_death(). As opposed to UndoTransaction::clear()
the StatefulDiffCommand was not destroyed.

In case of playlists StatefulDiffCommand::_changes contains
PBD::SequenceProperty<std::list<boost::shared_ptr<Region> > >
and shared pointer reference of the playlist regions were kept
indefinitely.

This fixes the following scenario:
New session, import an file, delete the created track,
clean up unused sources (delete unused playlists)[, quit].

A reference to the imported region was kept, because of the
playlist's undo command (insert region). Yet the source file
was deleted.


PS. Most playlist changes are accompanied by GUI zoom/selection
MementoCommands. Those are currently never directly dropped.
command_death() leaves those in place.
2020-02-25 21:45:07 +01:00
Robin Gareus
aa3f7f2414
Remove undo function from global namespace 2020-02-25 20:09:47 +01:00
Robin Gareus
7532571fb2
NO-OP: whitespace 2020-02-25 17:55:51 +01:00
Robin Gareus
e926a580a9
Disable Transport Master boost debug 2020-02-25 16:17:00 +01:00
Robin Gareus
53a6b3e28d
Fix cleanup, lock source-list, emit SourceRemoved
This fixes various cases where SessionHandleRef shared_ptr<>
were kept when sources were removed.
2020-02-25 16:17:00 +01:00
Robin Gareus
28c141d450
Remove history file when it's empty
Various operations clear the history (e.g. cleanup). In that
case the GUI correctly had an empty Undo/Redo history, but the
file on disk was left in place.

Next session load restored the old, incorrect Undo/Redo history.
2020-02-25 16:17:00 +01:00
Robin Gareus
3aaaa7e459
Update region-factory boost-debug 2020-02-25 16:17:00 +01:00
Robin Gareus
fc91c217d1
Notify owners when removing regions during cleanup
Previously the region was only removed from the Session's
region_map without sending notifications.
2020-02-25 16:16:59 +01:00
Robin Gareus
8e1a2d7caa
Prefer const iterators 2020-02-25 16:16:59 +01:00
Paul Davis
7e4728027c fix thinko when handling set_speed (0.0)
Code only handled a reversing->rolling path, not reversing->stopped
2020-02-24 20:06:43 -07:00
Paul Davis
4749fcef86 fix incorrect handling of MIDI data by AsyncMIDIPort
This type of MIDI port fetches all of its data from inside ::cycle_start(),
and delivers it to a FIFO connected to another thread (typically a
control surface).

Unlike regular MidiPorts, which will be read from inside a Session::process()
call, these ports will read their data once per AudioEngine::process() cycle.
They therefore cannot use MidiPort::get_midi_buffer() which scales and adjusts
event timestamps as if the data is being accessed from within Session::process().

It is still an open question whether or not AsyncMIDIPort::cycle_start() should
still scale event timestamps by speed. In some respects it seems more appropriate
to do so, and the reading thread (e.g. a control surface) doesn't care about
the "nframes" limit on timestamps that exists for calls within a Session::process()
tree. For now, leave the timestamps unscaled by speed.
2020-02-24 18:44:58 -07:00
Paul Davis
42c13607a2 NOOP: remove whitespace 2020-02-24 18:44:58 -07:00
Robin Gareus
89e5954953
Add a method to clear ImportStatus arrays
This is in preparation to fix a
 "SessionHandleRef exists across session deletion"
error.
2020-02-25 02:35:36 +01:00
Robin Gareus
f845bef8c6
Update source-factory boost-debug 2020-02-25 02:34:04 +01:00
André Nusser
0a1ed004f2
Remove unused forward declaration. 2020-02-24 23:01:15 +01:00
Robin Gareus
021ff2044a
Zero x-run count after session-load and engine restart 2020-02-24 22:21:18 +01:00
Robin Gareus
f16d97a013
Consolidate startup state = Clean; calls
This also emits DirtyChanged() only if needed.
2020-02-24 22:16:56 +01:00
Robin Gareus
1074c16299
Websockets: error on unhandled callbacks
This prevents unhandled http request from hogging the backend.
2020-02-24 22:06:15 +01:00
Robin Gareus
bd00db9e8b
Websockets: use established NDEBUG - see assert(3) 2020-02-24 22:06:15 +01:00
Robin Gareus
17cd3853e0
Fix initial audible noise on muted or silenced tracks
When loading a session with muted tracks, those tracks were
not initially muted, but ardour only faded them out.
The same happened to sends, and also tracks with non unity fader:
an initial fade from unity to target gain was done.

Now this send and deliveries always fade-in (like default Amp does).
2020-02-24 22:06:15 +01:00
Todd Naugle
06d4dc0ede Fix uninitialized member variable. 2020-02-24 13:16:32 -06:00
Todd Naugle
ceea3e3311 NOP: No need to set this variable to itself. 2020-02-24 13:16:32 -06:00
Robin Gareus
4f8777e968
Tweak mach thread priority debug msg 2020-02-24 05:29:56 +01:00
Robin Gareus
e737a9b000 Fix setting CoreAudio RT-priority 2020-02-24 04:38:49 +01:00
Robin Gareus
a9c75f9760
Fix CoreAudio systemic latency, implement hw latency report 2020-02-24 04:24:50 +01:00
Robin Gareus
53a6c24147
Add API to query hardware latency (as reported by the driver)
So far only MacOS/X CoreAudio supports this. This is intended
for defualt values in case a user has not callibrated the device, yet.
2020-02-24 04:24:12 +01:00
Robin Gareus
bf649cd68a
Fix another websocket surface crash when no panner is available
This amends 224be91211
2020-02-23 19:12:26 +01:00
Robin Gareus
8b092f8658
Websockets: use unique header guards 2020-02-23 16:21:55 +01:00
Robin Gareus
5e3480ba8f
NO-OP: Re-indent websockets code
"Always use Tabstops for block-indent (the code must be
formatted correctly with "[TAB] = N spaces" for any value of N).
Use space only for alignment." - https://ardour.org/styleguide.html
2020-02-23 16:21:55 +01:00
Robin Gareus
224be91211
Fix websockets surface crash when panner is not available 2020-02-23 16:21:55 +01:00
Ben Loftis
3e77680a57 surfaces transport hotfix: surfaces should query the transport state via BasicUI, when possible 2020-02-23 09:02:25 -06:00
Ben Loftis
276baee8ad surfaces transport hotfix: BasicUI: prefer actual_speed() and transport_stopped_or_stopping() for current Transport FSM 2020-02-23 09:02:21 -06:00
Ben Loftis
8efb642c46 surfaces transport hotfix: actual_speed() is preferred over transport_speed() for current Transport FSM 2020-02-23 09:02:13 -06:00