dxd - dynax driver framework 3.0.0d222
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

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
clientoperator[] (::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 ()
hostsubmit (::AudioObjectID id, ::UInt64 action, uint64_t data=0)
hostsubmit (::AudioObjectID id, const ::AudioObjectPropertyAddress &address)
template<unsigned int count>
hostsubmit (::AudioObjectID id, const ::AudioObjectPropertyAddress(&addresses)[count])

Public Attributes

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

Protected Member Functions

eventfree () noexcept
virtual eventinitialize (bool signalled=false)
superinitialize (const std::string &name, bool signalled=false) override
superreset (uint64_t=0) noexcept override
supersignal (uint64_t count=1) override
superwait (bool reset=false) override

Protected Attributes

std::atomic< int > io_started
const ::AudioServerPlugInHostInterface * plugin

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
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.

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

◆ circular

template<typename pin_t>
pin_t::circular_t* dx::coreaudio::server::device< pin_t >::circular

◆ clients

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

◆ count

template<typename pin_t>
uint64_t dx::coreaudio::server::device< pin_t >::count

cached sync cycle count to evaluate timesamp generation

◆ [struct]

struct { ... } dx::coreaudio::server::device< pin_t >::cycle

◆ direction

template<typename pin_t>
dx::stream::direction::direction dx::coreaudio::server::device< pin_t >::direction

◆ epoch

template<typename pin_t>
int64_t dx::coreaudio::server::device< pin_t >::epoch

host ticks at cycle.reference==0, cached once at io_start() (software-clocked devices only)

◆ 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

◆ lines

template<typename pin_t>
uint32_t dx::coreaudio::server::device< pin_t >::lines

sample lines per sync cycle (per timestamp generation)

◆ linesize

template<typename pin_t>
uint32_t dx::coreaudio::server::device< pin_t >::linesize

size of all channels in bytes per sample

◆ offset

template<typename pin_t>
uint32_t dx::coreaudio::server::device< pin_t >::offset

timestamp generation offset to zero reference on seed change

◆ 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

◆ [struct]

struct { ... } dx::coreaudio::server::device< pin_t >::reference

◆ safety_offset

template<typename pin_t>
uint32_t dx::coreaudio::server::device< pin_t >::safety_offset[2]

RX/TX safety offsets;.

◆ samplerate

template<typename pin_t>
uint32_t dx::coreaudio::server::device< pin_t >::samplerate

cached from the promoted<>::preference this->samplerate at resync_reference() time

◆ seed

template<typename pin_t>
uint64_t dx::coreaudio::server::device< pin_t >::seed

◆ ticks_per_cycle

template<typename pin_t>
int64_t dx::coreaudio::server::device< pin_t >::ticks_per_cycle

host ticks per sync.cycle.lines samples, cached at resync_reference() (software-clocked devices only)

◆ uid

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

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

(c) copyright 2009 dynamic acoustics e.U. generated on

a closed source license may be obtained by requesting a written permission from dynamic acoustics e.U.
however - governmental use generally and military use especially is strictly prohibited though.