dxd - dynax driver framework 3.0.2
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::coreaudio::server::device< pin_t > Class Template Reference

CoreAudio server streaming device. More...

#include <dx_coreaudio_server_device.h>

Inheritance diagram for dx::coreaudio::server::device< pin_t >:
Collaboration diagram for dx::coreaudio::server::device< pin_t >:

Classes

struct  client
 one process the HAL opened this device for: its bundle identifier, the HAL's client ids and the streams it holds - what a client leaves behind is released with it More...

Public Member Functions

virtual void add_client(const ::AudioServerPlugInClientInfo* info)
virtual void configure(target target, ::UInt64 action, void* info)
 configure: handle device configuration change requests configure will only receive requests targetted to the device
virtual void create_pins()
 device(decltype(super::driver)& driver, decltype(super::id)& id)
 device(decltype(super::driver)& driver, decltype(super::id)& id, const typename super::desc_t& desc)
virtual void io_start(::UInt32 client)
virtual void io_stop(::UInt32 client)
void io_timestamp(::Float64& sampletime, ::UInt64& host_time, ::UInt64& seed)
void launch() override
 operator const ::AudioServerPlugInHostInterface*() const noexcept
client& operator [](::UInt32 client)
pin_t& pin(::AudioObjectID id)
pin_t& pin(target target)
virtual uint32_t property(::pid_t pid, target target, const ::AudioObjectPropertyAddress& address, void* property, ::UInt32& size, bool set= false)
 generic device property handler
virtual void remove_client(const ::AudioServerPlugInClientInfo* info)
void resync(uint64_t count, uint64_t reference)
 recompute sync.offset/sync.seed/per-pin cache.sync.offset from an already-valid (count, reference) cycle snapshot. Never waits: the caller (io_start(), or io_timestamp() on the RT thread) must supply a snapshot it already knows to be valid.
void resync_reference()
host& submit(::AudioObjectID id, ::UInt64 action, uint64_t data= 0)
host& submit(::AudioObjectID id, const ::AudioObjectPropertyAddress& address)
template<unsigned int count>
host& submit(::AudioObjectID id, const ::AudioObjectPropertyAddress(& addresses)[count])

Public Attributes

std::map<::pid_t, client> clients
uint8_t idx= 0
std::deque<pin_t> pins
cf::string uid

Protected Member Functions

event& free() noexcept
virtual event& initialize(bool signalled= false)
super& initialize(const std::string& name, bool signalled= false) override
super& reset(uint64_t= 0) noexcept override
super& signal(uint64_t count= 1) override
super& wait(bool reset= false) override

Protected Attributes

std::atomic<int> io_started
const ::AudioServerPlugInHostInterface* plugin
std::atomic<uint32_t> wished{}
 the nominal sample rate asked for while its configuration change is pending: one request in flight, carrying the latest wish

Detailed Description

template<typename pin_t>
class dx::coreaudio::server::device< pin_t >

CoreAudio server streaming device.

In contrast to the hierarchical dx device tree design the device keeps a list of all pins and all streams to better reflect the CoreAudio architecture.

Constructor & Destructor Documentation

◆ device() [1/2]

template<typename pin_t>
dx::coreaudio::server::device<pin_t>::device(decltype(super::driver)& driver, decltype(super::id)& id)
inline
Here is the caller graph for this function:

◆ device() [2/2]

template<typename pin_t>
dx::coreaudio::server::device<pin_t>::device(decltype(super::driver)& driver, decltype(super::id)& id, const typename super::desc_t& desc)
inline

Member Function Documentation

◆ add_client()

template<typename pin_t>
virtual void dx::coreaudio::server::device<pin_t>::add_client(const ::AudioServerPlugInClientInfo* info)
inlinevirtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ configure()

template<typename pin_t>
virtual void dx::coreaudio::server::device<pin_t>::configure(target target, ::UInt64 action, void* info)
inlinevirtual

configure: handle device configuration change requests configure will only receive requests targetted to the device

Todo
coreaudio::server::device::configure(): kAudioDevicePropertyNominalSampleRate does not yet select the pin whose alternate setting matches the requested rate for devices with multiple alternate settings per stream
Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_pins()

template<typename pin_t>
virtual void dx::coreaudio::server::device<pin_t>::create_pins()
inlinevirtual

creates pins from dx::device description and adds it as CoreAudio entity to the CoreAudio device

Todo
coreaudio::server::device::create_pins(): not yet filtered by negotiated sample rate for devices with multiple alternate settings per stream

register all audio pins across all streams

Here is the call graph for this function:
Here is the caller graph for this function:

◆ free()

event& dx::shared::event::free()
inlinenoexceptinherited
Here is the caller graph for this function:

◆ initialize() [1/2]

virtual event& dx::abstract::event::initialize(bool signalled= false)
inlinevirtualinherited

Reimplemented in dx::event< kernel >.

◆ initialize() [2/2]

super& dx::shared::event::initialize(const std::string& name, bool signalled= false)
inlineoverridevirtualinherited

Reimplemented from dx::abstract::event.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ io_start()

template<typename pin_t>
virtual void dx::coreaudio::server::device<pin_t>::io_start(::UInt32 client)
inlinevirtual
Todo
coreaudio::server::device::io_start(): starts every pin unconditionally; not yet rate-aware for devices with multiple alternate settings per stream
Todo
coreaudio::device::io_start(): check stream state while waiting for cycle switch
Here is the call graph for this function:
Here is the caller graph for this function:

