dxd - dynax driver framework 3.0.0d222
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::usb::stream::pipe< device_t, circular_t, stream_t > Class Template Referenceabstract

#include <dx_usb_stream_pipe.h>

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

Classes

struct  cache
struct  isoc

Public Types

typedef struct device_t::desc::stream desc
typedef device<> device_t
typedef device<> device_t
typedef event< userevent_t
enum  type

Public Member Functions

 __dx_catchall (std::cerr<< dx::exception(&exception, exception.error, __PRETTY_FUNCTION__, __FILE__, __LINE__)<< std::endl;,) void conclude() noexcept
pipeabort () try
streamattach (channel_t **[2], const std::vector< bool > &, direction::direction) try
 the pin passes its own direction: a stream shared by two pins carries none of its own
virtual void callback ()
void conclude () noexcept override
 conclude notification: object will be removed. If you overwrite conclude() you also need to overwrite destructor and check if its needed to be called from there. Called only through try_conclude() - never call this directly from outside the class hierarchy.
pipedrain (std::chrono::milliseconds timeout=std::chrono::milliseconds(250)) noexcept
 waits for already-submitted requests to complete on their own, without cancelling them
 dx_catchall_rethrow () os_result status() const noexcept
 dx_catchall_rethrow () virtual void free() noexcept
 dx_catchall_rethrow (;,"endpoint:%x interface:%d setting:%d", endpoint.address, endpoint.interface, endpoint.setting) pipe &max_frame_size(uint32_t frame_size)
 dx_pass (rx==tx? overflow:ok, "too manny (%d) outstanding asynchronous transactions for endpoint %x", max, address)
void exception (const class exception &exception, bool filtered=false) const noexcept override
void flush ()
 if (tx==max) tx=0
virtual eventinitialize (bool signalled=false)
virtual eventinitialize (const std::string &, bool signalled=false)
void launch () override try
 operator const os_event () const noexcept
 operator dx::circular * () const noexcept
 operator os_event () noexcept
DX_PRAGMA_IGNORE_RETURN_VALUE_END dx::circularoperator-> () const noexcept
 operator::HANDLE () const noexcept
pipeoperator<< (const data_t &data)
 synchronous USB write request
pipeoperator>> (data_t &data)
 synchronous USB read request
bool outstanding () const noexcept
bool poll (usb::isoc::result &result) noexcept
 pulls the oldest completed isoc request's result
piperead (void *data, size_t size) try
 synchronous USB read request
pipereceive (void *data, size_t size) try
 asynchronous USB read request
DX_PRAGMA_IGNORE_RETURN_VALUE_END eventreset (uint64_t count=0) override try
DX_PRAGMA_IGNORE_RETURN_VALUE_END eventreset (uint64_t count=0) override try
supersignal (uint64_t count=1) override try
supersignal (uint64_t count=1) override try
DX_PRAGMA_IGNORE_RETURN_VALUE_END uint64_t signalled () const
DX_PRAGMA_IGNORE_RETURN_VALUE_END uint64_t signalled () const
virtual bool submit (dx::stream::encoder::index::type, unsigned int, uint8_t)
 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().
pipesubmit (const request< data_t > &request) const try
 standard request to pipe
bool try_conclude () noexcept
 atomically conclude()s if currently launched; returns whether this call did it
bool try_conclude () noexcept
 atomically conclude()s if currently launched; returns whether this call did it
bool try_launch ()
 atomically launch()es if not already launched; returns whether this call did it
bool try_launch ()
 atomically launch()es if not already launched; returns whether this call did it
DX_PRAGMA_IGNORE_RETURN_VALUE_END superwait (bool reset=false) override try
DX_PRAGMA_IGNORE_RETURN_VALUE_END superwait (bool reset=false) override try
DX_PRAGMA_IGNORE_RETURN_VALUE_END bool wait (const std::chrono::duration< rep_t, period_t > &timeout, bool reset=false) try
DX_PRAGMA_IGNORE_RETURN_VALUE_END bool wait (const std::chrono::duration< rep_t, period_t > &timeout, bool reset=false) try
pipewrite (const void *data, size_t size) try
 synchronous USB write request

Public Attributes

const usb::endpoint::attributesattributes
std::deque< union audio::descriptor::endpointaudio
uint8_t bRefresh
 audio class endpoint: 2^bRefresh frames between two feedback values
uint8_t bSynchAddress
 audio class endpoint: the isoc sync endpoint pacing this one, 0: none
class buffer
buffer
dx::stream::channel::controlcontrol
 kernel streaming: the driver's buffer switch bookkeeping, set by attach()
event_t data [direction::directions]
 event signalising data arrival(in) or draining(out)
dx::promoted< dx::stream::formatformat
 the container this stream's ring runs: class and width its participants agreed on
uint64_t ::USBD_ISO_PACKET_DESCRIPTOR * frame
uint32_t granularity
::WINUSB_INTERFACE_HANDLE handle
const decltype(desc::target.idx()) id
interface & interface
uint32_t latency
std::atomic< bool > launched
std::atomic< bool > launched
uint32_t linesize
unsigned int micro_frames
dx::stream::clock::monitormonitor
decltype(device_t::samplerate) & samplerate
uint64_tsequence
promoted< uint32_tstart
promoted< uint32_tstart
promoted< bool > started
promoted< bool > started
return * this
bool ticking
 the tick's own view of this stream's session: set by the run hook once the ring stands, cleared by the halt hook before the session ends - a plain flag, the tick must never block on a promoted's transition
size_t size try

Static Public Attributes

static constexpr auto max
static constexpr auto scope

Protected Member Functions

 __dx_catchall (this->started=0;std::cerr<< dx::exception(&exception, exception.error, __PRETTY_FUNCTION__, __FILE__, __LINE__)<< std::endl;,) public
 creates this->circular streaming backing store and frame buffers
 __dx_catchall (this->started=0;std::cerr<< dx::exception(&exception, exception.error, __PRETTY_FUNCTION__, __FILE__, __LINE__)<< std::endl;,) void pump_in() noexcept try
 data driven streaming in
void alloc (size_t=0, bool free=true) override
 catch (...)
 catch (...)
 catch (...)
DX_PRAGMA_IGNORE_RETURN_VALUE_BEGIN catch (const dx::exception &__dx_exception)
DX_PRAGMA_IGNORE_RETURN_VALUE_BEGIN catch (const dx::exception &__dx_exception)
DX_PRAGMA_IGNORE_RETURN_VALUE_BEGIN catch (const dx::exception &__dx_exception)
 catch (const std::exception &__std_exception)
 catch (const std::exception &__std_exception)
 catch (const std::exception &__std_exception)
void charge () try
 streaming session prologue: selects the alternate setting, (re-)creates the isoc buffer and frees every slot - run by the thread owning the session (group pipes: the group's thread), whose ticks then submit
 dx_catchall_handler (this,) ~pipe() 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
 notification exception handler
DX_PRAGMA_IGNORE_RETURN_VALUE_END uint32_t fill (struct tick &tick)
 takes an out slot's data from the ring, sized as its request was submitted; returns the lines taken
void free () noexcept override
 overrides may release further alloc()-acquired resources (request buffers, isoc pools, shared-memory attachments) alongside circular; called only from alloc()'s own self-cleanup or the destructor - never from halt()/stop(), so everything alloc() acquires stays live for the object's full lifetime
void info (std::ostream &os) noexcept override try
 log object class information
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)
void initialize () override
void isoc_buffer_create ()
 (re-)creates the buffered isoc pipe's tick-staging buffer via isoc.buffer.create(); safe to call again per start/stop cycle since cache.buffered keeps this->circular on its own, separate, construction-time allocation (super::alloc() below).
DX_PRAGMA_IGNORE_RETURN_VALUE_END void pump_out () noexcept try
 data driven streaming out
void received (os_result status, size_t size) override try
 async read callback
