|
template<typename return_t = os_result, typename exec_t > |
return_t | each (exec_t exec) |
|
void | free () |
| frees circular backing store and frame buffers
|
|
os_result | initialize (::IOMemoryDescriptor *iokit_memory_descriptor) |
| IOKit memory initializer.
|
|
os_result | initialize (::IOMemoryDescriptor *iokit_memory_descriptor) |
| IOKit memory initializer.
|
|
os_result | initialize (::IOMemoryDescriptor *iokit_memory_descriptor, size_t offset, size_t size) |
| IOKit memory initializer.
|
|
os_result | initialize (::IOMemoryDescriptor *iokit_memory_descriptor, size_t offset, size_t size) |
| IOKit memory initializer.
|
|
os_result | initialize (::IOMemoryDescriptor *iokit_memory_descriptor, size_t offset=0) |
| IOKit kernel map initializer.
|
|
os_result | initialize (const void *data, size_t size) |
| IOKit memory initializer.
|
|
os_result | initialize (const void *data, size_t size) |
| IOKit memory initializer.
|
|
os_result | initialize (const::MDL *mdl) |
|
os_result | initialize (const::MDL *mdl) |
|
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 (size_t size, unsigned int limit=64, unsigned int alignment=0, bool contigous=false) |
| IOKit buffer initializer.
|
|
os_result | initialize (unsigned int buffers) |
| creates circular backing store and frame buffers for non-isoc streaming
|
|
os_result | initialize (unsigned int line_size, unsigned int cycles, unsigned int samplerate) |
| creates circular backing store and frame buffers for isoc streaming
|
|
os_result | initialize (void *data, size_t size) |
| IOKit memory initializer.
|
|
os_result | initialize (void *data, size_t size) |
| IOKit memory initializer.
|
|
os_result | line_size (unsigned int line_size) |
| sets the line_size
|
|
| operator const dx::circular * () const |
|
| operator const::IOMemoryDescriptor * () const |
| IOKit IOMemoryDescriptor* implicit cast.
|
|
| operator const::IOMemoryDescriptor * () const |
| IOKit IOMemoryDescriptor* implicit cast.
|
|
| operator const::IOMemoryMap * () const |
|
| operator dx::circular * () const |
|
| operator uint64_t () const |
| IOKit physical address (only relevant for contigous memory)
|
|
| operator uint64_t () const |
| IOKit physical address (only relevant for contigous memory)
|
|
dx::circular * | operator-> () |
|
const dx::circular * | operator-> () const |
| operator to use mapping like pointer
|
|
| operator::IOMemoryDescriptor * () |
|
| operator::IOMemoryDescriptor * () |
|
| operator::IOMemoryMap * () |
|
| operator::MDL * () const |
|
| operator::MDL * () const |
|
item_t * | pop () |
| pop item from head
|
|
doubly::linked::abstract::event * | pop (doubly::linked::abstract::event *item) |
| pop item
|
|
list & | print () |
|
doubly::linked::abstract::event * | push (doubly::linked::abstract::event *item) |
| push item to head
|
|
item_t * | push (item_t *item) |
| push item to head
|
|
template<typename reference_t > |
int | release (reference_t &reference) |
|
void | retain () |
|
dx::uint24 | samplerate () const |
|
os_result | samplerate (dx::uint24 samplerate) |
| sets the sampling rate
|
|
os_result | signal () |
|
size_t | size () const |
| IOKit memory size.
|
|
size_t | size () const |
| IOKit memory size.
|
|
size_t | size () const |
| kernel mapping size
|
|
os_result | start (bool force=false) override |
| starts the USB streaming
|
|
os_result | stop (bool force=false) override |
|
| stream (class usb_stream_device &usb_stream_device, const dx::stream::open< dx::usb::endpoint > &open) |
| USB endpoint constructor.
|
|
os_result | synchronize () |
| synchronizes to isoc device cycles
|
|
| ~stream () override |
| stream destructor
|
|
|
enum | direction { in =::kEndpointDescriptorDirectionIn
, out =::kEndpointDescriptorDirectionOut
} |
|
enum | type {
isoc =::kEndpointDescriptorTransferTypeIsochronous
, bulk =::kEndpointDescriptorTransferTypeBulk
, interrupt =::kEndpointDescriptorTransferTypeInterrupt
, control = ::UsbdPipeTypeControl
,
isoc =::kEndpointDescriptorTransferTypeIsochronous
, bulk =::kEndpointDescriptorTransferTypeBulk
, interrupt =::kEndpointDescriptorTransferTypeInterrupt
} |
|
enum | type {
isoc =::kEndpointDescriptorTransferTypeIsochronous
, bulk =::kEndpointDescriptorTransferTypeBulk
, interrupt =::kEndpointDescriptorTransferTypeInterrupt
, control = ::UsbdPipeTypeControl
,
isoc =::kEndpointDescriptorTransferTypeIsochronous
, bulk =::kEndpointDescriptorTransferTypeBulk
, interrupt =::kEndpointDescriptorTransferTypeInterrupt
} |
|
|
os_result | abort () |
| IOKit: abort all outstanding requests and waits until all requests have been finalized.
|
|
os_result | abort () |
| WDK pipe abort.
|
|
os_result | clear () |
|
os_result | clear () |
| WDK pipe stall reset, toggle.
|
|
direction | direction () const |
|
direction | direction () const |
|
os_result | max_frame_size (unsigned int frame_size) |
|
os_result | max_frame_size (unsigned int frame_size) |
|
| operator::USBD_PIPE_HANDLE () const |
|
os_result | read (::IOMemoryDescriptor *memory, uint64_t &sequence, isoc_frame *frame, unsigned int frames) const |
| IOKit: USB synchronous irq/bulk read request.
|
|
os_result | read (::MDL *mdl, uint64_t &sequence, isoc_frame *frame, unsigned int frames) |
|
os_result | receive (::IOMemoryDescriptor *memory) |
| IOKit: USB asynchronous irq/bulk receive request.
|
|
os_result | receive (::IOMemoryDescriptor *memory, uint64_t &sequence, isoc_frame *frame, unsigned int frames) |
| IOKit: USB asynchronous isochronous read request.
|
|
os_result | receive (::MDL *mdl) |
| WDK: USB asynchronous irq/bulk receive request.
|
|
os_result | receive (::MDL *mdl, uint64_t &sequence, isoc_frame *frame, unsigned int frames) |
|
os_result | state () const |
| IOKit: IOUSBPipe* implicit cast.
|
|
os_result | transmit (const ::MDL *mdl) |
| WDK: USB asynchronous irq/bulk transmit request.
|
|
os_result | transmit (const ::MDL *mdl, uint64_t &sequence, isoc_frame *frame, unsigned int frames) |
|
os_result | transmit (const::IOMemoryDescriptor *memory, uint64_t &sequence, isoc_frame *frame, unsigned int frames) |
| IOKit: USB asynchronous isochronous write request.
|
|
type | type () const |
|
type | type () const |
|
template<typename data_t > |
os_result | write (const data_t &data) const |
|
template<dx::scope scope_t, typename data_t > |
os_result | write (const data_t &data) const |
|
template<typename data_t > |
os_result | write (const data_t &data) const |
|
os_result | write (const void *data, size_t size) const |
|
template<dx::scope scope_t> |
os_result | write (const void *data, size_t size) const |
|
os_result | write (const void *data, size_t size) const |
|
os_result | write (const::IOMemoryDescriptor *memory) const |
| IOKit: USB synchronous irq/bulk write request.
|
|
os_result | write (const::MDL *mdl) const |
| WDK: USB synchronous isochronous write request.
|
|
USB stream.
Handling of high speed/low latency/high performance streams:
- 3 requests with dedicated buffers are circulating: (a) actually handled - (p) to be prepared - (w) request waiting for device 0:(p) (a) (w) 1:(w) (p) (a) 2:(a) (w) (p) This way there is always at least one request scheduled(w). When data ready is signalled a new request is first scheduled(p) and the (a) actual data is handled. The cycle starts by scheduling (p) and (w).
- Exceptions
-
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. |
void dxd::usb_stream_device::stream::free |
( |
| ) |
|
|
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.
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).
- Parameters
-
iokit_memory_descriptor | IOMemoryDescriptor to be mapped into the kernel address space |
offset | offset into memory descriptor to create mapping |
os_result dxd::usb_stream_device::stream::initialize |
( |
unsigned int | buffers | ) |
|
|
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
os_result dxd::usb_stream_device::stream::start |
( |
bool | force = false | ) |
|
|
inlineoverridevirtual |
starts the USB streaming
initializes/resets circular buffer
synchronizes to isoc device cycles,
estimate upcoming timestamp
- Todo
- compute timestamp in ticks (not nsec)!
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.