◆ io_stop()

template<typename pin_t>
virtual void dx::coreaudio::server::device<pin_t>::io_stop(::UInt32 client)
inlinevirtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ io_timestamp()

template<typename pin_t>
void dx::coreaudio::server::device<pin_t>::io_timestamp(::Float64& sampletime, ::UInt64& host_time, ::UInt64& seed)
inline
Here is the call graph for this function:

◆ launch()

template<typename pin_t>
void dx::coreaudio::server::device<pin_t>::launch()
inlineoverride
Todo
coreaudio::server::device::launch():

remove clocksource pre-initialization hack to avoid hang at pin::property() kAudioStreamPropertyAvailablePhysicalFormats request

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator const ::AudioServerPlugInHostInterface *()

dx::coreaudio::server::host::operator const ::AudioServerPlugInHostInterface*() const
inlinenoexceptinherited

◆ operator []()

template<typename pin_t>
client& dx::coreaudio::server::device<pin_t>::operator [](::UInt32 client)
inline
Here is the caller graph for this function:

◆ pin() [1/2]

template<typename pin_t>
pin_t& dx::coreaudio::server::device<pin_t>::pin(::AudioObjectID id)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pin() [2/2]

template<typename pin_t>
pin_t& dx::coreaudio::server::device<pin_t>::pin(target target)
inline
Here is the call graph for this function:

◆ property()

template<typename pin_t>
virtual uint32_t dx::coreaudio::server::device<pin_t>::property(::pid_t pid, target target, const ::AudioObjectPropertyAddress& address, void* property, ::UInt32& size, bool set= false)
inlinevirtual

generic device property handler

  • has property (property= null)
  • get property
  • get property size (property= null)
  • set property (set= true)
  • is property settable (property= null, set= true)
Todo
provide channel names
Todo
coreaudio::server::device::property(): property::device::clients: replace cf::array by cf::dictionary with PIDs as keys

< the client holds the stream only once it launched: a failed launch leaves no ring-less stream behind for its start/stop

Todo
kAudioSelectorControlPropertyAvailableItems: calc clock # settings offset for multiple clock support
Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove_client()

template<typename pin_t>
virtual void dx::coreaudio::server::device<pin_t>::remove_client(const ::AudioServerPlugInClientInfo* info)
inlinevirtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

super& dx::shared::event::reset(uint64_t= 0)
inlineoverridevirtualnoexceptinherited

Implements dx::abstract::event.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resync()

template<typename pin_t>
void dx::coreaudio::server::device<pin_t>::resync(uint64_t count, uint64_t reference)
inline

recompute sync.offset/sync.seed/per-pin cache.sync.offset from an already-valid (count, reference) cycle snapshot. Never waits: the caller (io_start(), or io_timestamp() on the RT thread) must supply a snapshot it already knows to be valid.

< the device's sample time at the reference: the sync reference ring's lines past its origin

< one sample-time base per ring, every pin of it alike: the ring's origin in lines plus the device's time

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resync_reference()

template<typename pin_t>
void dx::coreaudio::server::device<pin_t>::resync_reference()
inline

(re)computes sync.reference/cycle.lines/linesize/safety_offset from the current pins; callable as soon as pins exist (create_pins()), not just at io_start(), so kAudioDevicePropertyZeroTimeStampPeriod is answerable before the first StartIO

Here is the call graph for this function:
Here is the caller graph for this function:

◆ signal()

super& dx::shared::event::signal(uint64_t count= 1)
inlineoverridevirtualinherited

Implements dx::abstract::event.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ submit() [1/3]

host& dx::coreaudio::server::host::submit(::AudioObjectID id, ::UInt64 action, uint64_t data= 0)
inlineinherited
Here is the call graph for this function:

◆ submit() [2/3]

host& dx::coreaudio::server::host::submit(::AudioObjectID id, const ::AudioObjectPropertyAddress& address)
inlineinherited
Here is the call graph for this function:

◆ submit() [3/3]

template<unsigned int count>
host& dx::coreaudio::server::host::submit(::AudioObjectID id, const ::AudioObjectPropertyAddress(&) addresses[count])
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wait()

super& dx::shared::event::wait(bool reset= false)
inlineoverridevirtualinherited

Implements dx::abstract::event.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ clients

template<typename pin_t>
std::map<::pid_t, client> dx::coreaudio::server::device<pin_t>::clients

◆ idx

template<typename pin_t>
uint8_t dx::coreaudio::server::device<pin_t>::idx= 0

◆ io_started

template<typename pin_t>
std::atomic<int> dx::coreaudio::server::device<pin_t>::io_started
protected

◆ pins

template<typename pin_t>
std::deque<pin_t> dx::coreaudio::server::device<pin_t>::pins

◆ plugin

const ::AudioServerPlugInHostInterface* dx::coreaudio::server::host::plugin
protectedinherited

◆ uid

template<typename pin_t>
cf::string dx::coreaudio::server::device<pin_t>::uid

◆ wished

template<typename pin_t>
std::atomic<uint32_t> dx::coreaudio::server::device<pin_t>::wished{}
protected

the nominal sample rate asked for while its configuration change is pending: one request in flight, carrying the latest wish


The documentation for this class was generated from the following file: