dxd - dynax driver framework 3.0.2
cross platform open source driver development framework
Loading...
Searching...
No Matches
dxd::streaming::device< super_device_t, desc_t, clock_server_t > Class Template Reference

generic streaming device: the control interface every bus's clients share More...

#include <dxd_stream_device.h>

Inheritance diagram for dxd::streaming::device< super_device_t, desc_t, clock_server_t >:
Collaboration diagram for dxd::streaming::device< super_device_t, desc_t, clock_server_t >:

Classes

class  client
 control client: the platform's client with this device's streaming state More...
class  ring
 the ring one stream streams through, sized by the opening client More...

Public Types

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

Public Member Functions

virtual desc_t::configuration align(const typename desc_t::configuration& value, const typename desc_t::configuration &)
 a configuration the device can run: every stream's index within its configurations, one past them the stream off - a bus device narrows it to what its bus carries
virtual uint64_t budget(const typename desc_t::configuration &)
 the periodic bus time the configuration takes, in ns - a bus device with a periodic budget states it
super::client* client_create() override
template<typename... args_t>
 device(clock_server_t&& server, args_t&&... args)
template<typename target_t>
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
virtual ring* ring_create(unsigned int idx, size_t size)
 the ring of one stream, sized in bytes: a bus device returns its own ring type, the stream's endpoint on it
 ~device() override

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{broadcast, configuration_server<device_t>{*this}}
 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{broadcast, iosize_server<device_t>{*this}}
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{broadcast, samplerate_server<device_t>{*this}}
promoted<uint32_t, clock_server_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{sizeof(desc_t::stream)/ sizeof(desc_t::stream[0])}
 the desc's stream capacity, as its array carries it

Protected Member Functions

uint32_t blocks()
 the domain's cycle in ticks: the block a client of its iosize moves per switch
auto& clock_desc()
 the desc's single clock domain - the buses served here have exactly one
template<typename value_t, typename server_t>
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 uint32_t rate(uint32_t value)
 the rate the domain takes: a bus that sets its device's clock hands the rate on and answers what the device took
virtual void transported(uint32_t, uint32_t)
 a bus running the transport takes a setting on (transport_server)

Protected Attributes

desc_t desc{}

Friends

struct configuration_server<device_t>
struct iosize_server<device_t>
struct offset_server<device_t>
struct samplerate_server<device_t>
template<typename, typename>
class streaming::client
struct transport_server<device_t>

Detailed Description

template<typename super_device_t, typename desc_t, typename clock_server_t>
class dxd::streaming::device< super_device_t, desc_t, clock_server_t >

generic streaming device: the control interface every bus's clients share

Answers the device and stream IOCTLs of dx::proxy::stream::device from promoted values, leaving the bus its streams and its clock: super_device_t is the platform's device(dxd::platform::device or dxd::kmdf::device, each with its client), clock_server_t the functor running and halting the concrete clock as the start reference count leaves and reaches zero.

Member Typedef Documentation

◆ device_t

template<typename super_device_t, typename desc_t, typename clock_server_t>
typedef device<super_device_t, desc_t, clock_server_t> dxd::streaming::device<super_device_t, desc_t, clock_server_t>::device_t

◆ target

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

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

Constructor & Destructor Documentation

◆ device()

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

◆ ~device()

template<typename super_device_t, typename desc_t, typename clock_server_t>
dxd::streaming::device<super_device_t, desc_t, clock_server_t>::~device()
inlineoverride

Member Function Documentation

◆ align()

template<typename super_device_t, typename desc_t, typename clock_server_t>
virtual desc_t::configuration dxd::streaming::device<super_device_t, desc_t, clock_server_t>::align(const typename desc_t::configuration& value, const typename desc_t::configuration&)
inlinevirtual

a configuration the device can run: every stream's index within its configurations, one past them the stream off - a bus device narrows it to what its bus carries

Reimplemented in dxd::usb::stream::device< super_device_t, desc_t >.

◆ blocks()

template<typename super_device_t, typename desc_t, typename clock_server_t>
uint32_t dxd::streaming::device<super_device_t, desc_t, clock_server_t>::blocks()
inlineprotected

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

◆ budget()

template<typename super_device_t, typename desc_t, typename clock_server_t>
virtual uint64_t dxd::streaming::device<super_device_t, desc_t, clock_server_t>::budget(const typename desc_t::configuration&)
inlinevirtual