void sync_transfer (uint64_t frame) noexcept
 the sink's own feedback endpoint: collects the rate it states and turns it into this pipe's per frame line counts
uint32_t transfer (uint64_t frame)
 the group's tick at bus frame frame: collects this pipe's completions and resubmits each slot a round on, the free slot due a round ahead in frame order among them, then moves the data - out: fills that slot, in: takes the slot due lead frames behind, ahead of its completion; returns the lines moved
DX_PRAGMA_IGNORE_RETURN_VALUE_END void transmitted (os_result status, size_t size) override try
 async write callback

Protected Attributes

struct { 
address
struct { 
   volatile uint32_t   completion 
   os_result   status 
 streaming status for observer thread More...
   uint32_t   submit 
async
struct dx::usb::stream::pipe::cache cache
listener< dx::listen< std::function< void(const uint32_t &)> > > cadence_listener {this->samplerate.listen, {[this](const uint32_t& samplerate){cache.cadence= samplerate/ usb::isoc::ticks_per_sec;}}}
 the tick reads the cache, never the promoted
dx::circularcircular
 allocated once by initialize()/alloc(); released only by free()
usb::isoc::result completed [max]
 isoc completions in callback order, filled by the runloop, drained by poll()
device<> & device
device<> & device
std::function< void()> flush_hook
std::function< void()> flush_hook
std::function< void()> halt_hook
std::function< void()> halt_hook
uint8_t idx
struct dx::usb::stream::pipe::isoc isoc
listener< dx::listen< std::function< void(const uint32_t &)> > > lead_listener {this->device[*this].transport::safety_offset[this->target.direction].listen, {[this](const uint32_t& ticks){cache.lead= ticks;}}}
 a lead set mid-session moves the tick's slots along
::HANDLE process
std::function< void()> run_hook
std::function< void()> run_hook
volatile unsigned int rx
struct { 
   struct { 
      unsigned int   ticks 
      struct { 
         unsigned int   count 
      }   transaction
   }   cycle
sync
struct dx::usb::audio::isoc::cycle::tick * tick = nullptr
volatile unsigned int tx
struct { 
   ::WINUSB_INTERFACE_HANDLE   handle 
winusb

Friends

class pause
class usb::stream::group< device_t >

Member Typedef Documentation

◆ desc

typedef struct device_t::desc::stream dx::stream::stream< device_t, dx::circular, usb::pipe< device_t >, event<user> >::desc
inherited

◆ device_t [1/2]

typedef device<> dx::stream::object< device<> >::device_t
inherited

◆ device_t [2/2]

typedef device<> dx::stream::object< device<> >::device_t
inherited

◆ event_t

Member Enumeration Documentation

◆ type

Member Function Documentation

◆ __dx_catchall() [1/3]

dx::stream::control< stream::object< device<> > >::__dx_catchall ( std::cerr<< dx::exception &,.,,, __LINE__<< std::endl; )
inlinenoexceptinherited

◆ __dx_catchall() [2/3]

template<typename device_t, typename circular_t = dx::circular, template< typename ... > typename stream_t = dx::stream::stream>
dx::usb::stream::pipe< device_t, circular_t, stream_t >::__dx_catchall ( this-> started = 0; std::cerr<< dx::exception(&exceptionexception.error__PRETTY_FUNCTION__, __FILE__, __LINE__)<< std::endl;)
inlineprotected

creates this->circular streaming backing store and frame buffers

stream::stream's ring reset, composed with usb::platform::pipe's completion-thread launch

stream::stream's group decrement, composed with usb::platform::pipe's join-outstanding-requests wait

◆ __dx_catchall() [3/3]

template<typename device_t, typename circular_t = dx::circular, template< typename ... > typename stream_t = dx::stream::stream>
dx::usb::stream::pipe< device_t, circular_t, stream_t >::__dx_catchall ( this-> started = 0; std::cerr<< dx::exception(&exceptionexception.error__PRETTY_FUNCTION__, __FILE__, __LINE__)<< std::endl;)
inlineprotectednoexcept

data driven streaming in

postponed

◆ abort()

pipe & dx::usb::platform::pipe< device<>, interface >::abort ( )
inlineinherited

◆ alloc()

template<typename device_t, typename circular_t = dx::circular, template< typename ... > typename stream_t = dx::stream::stream>
void dx::usb::stream::pipe< device_t, circular_t, stream_t >::alloc ( size_t = 0,
bool free = true )
inlineoverrideprotectedvirtual

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

Reimplemented from dx::stream::stream< device_t, dx::circular, usb::pipe< device_t > >.

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

◆ attach()

stream & dx::stream::stream< device_t, dx::circular, usb::pipe< device_t >, event<user> >::attach ( channel_t ** [2],
const std::vector< bool > & ,
direction::direction  )
inlineinherited

the pin passes its own direction: a stream shared by two pins carries none of its own

◆ callback()

virtual void dx::event< kernel >::callback ( )
inlinevirtualinherited

The default implementation is based on event<user> which is signalled when triggered via callback() from kernel. This is to achieve compatibility with Windows events. Its probably more adequate to overwrite callback() and do the work here if feasible.

◆ catch() [1/9]

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

◆ catch() [2/9]

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

◆ catch() [3/9]

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

◆ catch() [4/9]

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

◆ catch() [5/9]

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

◆ catch() [6/9]

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

◆ catch() [7/9]

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

◆ catch() [8/9]

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

◆ catch() [9/9]

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

◆ charge()

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

streaming session prologue: selects the alternate setting, (re-)creates the isoc buffer and frees every slot - run by the thread owning the session (group pipes: the group's thread), whose ticks then submit

estimate upcoming timestamp

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

◆ conclude()

void dx::usb::pipe< device_t >::conclude ( )
inlineoverridevirtualnoexceptinherited

conclude notification: object will be removed. If you overwrite conclude() you also need to overwrite destructor and check if its needed to be called from there. Called only through try_conclude() - never call this directly from outside the class hierarchy.

Reimplemented from dx::object.

◆ drain()

pipe & dx::usb::platform::pipe< device<>, interface >::drain ( std::chrono::milliseconds timeout = std::chrono::milliseconds(250))
inlinenoexceptinherited

waits for already-submitted requests to complete on their own, without cancelling them

◆ dx_catchall_handler()

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

◆ dx_catchall_rethrow() [1/3]

dx::usb::platform::pipe< device<>, interface >::dx_catchall_rethrow ( ) const
inlinenoexceptinherited

◆ dx_catchall_rethrow() [2/3]

dx::resource< invalid_t >::dx_catchall_rethrow ( )
inlinenoexceptinherited

◆ dx_catchall_rethrow() [3/3]

dx::usb::pipe< device_t >::dx_catchall_rethrow ( ; ,
"endpoint:%x interface:%d setting:%d" ,
endpoint. address,
endpoint. interface,
endpoint. setting ) &
inlineinherited

◆ dx_pass()

dx::usb::platform::pipe< device<>, interface >::dx_pass ( rx = =tx? overflow: ok,
"too manny (%d) outstanding asynchronous transactions for endpoint %x" ,
max ,
address  )
inherited

◆ encoder() [1/2]

template<typename device_t, typename circular_t = dx::circular, template< typename ... > typename stream_t = dx::stream::stream>
float dx::usb::stream::pipe< device_t, circular_t, stream_t >::encoder ( dx::stream::encoder::index::type type,
unsigned int index ) const
inlineoverrideprotected
Here is the call graph for this function:

◆ encoder() [2/2]

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

Reimplemented from dx::stream::stream< device_t, dx::circular, usb::pipe< device_t > >.

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

◆ exception() [1/2]

void dx::stream::stream< device_t, dx::circular, usb::pipe< device_t >, event<user> >::exception ( const class exception & exception,
bool filtered = false ) const
inlineoverridenoexceptinherited

◆ exception() [2/2]

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

notification exception handler

Implements dx::object.

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

◆ fill()

template<typename device_t, typename circular_t = dx::circular, template< typename ... > typename stream_t = dx::stream::stream>
DX_PRAGMA_IGNORE_RETURN_VALUE_END uint32_t dx::usb::stream::pipe< device_t, circular_t, stream_t >::fill ( struct tick & tick)
inlineprotected

takes an out slot's data from the ring, sized as its request was submitted; returns the lines taken

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

◆ flush()

void dx::stream::stream< device_t, dx::circular, usb::pipe< device_t >, event<user> >::flush ( )
inlineinherited

◆ free()

template<typename device_t, typename circular_t = dx::circular, template< typename ... > typename stream_t = dx::stream::stream>
void dx::usb::stream::pipe< device_t, circular_t, stream_t >::free ( )
inlineoverrideprotectedvirtualnoexcept

overrides may release further alloc()-acquired resources (request buffers, isoc pools, shared-memory attachments) alongside circular; called only from alloc()'s own self-cleanup or the destructor - never from halt()/stop(), so everything alloc() acquires stays live for the object's full lifetime

Reimplemented from dx::stream::stream< device_t, dx::circular, usb::pipe< device_t > >.

Here is the caller graph for this function:

◆ if()

dx::usb::platform::pipe< device<>, interface >::if ( tx = =max)
pure virtualinherited

◆ info()

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

log object class information

Reimplemented from dx::stream::stream< device_t, dx::circular, usb::pipe< device_t > >.

Here is the call graph for this function:

◆ initialize() [1/5]

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

◆ initialize() [2/5]

void dx::usb::audio::isoc::cycle::initialize ( uint32_t samplerate,
uint32_t line_size,
uint32_t micro_frames,
bool implicit_feedback )
inlineinherited
Here is the call graph for this function:

◆ initialize() [3/5]

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

◆ initialize() [4/5]

virtual event & dx::abstract::event::initialize ( const std::string & ,
bool signalled = false )
inlinevirtualinherited

◆ initialize() [5/5]

template<typename device_t, typename circular_t = dx::circular, template< typename ... > typename stream_t = dx::stream::stream>
void dx::usb::stream::pipe< device_t, circular_t, stream_t >::initialize ( )
inlineoverrideprotectedvirtual

Reimplemented from dx::stream::stream< device_t, dx::circular, usb::pipe< device_t > >.

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

◆ isoc_buffer_create()

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

(re-)creates the buffered isoc pipe's tick-staging buffer via isoc.buffer.create(); safe to call again per start/stop cycle since cache.buffered keeps this->circular on its own, separate, construction-time allocation (super::alloc() below).

Todo
dx::usb::stream::pipe: the non-buffered isoc case (see alloc() below) still only creates once, at construction, since c77a0974's this->circular null-pointer fix depends on that staying true; unexercised by any currently shipping device
Here is the caller graph for this function:

◆ launch()

void dx::stream::stream< device_t, dx::circular, usb::pipe< device_t >, event<user> >::launch ( )
inlineoverridevirtualinherited

Reimplemented from dx::object.

◆ operator const os_event()

dx::resource< invalid_t >::operator const os_event ( ) const
inlinenoexceptinherited

◆ operator dx::circular *()

dx::stream::stream< device_t, dx::circular, usb::pipe< device_t >, event<user> >::operator dx::circular * ( ) const
inlinenoexceptinherited

◆ operator os_event()

dx::event< kernel >::operator os_event ( )
inlinenoexceptinherited

◆ operator->()

DX_PRAGMA_IGNORE_RETURN_VALUE_END dx::circular * dx::stream::stream< device_t, dx::circular, usb::pipe< device_t >, event<user> >::operator-> ( ) const
inlinenoexceptinherited

◆ operator::HANDLE()

dx::resource< invalid_t >::operator::HANDLE ( ) const
inlinenoexceptinherited

◆ operator<<()

pipe & dx::usb::pipe< device_t >::operator<< ( const data_t & data)
inlineinherited

synchronous USB write request

◆ operator>>()

pipe & dx::usb::pipe< device_t >::operator>> ( data_t & data)
inlineinherited

synchronous USB read request

◆ outstanding()

bool dx::usb::platform::pipe< device<>, interface >::outstanding ( ) const
inlinenoexceptinherited

asynchronous requests in flight

Here is the caller graph for this function:

◆ poll()

bool dx::usb::platform::pipe< device<>, interface >::poll ( usb::isoc::result & result)
inlinenoexceptinherited

pulls the oldest completed isoc request's result

Here is the caller graph for this function:

◆ pump_out()

template<typename device_t, typename circular_t = dx::circular, template< typename ... > typename stream_t = dx::stream::stream>
DX_PRAGMA_IGNORE_RETURN_VALUE_END void dx::usb::stream::pipe< device_t, circular_t, stream_t >::pump_out ( )
inlineprotectednoexcept

data driven streaming out

Here is the call graph for this function:

◆ read()

pipe & dx::usb::platform::pipe< device<>, interface >::read ( void * data,
size_t size )
inlineinherited

synchronous USB read request

◆ receive()

pipe & dx::usb::platform::pipe< device<>, interface >::receive ( void * data,
size_t size )
inlineinherited

asynchronous USB read request

Here is the caller graph for this function:

◆ received()

template<typename device_t, typename circular_t = dx::circular, template< typename ... > typename stream_t = dx::stream::stream>
void dx::usb::stream::pipe< device_t, circular_t, stream_t >::received ( os_result status,
size_t size )
inlineoverrideprotectedvirtual

async read callback

Todo
evaluate non-transaction size transmit handling
Todo
log async write callback

generates timestamp

Reimplemented from dx::usb::platform::pipe< device_t, interface >.

Here is the call graph for this function:

◆ reset() [1/2]

DX_PRAGMA_IGNORE_RETURN_VALUE_END event & dx::event< user >::reset ( uint64_t count = 0)
inlineoverrideinherited

◆ reset() [2/2]

DX_PRAGMA_IGNORE_RETURN_VALUE_END event & dx::event< user >::reset ( uint64_t count = 0)
inlineoverrideinherited

◆ signal() [1/2]

super & dx::event< user >::signal ( uint64_t count = 1)
inlineoverrideinherited
Here is the caller graph for this function:

◆ signal() [2/2]

super & dx::event< user >::signal ( uint64_t count = 1)
inlineoverrideinherited

◆ signalled() [1/2]

DX_PRAGMA_IGNORE_RETURN_VALUE_END uint64_t dx::event< user >::signalled ( ) const
inlineinherited

◆ signalled() [2/2]

DX_PRAGMA_IGNORE_RETURN_VALUE_END uint64_t dx::event< user >::signalled ( ) const
inlineinherited

◆ submit() [1/2]

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

◆ submit() [2/2]

pipe & dx::usb::platform::pipe< device<>, interface >::submit ( const request< data_t > & request) const
inlineinherited

standard request to pipe

◆ sync_transfer()

template<typename device_t, typename circular_t = dx::circular, template< typename ... > typename stream_t = dx::stream::stream>
void dx::usb::stream::pipe< device_t, circular_t, stream_t >::sync_transfer ( uint64_t frame)
inlineprotectednoexcept

the sink's own feedback endpoint: collects the rate it states and turns it into this pipe's per frame line counts

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

◆ transfer()

template<typename device_t, typename circular_t = dx::circular, template< typename ... > typename stream_t = dx::stream::stream>
uint32_t dx::usb::stream::pipe< device_t, circular_t, stream_t >::transfer ( uint64_t frame)
inlineprotected

the group's tick at bus frame frame: collects this pipe's completions and resubmits each slot a round on, the free slot due a round ahead in frame order among them, then moves the data - out: fills that slot, in: takes the slot due lead frames behind, ahead of its completion; returns the lines moved

Here is the call graph for this function:

◆ transmitted()

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

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

Reimplemented from dx::usb::platform::pipe< device_t, interface >.

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

◆ try_conclude() [1/2]

bool dx::object::try_conclude ( )
inlinenoexceptinherited

atomically conclude()s if currently launched; returns whether this call did it

◆ try_conclude() [2/2]

bool dx::object::try_conclude ( )
inlinenoexceptinherited

atomically conclude()s if currently launched; returns whether this call did it

◆ try_launch() [1/2]

bool dx::object::try_launch ( )
inlineinherited

atomically launch()es if not already launched; returns whether this call did it

◆ try_launch() [2/2]

bool dx::object::try_launch ( )
inlineinherited

atomically launch()es if not already launched; returns whether this call did it

◆ wait() [1/4]

DX_PRAGMA_IGNORE_RETURN_VALUE_END super & dx::event< user >::wait ( bool reset = false)
inlineoverrideinherited

◆ wait() [2/4]

DX_PRAGMA_IGNORE_RETURN_VALUE_END super & dx::event< user >::wait ( bool reset = false)
inlineoverrideinherited

◆ wait() [3/4]

DX_PRAGMA_IGNORE_RETURN_VALUE_END bool dx::event< user >::wait ( const std::chrono::duration< rep_t, period_t > & timeout,
bool reset = false )
inlineinherited

wait with duration timeout returns true: signalled false: timed out

◆ wait() [4/4]

DX_PRAGMA_IGNORE_RETURN_VALUE_END bool dx::event< user >::wait ( const std::chrono::duration< rep_t, period_t > & timeout,
bool reset = false )
inlineinherited

wait with duration timeout returns true: signalled false: timed out

◆ write()

pipe & dx::usb::platform::pipe< device<>, interface >::write ( const void * data,
size_t size )
inlineinherited

synchronous USB write request

◆ pause

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

◆ usb::stream::group< device_t >

template<typename device_t, typename circular_t = dx::circular, template< typename ... > typename stream_t = dx::stream::stream>
friend class usb::stream::group< device_t >
friend

Member Data Documentation

◆ [struct]

struct { ... } dx::usb::platform::pipe< device<>, interface >::address

◆ [struct]

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

◆ attributes

const usb::endpoint::attributes& dx::usb::pipe< device_t >::attributes
inherited

◆ audio

◆ bRefresh

audio class endpoint: 2^bRefresh frames between two feedback values

◆ bSynchAddress

audio class endpoint: the isoc sync endpoint pacing this one, 0: none

◆ [class]

class { ... } ::buffer dx::usb::platform::pipe< device<>, interface >::buffer

◆ cache

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

◆ cadence_listener

template<typename device_t, typename circular_t = dx::circular, template< typename ... > typename stream_t = dx::stream::stream>
listener<dx::listen<std::function<void(const uint32_t&)> > > dx::usb::stream::pipe< device_t, circular_t, stream_t >::cadence_listener {this->samplerate.listen, {[this](const uint32_t& samplerate){cache.cadence= samplerate/ usb::isoc::ticks_per_sec;}}}
protected

the tick reads the cache, never the promoted

◆ circular

allocated once by initialize()/alloc(); released only by free()

◆ completed

usb::isoc::result dx::usb::platform::pipe< device<>, interface >::completed[max]
protectedinherited

isoc completions in callback order, filled by the runloop, drained by poll()

◆ completion

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

◆ control

kernel streaming: the driver's buffer switch bookkeeping, set by attach()

◆ count

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

◆ [struct]

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

◆ data

event_t dx::stream::stream< device_t, dx::circular, usb::pipe< device_t >, event<user> >::data[direction::directions]
inherited

event signalising data arrival(in) or draining(out)

◆ device [1/2]

device<>& dx::stream::object< device<> >::device
protectedinherited

◆ device [2/2]

device<>& dx::stream::object< device<> >::device
protectedinherited

◆ flush_hook [1/2]

std::function<void()> dx::stream::control< stream::object< device<> > >::flush_hook
protectedinherited

◆ flush_hook [2/2]

std::function<void()> dx::stream::control< dx::stream::object< device<> > >::flush_hook
protectedinherited

◆ format

the container this stream's ring runs: class and width its participants agreed on

A bus that negotiates it installs its own server; without one the request stands. The seed is the desc's own pin format, so a stream that nobody contradicts runs what it was declared with.

◆ frame

uint64_t ::USBD_ISO_PACKET_DESCRIPTOR* dx::usb::platform::pipe< device<>, interface >::frame
inherited

◆ granularity

◆ halt_hook [1/2]

std::function<void()> dx::stream::control< stream::object< device<> > >::halt_hook
protectedinherited

◆ halt_hook [2/2]

std::function<void()> dx::stream::control< dx::stream::object< device<> > >::halt_hook
protectedinherited

◆ handle

::WINUSB_INTERFACE_HANDLE dx::usb::platform::pipe< device<>, interface >::handle
inherited

◆ id

const decltype(desc::target.idx()) dx::stream::stream< device_t, dx::circular, usb::pipe< device_t >, event<user> >::id
inherited

◆ idx

uint8_t dx::usb::platform::pipe< device<>, interface >::idx
protectedinherited

◆ interface

interface & dx::usb::platform::pipe< device<>, interface >::interface
inherited

◆ isoc

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

◆ latency

◆ launched [1/2]

std::atomic<bool> dx::object::launched
inherited

◆ launched [2/2]

std::atomic<bool> dx::object::launched
inherited

◆ lead_listener

template<typename device_t, typename circular_t = dx::circular, template< typename ... > typename stream_t = dx::stream::stream>
listener<dx::listen<std::function<void(const uint32_t&)> > > dx::usb::stream::pipe< device_t, circular_t, stream_t >::lead_listener {this->device[*this].transport::safety_offset[this->target.direction].listen, {[this](const uint32_t& ticks){cache.lead= ticks;}}}
protected

a lead set mid-session moves the tick's slots along

◆ linesize

◆ max

constexpr auto dx::usb::platform::pipe< device<>, interface >::max
staticconstexprinherited

◆ micro_frames

unsigned int dx::usb::platform::pipe< device<>, interface >::micro_frames
inherited

◆ monitor

◆ process

::HANDLE dx::resource< invalid_t >::process
protectedinherited

◆ run_hook [1/2]

std::function<void()> dx::stream::control< stream::object< device<> > >::run_hook
protectedinherited

◆ run_hook [2/2]

std::function<void()> dx::stream::control< dx::stream::object< device<> > >::run_hook
protectedinherited

◆ rx

volatile unsigned int dx::usb::platform::pipe< device<>, interface >::rx
protectedinherited

◆ samplerate

decltype(device_t::samplerate) & dx::stream::stream< device_t, dx::circular, usb::pipe< device_t >, event<user> >::samplerate
inherited

◆ scope

constexpr auto dx::event< kernel >::scope
staticconstexprinherited

◆ sequence

uint64_t& dx::usb::platform::pipe< device<>, interface >::sequence
inherited

◆ start [1/2]

◆ start [2/2]

◆ started [1/2]

promoted<bool> dx::stream::control< stream::object< device<> > >::started
inherited

◆ started [2/2]

promoted<bool> dx::stream::control< dx::stream::object< device<> > >::started
inherited

◆ status

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

streaming status for observer thread

◆ submit

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

◆ [struct]

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

◆ this

return* dx::usb::platform::pipe< device<>, interface >::this
inherited

◆ tick

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

◆ ticking

the tick's own view of this stream's session: set by the run hook once the ring stands, cleared by the halt hook before the session ends - a plain flag, the tick must never block on a promoted's transition

◆ ticks

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

◆ [struct]

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

◆ try

size_t size dx::usb::platform::pipe< device<>, interface >::try
inherited

◆ tx

volatile unsigned int dx::usb::platform::pipe< device<>, interface >::tx
protectedinherited

◆ [struct]

struct { ... } dx::usb::platform::pipe< device<>, interface >::winusb

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.