dxd - dynax driver framework 3.0.0d222
cross platform open source driver development framework
Loading...
Searching...
No Matches
dxd::usb::stream::device< base_t, desc_t > Class Template Reference

USB streaming device: the streaming device over the platform's USB device, its streams the endpoints' rings, its clock the bus frame tick. More...

#include <dxd_usb_stream.h>

Inheritance diagram for dxd::usb::stream::device< base_t, desc_t >:
Collaboration diagram for dxd::usb::stream::device< base_t, desc_t >:

Public Types

typedef device< base_t, desc_t, clock_server< base_t, desc_t > > device_t
typedef decltype(desc_t{}.stream[0].targettarget
 the bus's stream address, as the clients spell it

Public Member Functions

dxd::clientclient_create () override
void conclude () override
 the session ends and the device's rings go while the bus below still answers: their pipes abort on a configured device
template<typename... args_t>
 device (args_t &&... args)
int find (const target_t &target) const
 the stream a client addresses, as the desc spells its target
auto & format (unsigned int idx)
 the format the given stream's ring runs: a participant assigns its own and reads what was adopted
os_result ioctl (unsigned int ioctl, const void *in, size_t size_in, void *out, size_t size_out, size_t &size) override
os_result open (unsigned int idx)
 a kernel endpoint's open: the ring sized as dx::stream::stream::initialize sizes it - a clock domain's stream by ticks of its interval, another by transactions
os_result open (unsigned int idx, uint32_t linesize, uint32_t buffers)
 creates the stream's ring on the first client opening it; the device holds its own reference, so the ring outlives its clients for the endpoints ticking on it
 ~device () override

Public Attributes

class domain hw
 the DAW clock: every client rides on it with its own buffer switch event
dxd::streamio [streams]
 the shared ring of each stream, allocated with the first client opening it
promoted< uint32_t, iosize_server< device_t > > iosize
class multichannel::stream<>::clock::monitor monitor
 performance counters, allocated with the first client asking for them
promoted< uint32_t, opened_server< device_t > > opened
 opened streams over all participants: an open stream holds the domain's rate and iosize like a started one, only the clock waits for a start
promoted< uint32_t, offset_server< device_t > > safety_offset [dx::stream::direction::directions]
promoted< uint32_t, samplerate_server< device_t > > samplerate
promoted< uint32_t, clock_server< base_t, desc_t > > started
 started streams over all clients: the clock domain runs while this is not zero

Static Public Attributes

static constexpr unsigned int streams
 the desc's stream capacity, as its array carries it

Protected Member Functions

auto & clock_desc ()
 the desc's single clock domain - the buses served here have exactly one
os_result exchange (promoted_t &value, const void *in, size_t size_in, void *out, size_t size_out, size_t &size)
 promoted value as a get (no input) or set-and-read-back IOCTL
uint32_t granularity ()
 samples per clock tick, the unit both the tick and iosize are aligned to
virtual void halt ()
os_result launch () override
 a desc without streams takes them from the selected configuration's audio class descriptors
os_result rate (const struct desc_t::stream &stream, uint32_t &rate, bool set)
 the sampling frequency request to a stream's endpoint, which exists in its own alternate setting only: sets the rate, or reads it
uint32_t rate (uint32_t value) override
 the domain's rate: every rated endpoint takes it, the first answering the read counts
bool rated (const struct desc_t::stream &stream)
 the stream's endpoint takes the sampling frequency control: its class endpoint descriptor states it - or, no endpoint stating it, every one is offered the request (ADC1)
virtual os_result run ()
 the session's start and end, from started's server: the group's thread; an endpoint owner adds its own
virtual void tick (uint32_t lines, uint64_t frame, int64_t timestamp)
 the reference stream advanced, under the mutex: the clock domain follows; an endpoint owner moves its endpoints first

Protected Attributes

desc_t desc
dxd::mutex mutex
char puid [0x80]

Friends

struct clock_server< base_t, desc_t >
template<typename>
class group
template<typename>
class pipe

Detailed Description

template<typename base_t, typename desc_t>
class dxd::usb::stream::device< base_t, desc_t >

USB streaming device: the streaming device over the platform's USB device, its streams the endpoints' rings, its clock the bus frame tick.

Member Typedef Documentation

◆ device_t

typedef device<base_t, desc_t, clock_server< base_t, desc_t >> dxd::streaming::device< base_t, desc_t, clock_server< base_t, desc_t > >::device_t
inherited

◆ target

typedef decltype(desc_t{}.stream[0].target) dxd::streaming::device< base_t, desc_t, clock_server< base_t, desc_t > >::target
inherited

the bus's stream address, as the clients spell it

Constructor & Destructor Documentation

◆ device()

template<typename base_t, typename desc_t>
template<typename... args_t>
dxd::usb::stream::device< base_t, desc_t >::device ( args_t &&... args)
inline

◆ ~device()

template<typename base_t, typename desc_t>
dxd::usb::stream::device< base_t, desc_t >::~device ( )
inlineoverride

Member Function Documentation

◆ client_create()

dxd::client * dxd::streaming::device< base_t, desc_t, clock_server< base_t, desc_t > >::client_create ( )
inlineoverrideinherited

◆ clock_desc()

auto & dxd::streaming::device< base_t, desc_t, clock_server< base_t, desc_t > >::clock_desc ( )
inlineprotectedinherited

the desc's single clock domain - the buses served here have exactly one

◆ conclude()

template<typename base_t, typename desc_t>
void dxd::usb::stream::device< base_t, desc_t >::conclude ( )
inlineoverride

the session ends and the device's rings go while the bus below still answers: their pipes abort on a configured device

Here is the call graph for this function:

◆ exchange()

os_result dxd::streaming::device< base_t, desc_t, clock_server< base_t, desc_t > >::exchange ( promoted_t & value,
const void * in,
size_t size_in,
void * out,
size_t size_out,
size_t & size )
inlineprotectedinherited

promoted value as a get (no input) or set-and-read-back IOCTL

dx::stream::clock_value carries the clock domain alongside the value; the domain is not evaluated - the buses served here have a single one.

◆ find()

int dxd::streaming::device< base_t, desc_t, clock_server< base_t, desc_t > >::find ( const target_t & target) const
inlineinherited

the stream a client addresses, as the desc spells its target

The target is the bus's own stream address - a direction here, an endpoint on USB - so matching it against the desc is what every bus has in common.

◆ format()

auto & dxd::streaming::device< base_t, desc_t, clock_server< base_t, desc_t > >::format ( unsigned int idx)
inlineinherited

the format the given stream's ring runs: a participant assigns its own and reads what was adopted

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

◆ granularity()

uint32_t dxd::streaming::device< base_t, desc_t, clock_server< base_t, desc_t > >::granularity ( )
inlineprotectedinherited

samples per clock tick, the unit both the tick and iosize are aligned to

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

◆ halt()

template<typename base_t, typename desc_t>
virtual void dxd::usb::stream::device< base_t, desc_t >::halt ( )
inlineprotectedvirtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ioctl()

os_result dxd::streaming::device< base_t, desc_t, clock_server< base_t, desc_t > >::ioctl ( unsigned int ioctl,
const void * in,
size_t size_in,
void * out,
size_t size_out,
size_t & size )
inlineoverrideinherited

dx::ioctl::stream::enumerate: the device's whole desc_t

dx::ioctl::stream::desc: the desc as a settable value - the enumerated topology stands

dx::ioctl::stream::puid: persistent device UID

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

◆ launch()

template<typename base_t, typename desc_t>
os_result dxd::usb::stream::device< base_t, desc_t >::launch ( )
inlineoverrideprotected

a desc without streams takes them from the selected configuration's audio class descriptors

Here is the call graph for this function:

◆ open() [1/2]

os_result dxd::streaming::device< base_t, desc_t, clock_server< base_t, desc_t > >::open ( unsigned int idx)
inlineinherited

a kernel endpoint's open: the ring sized as dx::stream::stream::initialize sizes it - a clock domain's stream by ticks of its interval, another by transactions

Here is the call graph for this function:

◆ open() [2/2]

os_result dxd::streaming::device< base_t, desc_t, clock_server< base_t, desc_t > >::open ( unsigned int idx,
uint32_t linesize,
uint32_t buffers )
inlineinherited

creates the stream's ring on the first client opening it; the device holds its own reference, so the ring outlives its clients for the endpoints ticking on it

Here is the call graph for this function:

◆ rate() [1/2]

template<typename base_t, typename desc_t>
os_result dxd::usb::stream::device< base_t, desc_t >::rate ( const struct desc_t::stream & stream,
uint32_t & rate,
bool set )
inlineprotected

the sampling frequency request to a stream's endpoint, which exists in its own alternate setting only: sets the rate, or reads it

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

◆ rate() [2/2]

template<typename base_t, typename desc_t>
uint32_t dxd::usb::stream::device< base_t, desc_t >::rate ( uint32_t value)
inlineoverrideprotectedvirtual

the domain's rate: every rated endpoint takes it, the first answering the read counts

Reimplemented from dxd::streaming::device< usb::device< base_t >, desc_t, clock_server< base_t, desc_t > >.

Here is the call graph for this function:

◆ rated()

template<typename base_t, typename desc_t>
bool dxd::usb::stream::device< base_t, desc_t >::rated ( const struct desc_t::stream & stream)
inlineprotected

the stream's endpoint takes the sampling frequency control: its class endpoint descriptor states it - or, no endpoint stating it, every one is offered the request (ADC1)

Here is the caller graph for this function:

◆ run()

template<typename base_t, typename desc_t>
virtual os_result dxd::usb::stream::device< base_t, desc_t >::run ( )
inlineprotectedvirtual

the session's start and end, from started's server: the group's thread; an endpoint owner adds its own

Here is the call graph for this function:

◆ tick()

template<typename base_t, typename desc_t>
virtual void dxd::usb::stream::device< base_t, desc_t >::tick ( uint32_t lines,
uint64_t frame,
int64_t timestamp )
inlineprotectedvirtual

the reference stream advanced, under the mutex: the clock domain follows; an endpoint owner moves its endpoints first

◆ clock_server< base_t, desc_t >

template<typename base_t, typename desc_t>
friend struct clock_server< base_t, desc_t >
friend

◆ group

template<typename base_t, typename desc_t>
template<typename>
friend class group
friend

◆ pipe

template<typename base_t, typename desc_t>
template<typename>
friend class pipe
friend

Member Data Documentation

◆ desc

desc_t dxd::streaming::device< base_t, desc_t, clock_server< base_t, desc_t > >::desc
protectedinherited

◆ hw

class domain dxd::streaming::device< base_t, desc_t, clock_server< base_t, desc_t > >::hw
inherited

the DAW clock: every client rides on it with its own buffer switch event

◆ io

dxd::stream* dxd::streaming::device< base_t, desc_t, clock_server< base_t, desc_t > >::io[streams]
inherited

the shared ring of each stream, allocated with the first client opening it

◆ iosize

promoted<uint32_t, iosize_server<device_t> > dxd::streaming::device< base_t, desc_t, clock_server< base_t, desc_t > >::iosize
inherited

◆ monitor

class multichannel::stream<>::clock::monitor dxd::streaming::device< base_t, desc_t, clock_server< base_t, desc_t > >::monitor
inherited

performance counters, allocated with the first client asking for them

◆ mutex

template<typename base_t, typename desc_t>
dxd::mutex dxd::usb::stream::device< base_t, desc_t >::mutex
protected

serializes the tick against the clients' stream membership

◆ opened

promoted<uint32_t, opened_server<device_t> > dxd::streaming::device< base_t, desc_t, clock_server< base_t, desc_t > >::opened
inherited

opened streams over all participants: an open stream holds the domain's rate and iosize like a started one, only the clock waits for a start

◆ puid

char dxd::streaming::device< base_t, desc_t, clock_server< base_t, desc_t > >::puid[0x80]
protectedinherited

◆ safety_offset

promoted<uint32_t, offset_server<device_t> > dxd::streaming::device< base_t, desc_t, clock_server< base_t, desc_t > >::safety_offset[dx::stream::direction::directions]
inherited

◆ samplerate

promoted<uint32_t, samplerate_server<device_t> > dxd::streaming::device< base_t, desc_t, clock_server< base_t, desc_t > >::samplerate
inherited

◆ started

promoted<uint32_t, clock_server< base_t, desc_t >> dxd::streaming::device< base_t, desc_t, clock_server< base_t, desc_t > >::started
inherited

started streams over all clients: the clock domain runs while this is not zero

◆ streams

unsigned int dxd::streaming::device< base_t, desc_t, clock_server< base_t, desc_t > >::streams
staticconstexprinherited

the desc's stream capacity, as its array carries it


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.