the periodic bus time the configuration takes, in ns - a bus device with a periodic budget states it

Reimplemented in dxd::usb::stream::device< super_device_t, desc_t >.

◆ client_create()

template<typename super_device_t, typename desc_t, typename clock_server_t>
super::client* dxd::streaming::device<super_device_t, desc_t, clock_server_t>::client_create()
inlineoverride

◆ clock_desc()

template<typename super_device_t, typename desc_t, typename clock_server_t>
auto& dxd::streaming::device<super_device_t, desc_t, clock_server_t>::clock_desc()
inlineprotected

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

◆ exchange()

template<typename super_device_t, typename desc_t, typename clock_server_t>
template<typename value_t, typename server_t>
os_result dxd::streaming::device<super_device_t, desc_t, clock_server_t>::exchange(promoted<value_t, server_t>& value, const void* in, size_t size_in, void* out, size_t size_out, size_t& size)
inlineprotected

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() [1/2]

template<typename super_device_t, typename desc_t, typename clock_server_t>
template<typename target_t>
int dxd::streaming::device<super_device_t, desc_t, clock_server_t>::find(const target_t& target) const
inline

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]

template<typename super_device_t, typename desc_t, typename clock_server_t>
int dxd::streaming::device<super_device_t, desc_t, clock_server_t>::find(uint64_t id) const
inline

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

◆ format()

template<typename super_device_t, typename desc_t, typename clock_server_t>
auto& dxd::streaming::device<super_device_t, desc_t, clock_server_t>::format(unsigned int idx)
inline

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

◆ granularity()

template<typename super_device_t, typename desc_t, typename clock_server_t>
uint32_t dxd::streaming::device<super_device_t, desc_t, clock_server_t>::granularity()
inlineprotected

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

◆ ioctl()

template<typename super_device_t, typename desc_t, typename clock_server_t>
os_result dxd::streaming::device<super_device_t, desc_t, clock_server_t>::ioctl(unsigned int ioctl, const void* in, size_t size_in, void* out, size_t size_out, size_t& size)
inlineoverride

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

◆ open() [1/2]

template<typename super_device_t, typename desc_t, typename clock_server_t>
os_result dxd::streaming::device<super_device_t, desc_t, clock_server_t>::open(unsigned int idx)
inline

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

◆ open() [2/2]

template<typename super_device_t, typename desc_t, typename clock_server_t>
os_result dxd::streaming::device<super_device_t, desc_t, clock_server_t>::open(unsigned int idx, uint32_t linesize, uint32_t lines, uint32_t slack= 0, uint32_t widest= 0)
inline

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

◆ operator ()()

template<typename super_device_t, typename desc_t, typename clock_server_t>
const auto* dxd::streaming::device<super_device_t, desc_t, clock_server_t>::operator ()(const struct desc_t::stream& stream)
inline

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

◆ rate()

template<typename super_device_t, typename desc_t, typename clock_server_t>
virtual uint32_t dxd::streaming::device<super_device_t, desc_t, clock_server_t>::rate(uint32_t value)
inlineprotectedvirtual

the rate the domain takes: a bus that sets its device's clock hands the rate on and answers what the device took

Reimplemented in dxd::usb::stream::device< super_device_t, desc_t >.

◆ reset()

template<typename super_device_t, typename desc_t, typename clock_server_t>
void dxd::streaming::device<super_device_t, desc_t, clock_server_t>::reset(int64_t timestamp)
inline

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

◆ ring_create()

template<typename super_device_t, typename desc_t, typename clock_server_t>
virtual ring* dxd::streaming::device<super_device_t, desc_t, clock_server_t>::ring_create(unsigned int idx, size_t size)
inlinevirtual

the ring of one stream, sized in bytes: a bus device returns its own ring type, the stream's endpoint on it

◆ transported()

template<typename super_device_t, typename desc_t, typename clock_server_t>
virtual void dxd::streaming::device<super_device_t, desc_t, clock_server_t>::transported(uint32_t, uint32_t)
inlineprotectedvirtual

a bus running the transport takes a setting on (transport_server)

Reimplemented in dxd::usb::stream::device< super_device_t, desc_t >.

◆ configuration_server<device_t>

