20 #ifndef __libbackend_alsa_audiobackend_h__
21 #define __libbackend_alsa_audiobackend_h__
51 class AlsaAudioBackend;
196 int _start (
bool for_latency_measurement);
349 std::function<void ()>
f;
381 unsigned int master_rate,
382 unsigned int master_samples_per_period,
383 unsigned int slave_rate,
384 unsigned int slave_samples_per_period,
385 unsigned int periods_per_cycle);
409 unsigned int slave_rate,
410 unsigned int slave_spp,
411 unsigned int slave_ppc,
#define MaxAlsaMidiEventSize
std::vector< BackendPortPtr > inputs
PBD::ScopedConnection latency_connection
void update_latencies(uint32_t, uint32_t)
PBD::ScopedConnection _halted_connection
PBD::Signal< void()> UpdateLatency
AudioSlave(const char *device, DuplexMode duplex, unsigned int master_rate, unsigned int master_samples_per_period, unsigned int slave_rate, unsigned int slave_samples_per_period, unsigned int periods_per_cycle)
std::vector< BackendPortPtr > outputs
pframes_t samples_since_cycle_start()
ARDOUR::DSPLoadCalculator _dsp_load_calc
void * main_process_thread()
int set_port_property(PortEngine::PortHandle ph, const std::string &key, const std::string &value, const std::string &type)
uint32_t get_midi_event_count(void *port_buffer)
void auto_update_midi_devices()
ChanCount n_physical_outputs() const
int _start(bool for_latency_measurement)
std::vector< uint32_t > available_buffer_sizes2(const std::string &, const std::string &) const
LatencyRange get_latency_range(PortHandle, bool for_playback)
int disconnect(const std::string &src, const std::string &dst)
static size_t _max_buffer_size
uint32_t systemic_midi_output_latency(std::string const) const
uint32_t period_size() const
int set_systemic_midi_input_latency(std::string const, uint32_t)
bool connected(PortEngine::PortHandle ph, bool process_callback_safe)
uint32_t systemic_output_latency() const
int set_output_device_name(const std::string &)
bool _midi_device_thread_active
std::vector< uint32_t > available_buffer_sizes(const std::string &device) const
bool can_change_buffer_size_when_running() const
uint32_t buffer_size() const
void stop_listen_for_midi_device_changes()
void get_physical_inputs(DataType type, std::vector< std::string > &results)
int ensure_input_monitoring(PortHandle, bool)
std::vector< DeviceStatus > enumerate_midi_devices() const
void * private_handle() const
void set_latency_range(PortHandle, bool for_playback, LatencyRange)
void unregister_port(PortHandle ph)
size_t _samples_per_period
int set_midi_device_enabled(std::string const, bool)
static void * alsa_process_thread(void *)
std::string device_name() const
std::string control_app_name() const
bool monitoring_input(PortHandle)
std::string _instance_name
int register_system_audio_ports()
int connect(const std::string &src, const std::string &dst)
int register_system_midi_ports(const std::string device="")
std::vector< DeviceStatus > enumerate_devices() const
uint32_t systemic_midi_input_latency(std::string const) const
void midi_clear(void *port_buffer)
std::string input_device_name() const
static std::vector< AudioBackend::DeviceStatus > _duplex_audio_device_status
std::vector< float > available_sample_rates(const std::string &device) const
pthread_mutex_t _device_port_mutex
uint32_t process_thread_count()
std::vector< pthread_t > _threads
int set_midi_option(const std::string &)
int set_peridod_size(uint32_t)
void update_system_port_latencies()
int join_process_threads()
bool can_change_sample_rate_when_running() const
int request_input_monitoring(PortHandle, bool)
int midi_event_get(pframes_t ×tamp, size_t &size, uint8_t const **buf, void *port_buffer, uint32_t event_index)
AlsaDeviceReservation _device_reservation
float sample_rate() const
int set_device_name(const std::string &)
std::vector< AudioSlave * > AudioSlaves
static std::vector< AudioBackend::DeviceStatus > _input_audio_device_status
samplepos_t sample_time()
struct AlsaMidiDeviceInfo * midi_device_info(std::string const) const
bool can_request_update_devices()
std::vector< uint32_t > available_period_sizes(const std::string &driver, const std::string &device) const
void midi_device_thread()
int set_port_name(PortEngine::PortHandle ph, const std::string &name)
size_t raw_buffer_size(DataType t)
std::string _midi_driver_option
uint32_t _systemic_audio_input_latency
uint32_t systemic_input_latency() const
int set_systemic_midi_output_latency(std::string const, uint32_t)
std::vector< DeviceStatus > enumerate_output_devices() const
int set_interleaved(bool yn)
static void * _midi_device_thread(void *arg)
static ARDOUR::ALSADeviceInfo _output_audio_device_info
uint32_t _systemic_audio_output_latency
uint64_t _last_process_start
bool port_is_physical(PortEngine::PortHandle ph) const
bool can_set_systemic_midi_latencies() const
std::vector< float > available_sample_rates2(const std::string &, const std::string &) const
bool match_input_output_devices_or_none() const
bool listen_for_midi_device_changes()
size_t _periods_per_cycle
int get_port_property(PortEngine::PortHandle ph, const std::string &key, std::string &value, std::string &type) const
bool can_change_systemic_latency_when_running() const
static ARDOUR::ALSADeviceInfo _input_audio_device_info
std::vector< std::string > enumerate_midi_options() const
bool midi_device_enabled(std::string const) const
static std::vector< std::string > _midi_options
void * get_buffer(PortHandle, pframes_t)
void launch_control_app()
int get_connections(PortEngine::PortHandle ph, std::vector< std::string > &results, bool process_callback_safe)
PortEngine::PortPtr get_port_by_name(std::string const &name) const
static std::vector< AudioBackend::DeviceStatus > _midi_device_status
std::vector< AlsaMidiOut * > _rmidi_out
uint32_t port_name_size() const
std::string midi_option() const
std::vector< AlsaMidiIn * > _rmidi_in
int set_buffer_size(uint32_t)
bool can_monitor_input() const
bool connected_to(PortEngine::PortHandle ph, const std::string &other, bool process_callback_safe)
BackendPort * port_factory(std::string const &name, ARDOUR::DataType dt, ARDOUR::PortFlags flags)
int set_sample_rate(float)
int connect(PortEngine::PortHandle ph, const std::string &other)
int create_process_thread(std::function< void()> func)
bool can_measure_systemic_latency() const
bool physically_connected(PortEngine::PortHandle ph, bool process_callback_safe)
int set_systemic_output_latency(uint32_t)
int get_ports(const std::string &port_name_pattern, DataType type, PortFlags flags, std::vector< std::string > &results) const
static std::vector< AudioBackend::DeviceStatus > _output_audio_device_status
void get_physical_outputs(DataType type, std::vector< std::string > &results)
std::map< std::string, struct AlsaMidiDeviceInfo * > _midi_devices
PortFlags get_port_flags(PortEngine::PortHandle ph) const
PortEngine::PortPtr register_port(const std::string &shortname, ARDOUR::DataType type, ARDOUR::PortFlags flags)
DataType port_data_type(PortEngine::PortHandle ph) const
int set_systemic_input_latency(uint32_t)
pthread_t _midi_device_thread_id
ChanCount n_physical_inputs() const
int disconnect_all(PortEngine::PortHandle ph)
void update_systemic_midi_latencies()
bool add_slave(const char *slave_device, unsigned int slave_rate, unsigned int slave_spp, unsigned int slave_ppc, AudioSlave::DuplexMode)
int midi_event_put(void *port_buffer, pframes_t timestamp, const uint8_t *buffer, size_t size)
bool can_set_period_size() const
std::vector< DeviceStatus > enumerate_input_devices() const
std::string get_port_name(PortEngine::PortHandle ph) const
std::string _output_audio_device
int disconnect(PortEngine::PortHandle ph, const std::string &other)
std::string output_device_name() const
samplepos_t sample_time_at_cycle_start()
void update_systemic_audio_latencies()
samplecnt_t _processed_samples
AlsaAudioBackend(AudioEngine &e, AudioBackendInfo &info)
bool use_separate_input_and_output_devices() const
int set_input_device_name(const std::string &)
const std::string & my_name() const
std::string _input_audio_device
const Sample * const_buffer() const
AlsaAudioPort(AlsaAudioBackend &b, const std::string &, PortFlags)
void * get_buffer(pframes_t nframes)
AlsaDeviceReservation(const char *device_name)
void reservation_stdout(std::string, size_t)
PBD::ScopedConnectionList _reservation_connection
bool acquire_device(const char *device_name, bool silent=false)
ARDOUR::SystemExec * _device_reservation
bool _reservation_succeeded
AlsaMidiEvent(const AlsaMidiEvent &other)
pframes_t timestamp() const
const uint8_t * data() const
AlsaMidiEvent(const pframes_t timestamp, const uint8_t *data, size_t size)
void * get_buffer(pframes_t nframes)
const AlsaMidiBuffer * const_buffer() const
void set_n_periods(int n)
AlsaMidiBuffer _buffer[3]
AlsaMidiPort(AlsaAudioBackend &b, const std::string &, PortFlags)
AudioBackendInfo & info() const
int set_port_name(PortEngine::PortHandle, const std::string &)
uint32_t port_name_size() const
virtual void unregister_port(PortEngine::PortHandle)
bool physically_connected(PortEngine::PortHandle, bool process_callback_safe)
int disconnect(const std::string &src, const std::string &dst)
PortEngine::PortPtr get_port_by_name(const std::string &) const
int get_ports(const std::string &port_name_pattern, DataType type, PortFlags flags, std::vector< std::string > &) const
int connect(const std::string &src, const std::string &dst)
ChanCount n_physical_outputs() const
PortFlags get_port_flags(PortEngine::PortHandle) const
bool connected_to(PortEngine::PortHandle, const std::string &, bool process_callback_safe)
bool connected(PortEngine::PortHandle, bool process_callback_safe)
int get_connections(PortEngine::PortHandle, std::vector< std::string > &, bool process_callback_safe)
std::string get_port_name(PortEngine::PortHandle) const
ChanCount n_physical_inputs() const
void get_physical_outputs(DataType type, std::vector< std::string > &)
void get_physical_inputs(DataType type, std::vector< std::string > &)
DataType port_data_type(PortEngine::PortHandle) const
int disconnect_all(PortEngine::PortHandle)
bool port_is_physical(PortEngine::PortHandle) const
int get_port_property(PortEngine::PortHandle, const std::string &key, std::string &value, std::string &type) const
int set_port_property(PortEngine::PortHandle, const std::string &key, const std::string &value, const std::string &type)
PortEngine::PortPtr register_port(const std::string &shortname, ARDOUR::DataType, ARDOUR::PortFlags)
PortPtr const & PortHandle
std::shared_ptr< ProtoPort > PortPtr
std::vector< AlsaMidiEvent > AlsaMidiBuffer
Temporal::samplecnt_t samplecnt_t
Temporal::samplepos_t samplepos_t
AlsaMidiDeviceInfo(bool en=true)
uint32_t systemic_input_latency
uint32_t systemic_output_latency
AlsaAudioBackend * engine
ThreadData(AlsaAudioBackend *e, std::function< void()> fp, size_t stacksz)