Commit graph

68 commits

Author SHA1 Message Date
Robin Gareus
94a4f6b350
Implement restoring hardware<>hardware connections for internal backends 2025-10-06 19:47:30 +02:00
Robin Gareus
74c4ca3e52
Reduce reliance on boost - the hard part
the rest from `tools/convert_boost.sh`.

* replace boost::function, boost::bind with std::function and std::bind.

This required some manual fixes, notably std::placeholders,
some static_casts<>, and boost::function::clear -> = {}.
2024-10-19 03:47:21 +02:00
Robin Gareus
2d7cce44f1
Replace PBD::Signals (1/2) 2024-10-18 20:41:08 +02:00
Robin Gareus
ab0d2dce6f
Fix reduced channelcount when restarting engine with different device
1. Start engine with a stereo soundcard (n_inputs was set to 2)
2. Restart engine with multi-channel soundcard, n_inputs remained a 2)
2024-07-10 15:39:01 +02:00
Robin Gareus
d6b14e761b
Remove unused backend channel count config API 2024-07-10 15:39:01 +02:00
Paul Davis
39ed528e25 std-ize: convert all boost shared/weak ptr includes to <memory>
Also fix stdint.h -> cstdint and alphabetically order std includes
2023-03-24 14:19:15 -06:00
Robin Gareus
a7d2718aa4
ALSA: use dedicated device reservation for probing
It can happen that the main AlsaAudioBackend::_device_reservation
is still busy while I/O devices are set. In this case a
dedicated AlsaDeviceReservation needs to be used which can fail
silently.

A common example is disconnecting a USB device while it is in
use. The Halted signal can show the session dialog, which calls
set_input_device_name before the device reservation of the
unplugged device terminated.
2022-11-29 17:34:45 +01:00
Robin Gareus
a393f75694
Use shared port engine MIDI event compare operator 2021-11-30 19:41:39 +01:00
Robin Gareus
14961e6bc7
ALSA backend: code cleanup and scoping and indent
This is combination of clang-format and manual edits.
The latter mainly to add braces and reduce scope of variables.
2021-05-16 00:49:06 +02:00
Robin Gareus
a80064981e
NO-OP: Consolidate PortConnect code into shared parent class 2020-09-05 23:05:57 +02:00
Robin Gareus
92f54b3e98
Add API to query if systemic latency can be measured 2020-06-30 03:34:26 +02:00
Robin Gareus
47bb331bfa
Allow to refresh ALSA device list - #8051 2020-04-29 02:19:38 +02:00
Robin Gareus
8e482ef0fb
Con't work on ALSA nperiod selection (see also d3d120fa) 2020-04-28 17:56:17 +02:00
Robin Gareus
b943cec756
ALSA: allow to select different I/O devices
This adds a basic support to use multiple sound-cards, currently
limited to two devices: In/Out with shared settings.

Advanced setups still have to resort to using the ARDOUR_ALSA_EXT
environment variable
2020-04-10 05:01:33 +02:00
Paul Davis
b9cb306e8b use shared_ptr to manage backend port lifetimes (Pulse,ALSA,Dummy,JACK)
JACK is not yet finished.

Changes also include minor reformatting and a spelling correction (latecies to latencies)
2020-04-07 13:23:49 -06:00
Paul Davis
a31d3689bf tentative changes to extend port engine shared impl to coreaudio 2020-04-02 19:45:31 -06:00
Paul Davis
6c2e30b790 use new PortEngineSharedImpl in AlsaAudioBackend 2020-04-02 19:45:31 -06:00
Paul Davis
9ac0d5b60f add RCU to manage _ports and _portmap in AlsaAudioBackend
This is intended to prevent crashes when unregister_port() modifies the contents of these
two members at the same time that something else is iterating over them.
2020-04-02 19:45:31 -06:00
Robin Gareus
47a62b2850
Update backend GPL boilerplate and (C) from git log 2019-08-03 15:53:16 +02:00
Robin Gareus
8b71967be9
ALSA: add locks to safely add/remove MIDI devices
Theoretically this could be lock-free by using a queue of device
ports to be added/remove in sync in the process-callback, but
realistically adding/removing devices doesn't have to be rt-safe.
2019-01-14 22:33:31 +01:00
Robin Gareus
79e247e00a
Dynamic ALSA MIDI I/O device discovery and re/connect 2018-12-23 21:58:56 +01:00
Robin Gareus
217ef4d365
Use hash for ALSA-MIDI device name/ID 2018-12-23 21:58:55 +01:00
Robin Gareus
076e9fddd4
Remove ambiguous API implementation
* PortEngine::available() implementation
* AudioEngine::connected() wrapper

