dxd - dynax driver framework 3.0.2
cross platform open source driver development framework
Loading...
Searching...
No Matches
dxd::usb::stream::device< super_device_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< super_device_t, desc_t >:
Collaboration diagram for dxd::usb::stream::device< super_device_t, desc_t >:

Public Types

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

Public Member Functions

super::client* client_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& targettarget) const
 the stream a client addresses, as the desc spells its target
int find(uint64_t id) const
 the stream carrying the given id - what a client knows its stream by (dx::stream::stream::id)
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 lines, uint32_t slack= 0, uint32_t widest= 0)
 creates the stream's ring on its first open; the device holds its own reference, so the ring outlives its clients for the endpoints ticking on it. Its size is a session's lines, the allocation keeps the slack past them - the wrap's room, as dx::stream::stream::alloc() keeps it - in the widest line its stream configurations take
const auto* operator ()(const struct desc_t::stream& stream)
 the stream configuration the device runs the stream in, nullptr where it runs none: the stream is one of the desc's
void reset(int64_t timestamp)
 the host's session start: every ring begins at its size, in silence, without a transport - the participants anchor to it as it stands

Public Attributes

broadcast broadcast
 its values' listeners: every client's, woken on a commit of any of them
promoted<typename desc_t::configuration, configuration_server<device_t>> configuration
 per stream the stream configuration the device runs it in, the richest by default
class domain hw
 the DAW clock: every client rides on it with its own buffer switch event
