[−][src]Struct alsa::direct::pcm::Status
Read PCM status directly from memory, bypassing alsa-lib.
This means that it's
- less overhead for reading status (no syscall, no allocations, no virtual dispatch, just a read from memory)
- Send + Sync, and
- will only work for "hw" / "plughw" devices (not e g PulseAudio plugins), and not all of those are supported, although all common ones are (as of 2017, and a kernel from the same decade). Kernel supported archs are: x86, PowerPC, Alpha. Use "SyncPtrStatus" for other archs.
The values are updated every now and then by the kernel. Many functions will force an update to happen,
e g PCM::avail()
and PCM::delay()
.
Note: Even if you close the original PCM device, ALSA will not actually close the device until all Status structs are dropped too.
Methods
impl Status
[src]
pub fn new(p: &PCM) -> Result<Self>
[src]
pub fn from_fd(fd: RawFd) -> Result<Self>
[src]
pub fn state(&self) -> State
[src]
Current PCM state.
pub fn hw_ptr(&self) -> Frames
[src]
Number of frames hardware has read or written
This number is updated every now and then by the kernel. Calling most functions on the PCM will update it, so will usually a period interrupt. No guarantees given.
This value wraps at "boundary" (a large value you can read from SwParams).
pub fn htstamp(&self) -> timespec
[src]
Timestamp - fast version of alsa-lib's Status::get_htstamp
Note: This just reads the actual value in memory. Unfortunately, the timespec is too big to be read atomically on most archs. Therefore, this function can potentially give bogus result at times, at least in theory...?
pub fn audio_htstamp(&self) -> timespec
[src]
Audio timestamp - fast version of alsa-lib's Status::get_audio_htstamp
Note: This just reads the actual value in memory. Unfortunately, the timespec is too big to be read atomically on most archs. Therefore, this function can potentially give bogus result at times, at least in theory...?
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,