dxd - dynax driver framework 2.2.0d91
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::usb::stream::pipe< device_t, circular_t > Class Template Reference

#include <dx_usb_stream_pipe.h>

+ Inheritance diagram for dx::usb::stream::pipe< device_t, circular_t >:
+ Collaboration diagram for dx::usb::stream::pipe< device_t, circular_t >:

Classes

struct  cache
 
struct  isoc
 

Public Types

typedef struct device_t::desc::stream desc
 

Public Member Functions

template<unsigned int channels, typename channel_t >
streamattach (channel_t **io[2], uint64_t channel_map[(channels+63)/64])
 
void exception (const class exception &exception, bool filtered=false) const noexcept override
 
virtual void initialize ()
 
void launch () override
 
 operator circular_t * () const noexcept
 
circular_t * operator-> () const noexcept
 
virtual uint8_t submit (dx::stream::encoder::index::type type, unsigned int index) const
 
virtual bool submit (dx::stream::encoder::index::type type, unsigned int index, uint8_t value)
 submit encoder stage to device return true if successfully submitted; if false is returned the encode state machine will not update the stage value (i.e. if the stage can't be submitted during streaming pause), given the chance to submit the stage at start().
 

Public Attributes

const decltype(device_t::desc::stream::desc::target.idx()) id
 

Protected Member Functions

 __dx_catchall (this->started=0;std::cerr<< exception<< std::endl;,) public
 creates this->circular streaming backing store and frame buffers
 
virtual void alloc (size_t size)
 
 catch (...)
 
 catch (...)
 
 catch (...)
 
 catch (...)
 
 catch (...)
 
 catch (...)
 
 catch (...)
 
 catch (const dx::exception &__dx_exception)
 
 catch (const dx::exception &__dx_exception)
 
 catch (const dx::exception &__dx_exception)
 
 catch (const dx::exception &__dx_exception)
 
 catch (const dx::exception &__dx_exception)
 
 catch (const dx::exception &__dx_exception)
 
 catch (const dx::exception &__dx_exception)
 
 catch (const std::exception &__std_exception)
 
 catch (const std::exception &__std_exception)
 
 catch (const std::exception &__std_exception)
 
 catch (const std::exception &__std_exception)
 
 catch (const std::exception &__std_exception)
 
 catch (const std::exception &__std_exception)
 
 catch (const std::exception &__std_exception)
 
 dx_catchall_handler (this,) ~pipe() noexcept override
 
float encoder (dx::stream::encoder::index::type type, unsigned int index) const override
 
bool encoder (dx::stream::encoder::index::type type, unsigned int index, float value) override
 
void exception (const dx::exception &exception, bool filtered=false) const noexcept override
 
bool flush () noexcept override
 
void halt () noexcept override
 
void info (std::ostream &os) noexcept override try
 
void initialize (uint32_t packet_size, uint32_t micro_frames)
 
void initialize (uint32_t samplerate, uint32_t line_size, uint32_t micro_frames, bool implicit_feedback)
 
uint32_t latency () noexcept override
 
void received (os_result status, size_t size) override try
 
void received (os_result status, size_t size, int64_t timestamp, usb::isoc::frame *frame) override try
 async isoc read callback
 
uint32_t samplerate () override try
 provisional sample rate handler: needs to move into clock class
 
uint32_t samplerate (uint32_t samplerate) override try
 
bool start (uint64_t frame, unsigned int starting=1) override try
 
void thread () noexcept try
 data driven streaming out / observer watchdog thread
 
void transmitted (os_result status, size_t size) override try
 async write callback
 
void transmitted (os_result status, size_t size, int64_t timestamp, usb::isoc::frame *) override try
 async isoc write callback
 

Protected Attributes

struct { 
 
   uint32_t   ahead 
 
   volatile uint32_t   completion 
 
   os_result   status 
 bytes ahead in streaming buffer due to pre-scheduled async requests More...
 
   uint32_t   submit 
 
async 
 
struct dx::usb::stream::pipe::cache cache
 
circular_t * circular {}
 
struct dx::usb::stream::pipe::isoc isoc
 
struct { 
 
   struct { 
 
      unsigned int   ticks 
 
      struct { 
 
         unsigned int   count 
 
      }   transaction 
 
   }   cycle 
 
sync 
 
struct dx::usb::audio::isoc::cycle::tick * tick = nullptr
 

Friends

class pause
 

Member Typedef Documentation

◆ desc

template<typename device_t , typename circular_t = dx::circular, typename super_stream_t = dx::stream::control<dx::stream::object<device_t>>>
typedef struct device_t::desc::stream dx::stream::stream< device_t, circular_t, super_stream_t >::desc
inherited

Member Function Documentation

◆ __dx_catchall()

template<typename device_t , typename circular_t = dx::circular>
dx::usb::stream::pipe< device_t, circular_t >::__dx_catchall ( this-> started = 0; std::cerr<< exception<< std::endl;)
inlineprotected

creates this->circular streaming backing store and frame buffers

generates isoc cycle metrics from sample rate,

requests buffers to fit at least 3x max iosize with isoc cycle size granularity

update max frame size

Todo
reset max frame size when pipe is closed

◆ alloc()

template<typename device_t , typename circular_t = dx::circular, typename super_stream_t = dx::stream::control<dx::stream::object<device_t>>>
virtual void dx::stream::stream< device_t, circular_t, super_stream_t >::alloc ( size_t size)
inlineprotectedvirtualinherited

◆ attach()

template<typename device_t , typename circular_t = dx::circular, typename super_stream_t = dx::stream::control<dx::stream::object<device_t>>>
template<unsigned int channels, typename channel_t >
stream & dx::stream::stream< device_t, circular_t, super_stream_t >::attach ( channel_t ** io[2],
uint64_t channel_map[(channels+63)/64] )
inlineinherited

◆ catch() [1/21]

template<typename device_t , typename circular_t = dx::circular>
dx::usb::stream::pipe< device_t, circular_t >::catch ( ...)
inlineprotected

◆ catch() [2/21]

template<typename device_t , typename circular_t = dx::circular>
dx::usb::stream::pipe< device_t, circular_t >::catch ( ...)
inlineprotected

◆ catch() [3/21]

template<typename device_t , typename circular_t = dx::circular>
dx::usb::stream::pipe< device_t, circular_t >::catch ( ...)
inlineprotected

◆ catch() [4/21]

template<typename device_t , typename circular_t = dx::circular>
dx::usb::stream::pipe< device_t, circular_t >::catch ( ...)
inlineprotected

◆ catch() [5/21]

template<typename device_t , typename circular_t = dx::circular>
dx::usb::stream::pipe< device_t, circular_t >::catch ( ...)
inlineprotected

◆ catch() [6/21]

template<typename device_t , typename circular_t = dx::circular>
dx::usb::stream::pipe< device_t, circular_t >::catch ( ...)
inlineprotected

◆ catch() [7/21]

template<typename device_t , typename circular_t = dx::circular>
dx::usb::stream::pipe< device_t, circular_t >::catch ( ...)
inlineprotected

◆ catch() [8/21]

template<typename device_t , typename circular_t = dx::circular>
dx::usb::stream::pipe< device_t, circular_t >::catch ( const dx::exception & __dx_exception)
inlineprotected

◆ catch() [9/21]

template<typename device_t , typename circular_t = dx::circular>
dx::usb::stream::pipe< device_t, circular_t >::catch ( const dx::exception & __dx_exception)
inlineprotected

◆ catch() [10/21]

template<typename device_t , typename circular_t = dx::circular>
dx::usb::stream::pipe< device_t, circular_t >::catch ( const dx::exception & __dx_exception)
inlineprotected

◆ catch() [11/21]

template<typename device_t , typename circular_t = dx::circular>
dx::usb::stream::pipe< device_t, circular_t >::catch ( const dx::exception & __dx_exception)
inlineprotected

◆ catch() [12/21]

template<typename device_t , typename circular_t = dx::circular>
dx::usb::stream::pipe< device_t, circular_t >::catch ( const dx::exception & __dx_exception)
inlineprotected

◆ catch() [13/21]

template<typename device_t , typename circular_t = dx::circular>
dx::usb::stream::pipe< device_t, circular_t >::catch ( const dx::exception & __dx_exception)
inlineprotected

◆ catch() [14/21]

template<typename device_t , typename circular_t = dx::circular>
dx::usb::stream::pipe< device_t, circular_t >::catch ( const dx::exception & __dx_exception)
inlineprotected

◆ catch() [15/21]

template<typename device_t , typename circular_t = dx::circular>
dx::usb::stream::pipe< device_t, circular_t >::catch ( const std::exception & __std_exception)
inlineprotected

◆ catch() [16/21]

template<typename device_t , typename circular_t = dx::circular>
dx::usb::stream::pipe< device_t, circular_t >::catch ( const std::exception & __std_exception)
inlineprotected

◆ catch() [17/21]

template<typename device_t , typename circular_t = dx::circular>
dx::usb::stream::pipe< device_t, circular_t >::catch ( const std::exception & __std_exception)
inlineprotected

◆ catch() [18/21]

template<typename device_t , typename circular_t = dx::circular>
dx::usb::stream::pipe< device_t, circular_t >::catch ( const std::exception & __std_exception)
inlineprotected

◆ catch() [19/21]

template<typename device_t , typename circular_t = dx::circular>
dx::usb::stream::pipe< device_t, circular_t >::catch ( const std::exception & __std_exception)
inlineprotected

◆ catch() [20/21]

template<typename device_t , typename circular_t = dx::circular>
dx::usb::stream::pipe< device_t, circular_t >::catch ( const std::exception & __std_exception)
inlineprotected

◆ catch() [21/21]

template<typename device_t , typename circular_t = dx::circular>
dx::usb::stream::pipe< device_t, circular_t >::catch ( const std::exception & __std_exception)
inlineprotected

◆ dx_catchall_handler()

template<typename device_t , typename circular_t = dx::circular>
dx::usb::stream::pipe< device_t, circular_t >::dx_catchall_handler ( this )
inlineoverrideprotectednoexcept

◆ encoder() [1/2]

template<typename device_t , typename circular_t = dx::circular>
float dx::usb::stream::pipe< device_t, circular_t >::encoder ( dx::stream::encoder::index::type type,
unsigned int index ) const
inlineoverrideprotectedvirtual

◆ encoder() [2/2]

template<typename device_t , typename circular_t = dx::circular>
bool dx::usb::stream::pipe< device_t, circular_t >::encoder ( dx::stream::encoder::index::type type,
unsigned int index,
float value )
inlineoverrideprotectedvirtual

◆ exception() [1/2]

template<typename device_t , typename circular_t = dx::circular, typename super_stream_t = dx::stream::control<dx::stream::object<device_t>>>
void dx::stream::stream< device_t, circular_t, super_stream_t >::exception ( const class exception & exception,
bool filtered = false ) const
inlineoverridenoexceptinherited
+ Here is the caller graph for this function:

◆ exception() [2/2]

template<typename device_t , typename circular_t = dx::circular>
void dx::usb::stream::pipe< device_t, circular_t >::exception ( const dx::exception & exception,
bool filtered = false ) const
inlineoverrideprotectednoexcept

◆ flush()

template<typename device_t , typename circular_t = dx::circular>
bool dx::usb::stream::pipe< device_t, circular_t >::flush ( )
inlineoverrideprotectedvirtualnoexcept

◆ halt()

template<typename device_t , typename circular_t = dx::circular>
void dx::usb::stream::pipe< device_t, circular_t >::halt ( )
inlineoverrideprotectednoexcept

◆ info()

template<typename device_t , typename circular_t = dx::circular>
void dx::usb::stream::pipe< device_t, circular_t >::info ( std::ostream & os)
inlineoverrideprotectednoexcept

◆ initialize() [1/3]

template<typename device_t , typename circular_t = dx::circular, typename super_stream_t = dx::stream::control<dx::stream::object<device_t>>>
virtual void dx::stream::stream< device_t, circular_t, super_stream_t >::initialize ( )
inlinevirtualinherited
+ Here is the call graph for this function:

◆ initialize() [2/3]

void dx::usb::audio::isoc::cycle::initialize ( uint32_t packet_size,
uint32_t micro_frames )
inlineinherited

◆ initialize() [3/3]

void dx::usb::audio::isoc::cycle::initialize ( uint32_t samplerate,
uint32_t line_size,
uint32_t micro_frames,
bool implicit_feedback )
inlineinherited

◆ latency()

template<typename device_t , typename circular_t = dx::circular>
uint32_t dx::usb::stream::pipe< device_t, circular_t >::latency ( )
inlineoverrideprotectedvirtualnoexcept

◆ launch()

template<typename device_t , typename circular_t = dx::circular, typename super_stream_t = dx::stream::control<dx::stream::object<device_t>>>
void dx::stream::stream< device_t, circular_t, super_stream_t >::launch ( )
inlineoverrideinherited

◆ operator circular_t *()

template<typename device_t , typename circular_t = dx::circular, typename super_stream_t = dx::stream::control<dx::stream::object<device_t>>>
dx::stream::stream< device_t, circular_t, super_stream_t >::operator circular_t * ( ) const
inlinenoexceptinherited

◆ operator->()

template<typename device_t , typename circular_t = dx::circular, typename super_stream_t = dx::stream::control<dx::stream::object<device_t>>>
circular_t * dx::stream::stream< device_t, circular_t, super_stream_t >::operator-> ( ) const
inlinenoexceptinherited

◆ received() [1/2]

template<typename device_t , typename circular_t = dx::circular>
void dx::usb::stream::pipe< device_t, circular_t >::received ( os_result status,
size_t size )
inlineoverrideprotected
Todo
evaluate non-transaction size transmit handling
Todo
log async write callback
Todo
validate rx non-clock domain handling
Todo
evaluate transaction size vs. ring buffer write size

generates timestamp

+ Here is the call graph for this function:

◆ received() [2/2]

template<typename device_t , typename circular_t = dx::circular>
void dx::usb::stream::pipe< device_t, circular_t >::received ( os_result status,
size_t size,
int64_t timestamp,
usb::isoc::frame * frame )
inlineoverrideprotected

async isoc read callback

Todo
usb::stream::pipe::received(): evaluate checking for valid sizes
+ Here is the call graph for this function:

◆ samplerate() [1/2]

template<typename device_t , typename circular_t = dx::circular>
uint32_t dx::usb::stream::pipe< device_t, circular_t >::samplerate ( )
inlineoverrideprotectedvirtual

provisional sample rate handler: needs to move into clock class

Todo
reference dedicated usb::stream::device::clock class

Reimplemented from dx::stream::stream< device_t, circular_t, super_stream_t >.

◆ samplerate() [2/2]

template<typename device_t , typename circular_t = dx::circular>
uint32_t dx::usb::stream::pipe< device_t, circular_t >::samplerate ( uint32_t samplerate)
inlineoverrideprotectedvirtual

◆ start()

template<typename device_t , typename circular_t = dx::circular>
bool dx::usb::stream::pipe< device_t, circular_t >::start ( uint64_t frame,
unsigned int starting = 1 )
inlineoverrideprotected

estimate upcoming timestamp

scheduling all but one isoc requests at least 1 sequence ahead; aligned to whole cycles,

◆ submit() [1/2]

template<typename device_t , typename circular_t = dx::circular, typename super_stream_t = dx::stream::control<dx::stream::object<device_t>>>
virtual uint8_t dx::stream::stream< device_t, circular_t, super_stream_t >::submit ( dx::stream< device_t, circular_t, super_stream_t >::encoder::index::type type,
unsigned int index ) const
inlinevirtualinherited

◆ submit() [2/2]

template<typename device_t , typename circular_t = dx::circular, typename super_stream_t = dx::stream::control<dx::stream::object<device_t>>>
virtual bool dx::stream::stream< device_t, circular_t, super_stream_t >::submit ( dx::stream< device_t, circular_t, super_stream_t >::encoder::index::type type,
unsigned int index,
uint8_t value )
inlinevirtualinherited

submit encoder stage to device return true if successfully submitted; if false is returned the encode state machine will not update the stage value (i.e. if the stage can't be submitted during streaming pause), given the chance to submit the stage at start().

◆ thread()

template<typename device_t , typename circular_t = dx::circular>
void dx::usb::stream::pipe< device_t, circular_t >::thread ( )
inlineprotectednoexcept

data driven streaming out / observer watchdog thread

Todo
usb::stream::pipe::thread(): evaluate to bail out @ async.status
+ Here is the call graph for this function:

◆ transmitted() [1/2]

template<typename device_t , typename circular_t = dx::circular>
void dx::usb::stream::pipe< device_t, circular_t >::transmitted ( os_result status,
size_t size )
inlineoverrideprotected

async write callback

Todo
evaluate non-transaction size transmit handling
Todo
log async write callback
Todo
evaluate transaction size vs. ring buffer read size
Todo
USB HW clock support: hardcoded to USB/out - needs to be handled by clock class

generates timestamp

+ Here is the call graph for this function:

◆ transmitted() [2/2]

template<typename device_t , typename circular_t = dx::circular>
void dx::usb::stream::pipe< device_t, circular_t >::transmitted ( os_result status,
size_t size,
int64_t timestamp,
usb::isoc::frame *  )
inlineoverrideprotected

async isoc write callback

Todo
usb::stream::pipe::received(): evaluate checking for valid sizes
Todo
USB HW clock support: hardcoded to USB/out - needs to be handled by clock class
+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ pause

template<typename device_t , typename circular_t = dx::circular>
friend class pause
friend

Member Data Documentation

◆ ahead

template<typename device_t , typename circular_t = dx::circular>
uint32_t dx::usb::stream::pipe< device_t, circular_t >::ahead

◆ [struct]

struct { ... } dx::usb::stream::pipe< device_t, circular_t >::async

◆ cache

template<typename device_t , typename circular_t = dx::circular>
struct dx::usb::stream::pipe::cache dx::usb::stream::pipe< device_t, circular_t >::cache
protected

◆ circular

template<typename device_t , typename circular_t = dx::circular, typename super_stream_t = dx::stream::control<dx::stream::object<device_t>>>
circular_t* dx::stream::stream< device_t, circular_t, super_stream_t >::circular {}
protectedinherited

◆ completion

template<typename device_t , typename circular_t = dx::circular>
volatile uint32_t dx::usb::stream::pipe< device_t, circular_t >::completion

◆ count

template<typename device_t , typename circular_t = dx::circular>
unsigned int dx::usb::stream::pipe< device_t, circular_t >::count

◆ [struct]

struct { ... } dx::usb::stream::pipe< device_t, circular_t >::cycle

◆ id

template<typename device_t , typename circular_t = dx::circular, typename super_stream_t = dx::stream::control<dx::stream::object<device_t>>>
const decltype(device_t::desc::stream::desc::target.idx()) dx::stream::stream< device_t, circular_t, super_stream_t >::id
inherited

◆ isoc

template<typename device_t , typename circular_t = dx::circular>
struct dx::usb::stream::pipe::isoc dx::usb::stream::pipe< device_t, circular_t >::isoc
protected

◆ status

template<typename device_t , typename circular_t = dx::circular>
os_result dx::usb::stream::pipe< device_t, circular_t >::status

bytes ahead in streaming buffer due to pre-scheduled async requests

streaming status for observer thread

◆ submit

template<typename device_t , typename circular_t = dx::circular>
uint32_t dx::usb::stream::pipe< device_t, circular_t >::submit

◆ [struct]

struct { ... } dx::usb::stream::pipe< device_t, circular_t >::sync

◆ tick

struct dx::usb::audio::isoc::cycle::tick* dx::usb::audio::isoc::cycle::tick = nullptr
inherited

◆ ticks

template<typename device_t , typename circular_t = dx::circular>
unsigned int dx::usb::stream::pipe< device_t, circular_t >::ticks

◆ [struct]

struct { ... } dx::usb::stream::pipe< device_t, circular_t >::transaction

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

(c) copyright 2009 dynamic acoustics e.U. generated on Tue Mar 11 2025

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.