Eventually we may re-introduce PortEngine::available along
with a libardour internal port-engine.
2018-11-28 15:32:40 +01:00
Paul Davis
e047b01aa2 add new API for retrieving port flags from backend 2018-10-17 14:11:37 -04:00
Robin Gareus
ab3889fff8 Propagate Latency to backend/system ports
Set accumulated capture-latency for physical-outputs
and accumulated playback-latency for physical-inputs
after Ardour is done setting all non-physical port latencies.

This will be needed for latency-compensation of the complete graph.
2017-09-23 00:34:01 +02:00
Paul Davis
30b087ab3d globally change all use of "frame" to refer to audio into "sample".
Generated by tools/f2s. Some hand-editing will be required in a few places to fix up comments related to timecode
and video in order to keep the legible
2017-09-18 12:39:17 -04:00
Robin Gareus
8337982766 Prototype using additional ALSA devices (w/resampling). 2017-09-18 16:13:55 +02:00
Robin Gareus
128a985361 ALSA Backend: Separate Device Reservation into its own class 2017-09-18 14:50:31 +02:00
Robin Gareus
59a63a08f9 ALSA backend RT-safe MIDI buffer allocation 2017-08-05 15:36:36 +02:00
Robin Gareus
2b7c585dba Update backend API: read-only MIDI input buffers 2017-08-05 15:36:36 +02:00
Robin Gareus
335debfa2f Add API to enforce valid device selection. 2016-11-26 15:31:21 +01:00
Robin Gareus
8444837b71 properly sort port-names 2016-07-14 16:52:43 +02:00
Robin Gareus
ac923be7af fix port-sort order for good.
TODO find out how to make std::set::find() work with custom sort order,
as std::find may only be O(N) and not O(log (N)).
2016-07-08 21:37:42 +02:00
Robin Gareus
f84a7605d8 pre-sort port-names 2016-07-08 20:44:21 +02:00
Robin Gareus
800c8182c6 O(log(n)) port and connection lookup for ALSA 2016-04-24 20:45:37 +02:00
Robin Gareus
10140a8e68 implement pretty-name set-property for ALSA and Dummy 2016-04-17 18:22:21 +02:00
Robin Gareus
cf6a3afcaa name ALSA midi ports after device 2016-01-11 11:46:10 +01:00
Robin Gareus
bfd2cbaa3f ALSA: allow to dynamically add/remove midi devices & update their latency. 2015-12-04 22:19:47 +01:00
Robin Gareus
ac075560bd ALSA: allow to measure & set systemic audio latency w/o restart.
(MIDI needs a bit more work)
2015-12-04 17:45:49 +01:00
Robin Gareus
990fd75c5f implement ALSA period/cycle setting 2015-12-04 10:16:19 +01:00
Tim Mayberry
ccfe3e1015 Use ARDOUR::DSPLoadCalculator in ALSA Backend 2015-09-16 11:22:17 +10:00
Robin Gareus
548340eb05 remove -Woverload-virtual ambiguity (from 1d3690d)
this breaks compilation in engine_dialog.cc
2015-08-11 23:50:56 +02:00
Robin Gareus
a226c4ce38 ALSA backend: query and cache available device-parameters 2015-08-11 19:01:52 +02:00
Robin Gareus
dc2030cfd7 ALSA backend: add support for half-duplex devices 2015-06-14 22:26:06 +02:00
Robin Gareus
52e99750a0 ALSA: fix thinko in sample time calc. 2015-03-09 17:17:50 +01:00
Robin Gareus
659a8a26ae fix latency report, take buffersize changes into account. 2015-03-07 14:35:32 +01:00
Robin Gareus
782dd70875 alsa: implement timing callback 2015-03-05 01:59:59 +01:00
Paul Davis
582138f280 change Audio backend sample time methods to use a 64 bit timeline 2015-02-19 17:44:01 -05:00
Robin Gareus
db28eefc49 ALSA backend: synchronous switch to/from freewheeling 2015-01-24 23:39:41 +01:00
Robin Gareus
f499f4cfd2 don't take temporary copy of MIDI sequence
fixes potential boost shared_ptr double free.
2014-12-31 03:19:00 +01:00