template<typename super_device_t, typename desc_t, typename clock_server_t>
friend struct configuration_server<device_t>
friend

◆ iosize_server<device_t>

template<typename super_device_t, typename desc_t, typename clock_server_t>
friend struct iosize_server<device_t>
friend

◆ offset_server<device_t>

template<typename super_device_t, typename desc_t, typename clock_server_t>
friend struct offset_server<device_t>
friend

◆ samplerate_server<device_t>

template<typename super_device_t, typename desc_t, typename clock_server_t>
friend struct samplerate_server<device_t>
friend

◆ streaming::client

template<typename super_device_t, typename desc_t, typename clock_server_t>
template<typename, typename>
friend class streaming::client
friend

◆ transport_server<device_t>

template<typename super_device_t, typename desc_t, typename clock_server_t>
friend struct transport_server<device_t>
friend

Member Data Documentation

◆ broadcast

template<typename super_device_t, typename desc_t, typename clock_server_t>
broadcast dxd::streaming::device<super_device_t, desc_t, clock_server_t>::broadcast

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

◆ configuration

template<typename super_device_t, typename desc_t, typename clock_server_t>
promoted<typename desc_t::configuration, configuration_server<device_t>> dxd::streaming::device<super_device_t, desc_t, clock_server_t>::configuration{broadcast, configuration_server<device_t>{*this}}

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

◆ desc

template<typename super_device_t, typename desc_t, typename clock_server_t>
desc_t dxd::streaming::device<super_device_t, desc_t, clock_server_t>::desc{}
protected

◆ hw

template<typename super_device_t, typename desc_t, typename clock_server_t>
class domain dxd::streaming::device<super_device_t, desc_t, clock_server_t>::hw

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

◆ io

template<typename super_device_t, typename desc_t, typename clock_server_t>
dxd::stream* dxd::streaming::device<super_device_t, desc_t, clock_server_t>::io[streams]{}

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

◆ iosize

template<typename super_device_t, typename desc_t, typename clock_server_t>
promoted<uint32_t, iosize_server<device_t>> dxd::streaming::device<super_device_t, desc_t, clock_server_t>::iosize{broadcast, iosize_server<device_t>{*this}}

◆ monitor

template<typename super_device_t, typename desc_t, typename clock_server_t>
class multichannel::stream<>::clock::monitor dxd::streaming::device<super_device_t, desc_t, clock_server_t>::monitor

performance counters, allocated with the first client asking for them

◆ safety_offset

template<typename super_device_t, typename desc_t, typename clock_server_t>
promoted<uint32_t, offset_server<device_t>> dxd::streaming::device<super_device_t, desc_t, clock_server_t>::safety_offset[dx::stream::direction::directions]
Initial value:
{
broadcast signalization of participating linked event items
Definition dxd_sync.h:371
broadcast broadcast
its values' listeners: every client's, woken on a commit of any of them
Definition dxd_stream_device.h:300
@ in
Definition dx_stream.h:396
@ out
Definition dx_stream.h:396
the client side safety offset in clock ticks: it is committed and then handed to the domain's registe...
Definition dxd_stream_device.h:193

◆ samplerate

template<typename super_device_t, typename desc_t, typename clock_server_t>
promoted<uint32_t, samplerate_server<device_t>> dxd::streaming::device<super_device_t, desc_t, clock_server_t>::samplerate{broadcast, samplerate_server<device_t>{*this}}

◆ started

template<typename super_device_t, typename desc_t, typename clock_server_t>
promoted<uint32_t, clock_server_t> dxd::streaming::device<super_device_t, desc_t, clock_server_t>::started

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

◆ streams

template<typename super_device_t, typename desc_t, typename clock_server_t>
unsigned int dxd::streaming::device<super_device_t, desc_t, clock_server_t>::streams{sizeof(desc_t::stream)/ sizeof(desc_t::stream[0])}
staticconstexpr

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

◆ transport

template<typename super_device_t, typename desc_t, typename clock_server_t>
promoted<uint32_t, transport_server<device_t>> dxd::streaming::device<super_device_t, desc_t, clock_server_t>::transport[3]
Initial value:
{
friend struct transport_server< device_t >
Definition dxd_stream_device.h:283
the transport's settings in the dx::stream::setting order - its wait strategy, its lead out and in - ...
Definition dxd_stream_device.h:213

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