dxd - dynax driver framework
2691
cross platform open source driver development framework
|
USB stream. More...
#include <dxd_usb_stream.h>
Public Member Functions | |
void | free () |
frees circular backing store and frame buffers More... | |
os_result | initialize (const void *data, size_t size) |
IOKit memory initializer. More... | |
os_result | initialize (const void *data, size_t size) |
IOKit memory initializer. More... | |
os_result | initialize (const ::MDL *mdl) |
os_result | initialize (const ::MDL *mdl) |
os_result | initialize (void *data, size_t size) |
IOKit memory initializer. More... | |
os_result | initialize (void *data, size_t size) |
IOKit memory initializer. More... | |
os_result | initialize (const ::MDL *mdl, size_t offset, size_t size) |
os_result | initialize (const ::MDL *mdl, size_t offset, size_t size) |
os_result | initialize (::IOMemoryDescriptor *iokit_memory_descriptor) |
IOKit memory initializer. More... | |
os_result | initialize (::IOMemoryDescriptor *iokit_memory_descriptor) |
IOKit memory initializer. More... | |
os_result | initialize (::IOMemoryDescriptor *iokit_memory_descriptor, size_t offset, size_t size) |
IOKit memory initializer. More... | |
os_result | initialize (::IOMemoryDescriptor *iokit_memory_descriptor, size_t offset, size_t size) |
IOKit memory initializer. More... | |
os_result | initialize (::IOMemoryDescriptor *iokit_memory_descriptor, size_t offset=0) |
IOKit kernel map initializer. More... | |
os_result | initialize (size_t size, unsigned int limit=limit_t, unsigned int alignment=alignment_t, bool contigous=contigous_t) |
IOKit buffer initializer. More... | |
os_result | initialize (unsigned int line_size, unsigned int cycles, unsigned int sample_rate) |
creates circular backing store and frame buffers for isoc streaming More... | |
os_result | initialize (unsigned int buffers) |
creates circular backing store and frame buffers for non-isoc streaming More... | |
os_result | line_size (unsigned int line_size) |
sets the line_size More... | |
operator const ::IOMemoryDescriptor * () const | |
IOKit IOMemoryDescriptor* implicit cast. More... | |
operator const ::IOMemoryDescriptor * () const | |
IOKit IOMemoryDescriptor* implicit cast. More... | |
operator const ::IOMemoryMap * () const | |
operator const dx::circular * () const | |
operator dx::circular * () const | |
operator uint64_t () const | |
IOKit physical address (only relevant for contigous memory) More... | |
operator uint64_t () const | |
IOKit physical address (only relevant for contigous memory) More... | |
const dx::circular * | operator-> () const |
operator to use mapping like pointer More... | |
dx::circular * | operator-> () |
operator::IOMemoryDescriptor * () | |
operator::IOMemoryDescriptor * () | |
operator::IOMemoryMap * () | |
operator::MDL * () const | |
operator::MDL * () const | |
template<typename reference_t > | |
int | release (reference_t &reference) |
void | retain () |
os_result | sample_rate (dx::uint24 sample_rate) |
sets the sampling rate More... | |
dx::uint24 | sample_rate () const |
size_t | size () const |
IOKit memory size. More... | |
size_t | size () const |
IOKit memory size. More... | |
size_t | size () const |
kernel mapping size More... | |
os_result | start (bool force=false) override |
starts the USB streaming More... | |
os_result | stop (bool force=false) override |
stream (class usb_device &usb_device, const dx::stream::open< dx::usb::isoc > &open, int id) | |
USB isoc endpoint constructor. More... | |
stream (class usb_device &usb_device, const dx::stream::open< dx::usb::bulk > &open, int idx) | |
USB bulk/IRQ endpoint constructor. More... | |
os_result | synchronize () |
synchronizes to isoc device cycles More... | |
virtual | ~stream () |
stream destructor More... | |
Public Attributes | |
event | data |
data available event More... | |
event | gap |
gap (space) available event More... | |
atomic< int > | references =0 |
os_result | status =not_initialized |
Protected Attributes | |
dx::circular * | _vm |
kernel virtual address mapping More... | |
::IOMemoryMap * | iokit_memory_map |
Private Types | |
enum | priority { priority::low =LOW_PRIORITY, priority::realtime =LOW_REALTIME_PRIORITY, priority::high =HIGH_PRIORITY } |
Private Member Functions | |
os_result | prio (priority priority) |
os_result | run () |
IOKit process thread start. More... | |
os_result | run () |
Static Private Member Functions | |
static unsigned int | prio () |
static unsigned int | prio () |
Friends | |
struct | dx::circular |
USB stream.
Handling of high speed/low latency/high performance streams:
os_result | an error returned by the underlaying KPIs is reflected by the methods return value. The object status can be retrieved by the status member. |
|
inline |
USB isoc endpoint constructor.
Checks the underlaying pipe construction state,
usb_device | USB device |
open | stream metrics |
id | stream ID |
|
inline |
USB bulk/IRQ endpoint constructor.
Checks the underlaying pipe construction state,
check process creation status
usb_device | USB device |
open | stream metrics |
idx | stream ID |
|
inline |
stream destructor
|
inline |
frees circular backing store and frame buffers
stops any outstanding requests,
releases intermittent device frame buffer,
unmaps kernel mapping to backing store
and release backing store.
|
inherited |
IOKit memory initializer.
data | virtual base address of range to create memory descriptor from |
size | size of range to create memory descriptor from |
|
inherited |
IOKit memory initializer.
data | virtual base address of range to create memory descriptor from |
size | size of range to create memory descriptor from |
|
inlineinherited |
in contrast to an IOKit MemoryDescriptor MDLs do not support reference counting. take care when creating a dxd::memory from a dxd::buffer: although the dxd::memory holds an MDL to the buffer the buffer itself is not retained after the dxd::buffer is released!
|
inlineinherited |
in contrast to an IOKit MemoryDescriptor MDLs do not support reference counting. take care when creating a dxd::memory from a dxd::buffer: although the dxd::memory holds an MDL to the buffer the buffer itself is not retained after the dxd::buffer is released!
|
inherited |
IOKit memory initializer.
data | virtual base address of range to create memory descriptor from |
size | size of range to create memory descriptor from |
|
inherited |
IOKit memory initializer.
data | virtual base address of range to create memory descriptor from |
size | size of range to create memory descriptor from |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
IOKit memory initializer.
|
inlineinherited |
IOKit memory initializer.
|
inlineinherited |
IOKit memory initializer.
|
inlineinherited |
IOKit memory initializer.
|
inlineinherited |
IOKit kernel map initializer.
map<kernel> maps an IOMemoryDescriptor (typically cast of a dxd::memory or buffer class) into the kernel address space.
https://developer.apple.com/library/content/qa/qa1197/_index.html
Allows re-initialization.
Checks buffer object,
maps the buffer into the kernel (will fail if offset is given)
and obtains a kernel virtual address (apply offset here instead).
iokit_memory_descriptor | IOMemoryDescriptor to be mapped into the kernel address space |
offset | offset into memory descriptor to create mapping |
|
inlineinherited |
IOKit buffer initializer.
Allows re-initialization.
Creates a buffer and associated memory descriptor.
Wires down the backing store memory.
size | size to be alloced by buffer object |
limit | limit physical memory address space |
alignment | enforce physical memory alignment |
contigous | enforce contiguos physical memory |
|
inline |
creates circular backing store and frame buffers for isoc streaming
generates isoc cycle metrics from sample rate,
update max frame size
create backing store memory,
map it
initializes circular buffer
|
inline |
creates circular backing store and frame buffers for non-isoc streaming
create streaming backing store (twice the required size to accomodate single request wrap arounds)
map it
initializes circular buffer
creates frames inside backing store for continously overlapped streaming requests
creates intermittent device frame buffer
|
inline |
sets the line_size
may reinitialize streaming (different buffering!)
|
inlineinherited |
IOKit IOMemoryDescriptor* implicit cast.
|
inlineinherited |
IOKit IOMemoryDescriptor* implicit cast.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
IOKit physical address (only relevant for contigous memory)
|
inlineinherited |
IOKit physical address (only relevant for contigous memory)
|
inlineinherited |
operator to use mapping like pointer
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inline |
sets the sampling rate
may reinitialize streaming (different buffering!)
|
inline |
|
inlineinherited |
IOKit memory size.
|
inlineinherited |
IOKit memory size.
|
inlineinherited |
kernel mapping size
|
inlineoverridevirtual |
starts the USB streaming
initializes/resets circular buffer
synchronizes to isoc device cycles,
estimate upcoming timestamp
scheduling all but one isoc requests at least 1 sequence ahead; aligned to whole cycles,
if stream is sync master
it starts the sync master thread
else starts the USB stream listener
initiates new async cycle: issue requests
Implements dxd::stream.
|
inlineoverridevirtual |
If stream is sync master on bulk/irq pipe
it signals the sync master mode thread,
and waits for thread to finish
todo: move abort before master wait to avoid blocking if device doesn't handle transaction
Implements dxd::stream.
|
inline |
synchronizes to isoc device cycles
scheduling isoc sync request at least 1 complete cycles ahead; aligned to whole cycles,
correcting invalid frames
|
friend |
|
protectedinherited |
kernel virtual address mapping
event dxd::usb_stream::stream::data |
data available event
event dxd::usb_stream::stream::gap |
gap (space) available event
|
protectedinherited |
|
inherited |
os_result dxd::usb_stream::stream::status =not_initialized |
(c) copyright 2009 dynamic acoustics e.U. | generated on Sun Jan 20 2019 |