dxd::stream* io [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, offset_server<device_t>> safety_offset [dx::stream::direction::directions]
promoted<uint32_t, samplerate_server<device_t>> samplerate
promoted<uint32_t, clock_server<super_device_t, desc_t>> started
 started streams over all clients: the clock domain runs while this is not zero
promoted<uint32_t, transport_server<device_t>> transport [3]

Static Public Attributes

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

Protected Member Functions

desc_t::configuration align(const typename desc_t::configuration& value, const typename desc_t::configuration& current) override
 the configuration the device's bus carries: its USB configuration, per stream what the rate and the periodic budget leave (dx::usb::align) - the rate as it stands, never asked from inside its own server
uint32_t blocks()
 the domain's cycle in ticks: the block a client of its iosize moves per switch
uint64_t budget(const typename desc_t::configuration& value) override
 the periodic bus time the configuration takes, in ns: to hold against budget(), what the bus offers
auto& clock_desc()
 the desc's single clock domain - the buses served here have exactly one
os_result exchange(promoted<value_t, server_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 dx::usb::endpoint& targettarget, uint32_t& rate, bool set)
 the sampling frequency request to an endpoint, in the alternate setting its session's charge selected - the endpoint exists there alone: sets the rate, or reads it
uint32_t rate(uint32_t value) override
 the domain's rate: every isoc pipeline takes it for its sessions, a rated endpoint at its session's charge (dx::usb::audio::rate)
virtual os_result run()
 the session's start and end, from started's server: the group's thread; an endpoint owner adds its own. A vanished device runs no session
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
void transported(uint32_t setting, uint32_t value) override
 the transport's settings reach a running session: the group's wait, the isoc pipes' leads of the setting's direction
virtual size_t vendor(unsigned int, uint8_t *, size_t size, bool data)
 a bulk transaction's wire bytes past its fill (out; data false: its idle transaction as the session starts and ends) and ahead of its take (in), the stream's: the bytes the ring takes, 0 where the device wrote them itself

Protected Attributes

desc_t desc
dxd::mutex mutex
uint32_t rated{}

Friends

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

Detailed Description

template<typename super_device_t, typename desc_t>
class dxd::usb::stream::device< super_device_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<super_device_t, desc_t, clock_server<super_device_t, desc_t>> dxd::streaming::device<super_device_t, desc_t, clock_server<super_device_t, desc_t>>::device_t
inherited

◆ target

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

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

Constructor & Destructor Documentation

◆ device()

template<typename super_device_t, typename desc_t>
template<typename... args_t>
dxd::usb::stream::device<super_device_t, desc_t>::device(args_t&&... args)
inline
Here is the caller graph for this function:

Member Function Documentation

◆ align()

template<typename super_device_t, typename desc_t>
desc_t::configuration dxd::usb::stream::device<super_device_t, desc_t>::align(const typename desc_t::configuration& value, const typename desc_t::configuration& current)
inlineoverrideprotectedvirtual

the configuration the device's bus carries: its USB configuration, per stream what the rate and the periodic budget leave (dx::usb::align) - the rate as it stands, never asked from inside its own server

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

Here is the call graph for this function:

◆ blocks()

uint32_t dxd::streaming::device<super_device_t, desc_t, clock_server<super_device_t, desc_t>>::blocks()
inlineprotectedinherited

the domain's cycle in ticks: the block a client of its iosize moves per switch

Here is the call graph for this function:

◆ budget()

template<typename super_device_t, typename desc_t>
uint64_t dxd::usb::stream::device<super_device_t, desc_t>::budget(const typename desc_t::configuration& value)
inlineoverrideprotectedvirtual

the periodic bus time the configuration takes, in ns: to hold against budget(), what the bus offers

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

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

◆ client_create()

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

◆ clock_desc()

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

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

Here is the caller graph for this function:

◆ conclude()

template<typename super_device_t, typename desc_t>
void dxd::usb::stream::device<super_device_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<super_device_t, desc_t, clock_server<super_device_t, desc_t>>::exchange(promoted<value_t, server_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.

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

◆ find() [1/2]

int dxd::streaming::device<super_device_t, desc_t, clock_server<super_device_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.

◆ find() [2/2]

int dxd::streaming::device<super_device_t, desc_t, clock_server<super_device_t, desc_t>>::find(uint64_t id) const
inlineinherited

the stream carrying the given id - what a client knows its stream by (dx::stream::stream::id)

◆ format()

auto& dxd::streaming::device<super_device_t, desc_t, clock_server<super_device_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<super_device_t, desc_t, clock_server<super_device_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 super_device_t, typename desc_t>
virtual void dxd::usb::stream::device<super_device_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<super_device_t, desc_t, clock_server<super_device_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

dx::ioctl::stream::configuration: the device's configuration, a wish in, what it runs out

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

◆ launch()

template<typename super_device_t, typename desc_t>
os_result dxd::usb::stream::device<super_device_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<super_device_t, desc_t, clock_server<super_device_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<super_device_t, desc_t, clock_server<super_device_t, desc_t>>::open(unsigned int idx, uint32_t linesize, uint32_t lines, uint32_t slack= 0, uint32_t widest= 0)
inlineinherited

creates the stream's ring on its first open; the device holds its own reference, so the ring outlives its clients for the endpoints ticking on it. Its size is a session's lines, the allocation keeps the slack past them - the wrap's room, as dx::stream::stream::alloc() keeps it - in the widest line its stream configurations take

Here is the call graph for this function:

◆ operator ()()

const auto* dxd::streaming::device<super_device_t, desc_t, clock_server<super_device_t, desc_t>>::operator ()(const struct desc_t::stream& stream)
inlineinherited

the stream configuration the device runs the stream in, nullptr where it runs none: the stream is one of the desc's

◆ rate() [1/2]

template<typename super_device_t, typename desc_t>
os_result dxd::usb::stream::device<super_device_t, desc_t>::rate(const dx::usb::endpoint& target, uint32_t& rate, bool set)
inlineprotected

the sampling frequency request to an endpoint, in the alternate setting its session's charge selected - the endpoint exists there alone: 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 super_device_t, typename desc_t>
uint32_t dxd::usb::stream::device<super_device_t, desc_t>::rate(uint32_t value)
inlineoverrideprotectedvirtual

the domain's rate: every isoc pipeline takes it for its sessions, a rated endpoint at its session's charge (dx::usb::audio::rate)

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

Here is the call graph for this function:

◆ reset()

void dxd::streaming::device<super_device_t, desc_t, clock_server<super_device_t, desc_t>>::reset(int64_t timestamp)
inlineinherited

the host's session start: every ring begins at its size, in silence, without a transport - the participants anchor to it as it stands

Here is the call graph for this function:

◆ run()

template<typename super_device_t, typename desc_t>
virtual os_result dxd::usb::stream::device<super_device_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. A vanished device runs no session

Here is the call graph for this function:

◆ tick()

template<typename super_device_t, typename desc_t>
virtual void dxd::usb::stream::device<super_device_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

Here is the call graph for this function:

◆ transported()

template<typename super_device_t, typename desc_t>
void dxd::usb::stream::device<super_device_t, desc_t>::transported(uint32_t setting, uint32_t value)
inlineoverrideprotectedvirtual

the transport's settings reach a running session: the group's wait, the isoc pipes' leads of the setting's direction

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

Here is the call graph for this function:

◆ vendor()

template<typename super_device_t, typename desc_t>
virtual size_t dxd::usb::stream::device<super_device_t, desc_t>::vendor(unsigned int, uint8_t*, size_t size, bool data)
inlineprotectedvirtual

a bulk transaction's wire bytes past its fill (out; data false: its idle transaction as the session starts and ends) and ahead of its take (in), the stream's: the bytes the ring takes, 0 where the device wrote them itself

◆ clock_server<super_device_t, desc_t>

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

◆ group

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

◆ pipe

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

Member Data Documentation

◆ broadcast

broadcast dxd::streaming::device<super_device_t, desc_t, clock_server<super_device_t, desc_t>>::broadcast
inherited

its values' listeners: every client's, woken on a commit of any of them

◆ configuration

promoted<typename desc_t::configuration, configuration_server<device_t>> dxd::streaming::device<super_device_t, desc_t, clock_server<super_device_t, desc_t>>::configuration
inherited

per stream the stream configuration the device runs it in, the richest by default

◆ desc

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

◆ hw

class domain dxd::streaming::device<super_device_t, desc_t, clock_server<super_device_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<super_device_t, desc_t, clock_server<super_device_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<super_device_t, desc_t, clock_server<super_device_t, desc_t>>::iosize
inherited

◆ monitor

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

performance counters, allocated with the first client asking for them

◆ mutex

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

serializes a pipe's binding against a session's run and the domain's rate

◆ rated

template<typename super_device_t, typename desc_t>
uint32_t dxd::usb::stream::device<super_device_t, desc_t>::rated{}
protected

the streams whose endpoints take the sampling frequency control, a bit each (dx::usb::audio::rated)

◆ safety_offset

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

◆ samplerate

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

◆ started

promoted<uint32_t, clock_server<super_device_t, desc_t>> dxd::streaming::device<super_device_t, desc_t, clock_server<super_device_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<super_device_t, desc_t, clock_server<super_device_t, desc_t>>::streams
staticconstexprinherited

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

◆ transport

promoted<uint32_t, transport_server<device_t>> dxd::streaming::device<super_device_t, desc_t, clock_server<super_device_t, desc_t>>::transport[3]
inherited

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