linux-audio 0.1.0

Client for the Linux kernel audio APIs.
Documentation
//! Low-level type definitions for the digital audio (PCM) interface.

use linux_unsafe::{int, long, off_t, time_t, timespec, uchar, uint, ulong, void};

#[allow(non_camel_case_types)]
pub type snd_pcm_uframes_t = ulong;
#[allow(non_camel_case_types)]
pub type snd_pcm_sframes_t = long;

/// Device class identifier for standard mono or stereo device.
pub const SNDRV_PCM_CLASS_GENERIC: int = 0;
/// Device class identifier for multichannel device.
pub const SNDRV_PCM_CLASS_MULTI: int = 1;
/// Device class identifier for software modems.
pub const SNDRV_PCM_CLASS_MODEM: int = 2;
/// Device class identifier for digitizers.
pub const SNDRV_PCM_CLASS_DIGITIZER: int = 3;
pub const SNDRV_PCM_CLASS_LAST: int = SNDRV_PCM_CLASS_DIGITIZER;

/// Mono or stereo subdevices are mixed together.
pub const SNDRV_PCM_SUBCLASS_GENERIC_MIX: int = 0;
/// multichannel subdevices are mixed together.
pub const SNDRV_PCM_SUBCLASS_MULTI_MIX: int = 1;
pub const SNDRV_PCM_SUBCLASS_LAST: int = SNDRV_PCM_SUBCLASS_MULTI_MIX;

/// [`snd_pcm_info::stream`] value for the "playback" direction.
pub const SNDRV_PCM_STREAM_PLAYBACK: int = 0;
/// [`snd_pcm_info::stream`] value for the "capture" direction.
pub const SNDRV_PCM_STREAM_CAPTURE: int = 1;
pub const SNDRV_PCM_STREAM_LAST: int = SNDRV_PCM_STREAM_CAPTURE;

#[allow(non_camel_case_types)]
pub type snd_pcm_access_t = int;
pub const SNDRV_PCM_ACCESS_MMAP_INTERLEAVED: snd_pcm_access_t = 0;
pub const SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED: snd_pcm_access_t = 1;
pub const SNDRV_PCM_ACCESS_MMAP_COMPLEX: snd_pcm_access_t = 2;
pub const SNDRV_PCM_ACCESS_RW_INTERLEAVED: snd_pcm_access_t = 3;
pub const SNDRV_PCM_ACCESS_RW_NONINTERLEAVED: snd_pcm_access_t = 4;

#[allow(non_camel_case_types)]
pub type snd_pcm_format_t = int;
pub const SNDRV_PCM_FORMAT_S8: snd_pcm_format_t = 0;
pub const SNDRV_PCM_FORMAT_U8: snd_pcm_format_t = 1;
pub const SNDRV_PCM_FORMAT_S16_LE: snd_pcm_format_t = 2;
pub const SNDRV_PCM_FORMAT_S16_BE: snd_pcm_format_t = 3;
pub const SNDRV_PCM_FORMAT_U16_LE: snd_pcm_format_t = 4;
pub const SNDRV_PCM_FORMAT_U16_BE: snd_pcm_format_t = 5;
pub const SNDRV_PCM_FORMAT_S24_LE: snd_pcm_format_t = 6;
pub const SNDRV_PCM_FORMAT_S24_BE: snd_pcm_format_t = 7;
pub const SNDRV_PCM_FORMAT_U24_LE: snd_pcm_format_t = 8;
pub const SNDRV_PCM_FORMAT_U24_BE: snd_pcm_format_t = 9;
pub const SNDRV_PCM_FORMAT_S32_LE: snd_pcm_format_t = 10;
pub const SNDRV_PCM_FORMAT_S32_BE: snd_pcm_format_t = 11;
pub const SNDRV_PCM_FORMAT_U32_LE: snd_pcm_format_t = 12;
pub const SNDRV_PCM_FORMAT_U32_BE: snd_pcm_format_t = 13;
pub const SNDRV_PCM_FORMAT_FLOAT_LE: snd_pcm_format_t = 14;
pub const SNDRV_PCM_FORMAT_FLOAT_BE: snd_pcm_format_t = 15;
pub const SNDRV_PCM_FORMAT_FLOAT64_LE: snd_pcm_format_t = 16;
pub const SNDRV_PCM_FORMAT_FLOAT64_BE: snd_pcm_format_t = 17;
pub const SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE: snd_pcm_format_t = 18;
pub const SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE: snd_pcm_format_t = 19;
pub const SNDRV_PCM_FORMAT_MU_LAW: snd_pcm_format_t = 20;
pub const SNDRV_PCM_FORMAT_A_LAW: snd_pcm_format_t = 21;
pub const SNDRV_PCM_FORMAT_IMA_ADPCM: snd_pcm_format_t = 22;
pub const SNDRV_PCM_FORMAT_MPEG: snd_pcm_format_t = 23;
pub const SNDRV_PCM_FORMAT_GSM: snd_pcm_format_t = 24;
pub const SNDRV_PCM_FORMAT_S20_LE: snd_pcm_format_t = 25;
pub const SNDRV_PCM_FORMAT_S20_BE: snd_pcm_format_t = 26;
pub const SNDRV_PCM_FORMAT_U20_LE: snd_pcm_format_t = 27;
pub const SNDRV_PCM_FORMAT_U20_BE: snd_pcm_format_t = 28;
pub const SNDRV_PCM_FORMAT_SPECIAL: snd_pcm_format_t = 31;
pub const SNDRV_PCM_FORMAT_S24_3LE: snd_pcm_format_t = 32;
pub const SNDRV_PCM_FORMAT_S24_3BE: snd_pcm_format_t = 33;
pub const SNDRV_PCM_FORMAT_U24_3LE: snd_pcm_format_t = 34;
pub const SNDRV_PCM_FORMAT_U24_3BE: snd_pcm_format_t = 35;
pub const SNDRV_PCM_FORMAT_S20_3LE: snd_pcm_format_t = 36;
pub const SNDRV_PCM_FORMAT_S20_3BE: snd_pcm_format_t = 37;
pub const SNDRV_PCM_FORMAT_U20_3LE: snd_pcm_format_t = 38;
pub const SNDRV_PCM_FORMAT_U20_3BE: snd_pcm_format_t = 39;
pub const SNDRV_PCM_FORMAT_S18_3LE: snd_pcm_format_t = 40;
pub const SNDRV_PCM_FORMAT_S18_3BE: snd_pcm_format_t = 41;
pub const SNDRV_PCM_FORMAT_U18_3LE: snd_pcm_format_t = 42;
pub const SNDRV_PCM_FORMAT_U18_3BE: snd_pcm_format_t = 43;
pub const SNDRV_PCM_FORMAT_G723_24: snd_pcm_format_t = 44;
pub const SNDRV_PCM_FORMAT_G723_24_1B: snd_pcm_format_t = 45;
pub const SNDRV_PCM_FORMAT_G723_40: snd_pcm_format_t = 46;
pub const SNDRV_PCM_FORMAT_G723_40_1B: snd_pcm_format_t = 47;
pub const SNDRV_PCM_FORMAT_DSD_U8: snd_pcm_format_t = 48;
pub const SNDRV_PCM_FORMAT_DSD_U16_LE: snd_pcm_format_t = 49;
pub const SNDRV_PCM_FORMAT_DSD_U32_LE: snd_pcm_format_t = 50;
pub const SNDRV_PCM_FORMAT_DSD_U16_BE: snd_pcm_format_t = 51;
pub const SNDRV_PCM_FORMAT_DSD_U32_BE: snd_pcm_format_t = 52;

#[allow(non_camel_case_types)]
pub type snd_pcm_subformat_t = int;
pub const SNDRV_PCM_SUBFORMAT_STD: snd_pcm_subformat_t = 0;
pub const SNDRV_PCM_SUBFORMAT_MSBITS_MAX: snd_pcm_subformat_t = 1;
pub const SNDRV_PCM_SUBFORMAT_MSBITS_20: snd_pcm_subformat_t = 2;
pub const SNDRV_PCM_SUBFORMAT_MSBITS_24: snd_pcm_subformat_t = 3;

pub const SNDRV_PCM_INFO_MMAP: uint = 0x00000001; /* hardware supports mmap */
pub const SNDRV_PCM_INFO_MMAP_VALID: uint = 0x00000002; /* period data are valid during transfer */
pub const SNDRV_PCM_INFO_DOUBLE: uint = 0x00000004; /* Double buffering needed for PCM start/stop */
pub const SNDRV_PCM_INFO_BATCH: uint = 0x00000010; /* double buffering */
pub const SNDRV_PCM_INFO_SYNC_APPLPTR: uint = 0x00000020; /* need the explicit sync of appl_ptr update */
pub const SNDRV_PCM_INFO_PERFECT_DRAIN: uint = 0x00000040; /* silencing at the end of stream is not required */
pub const SNDRV_PCM_INFO_INTERLEAVED: uint = 0x00000100; /* channels are interleaved */
pub const SNDRV_PCM_INFO_NONINTERLEAVED: uint = 0x00000200; /* channels are not interleaved */
pub const SNDRV_PCM_INFO_COMPLEX: uint = 0x00000400; /* complex frame organization (mmap only) */
pub const SNDRV_PCM_INFO_BLOCK_TRANSFER: uint = 0x00010000; /* hardware transfer block of samples */
pub const SNDRV_PCM_INFO_OVERRANGE: uint = 0x00020000; /* hardware supports ADC (capture) overrange detection */
pub const SNDRV_PCM_INFO_RESUME: uint = 0x00040000; /* hardware supports stream resume after suspend */
pub const SNDRV_PCM_INFO_PAUSE: uint = 0x00080000; /* pause ioctl is supported */
pub const SNDRV_PCM_INFO_HALF_DUPLEX: uint = 0x00100000; /* only half duplex */
pub const SNDRV_PCM_INFO_JOINT_DUPLEX: uint = 0x00200000; /* playback and capture stream are somewhat correlated */
pub const SNDRV_PCM_INFO_SYNC_START: uint = 0x00400000; /* pcm support some kind of sync go */
pub const SNDRV_PCM_INFO_NO_PERIOD_WAKEUP: uint = 0x00800000; /* period wakeup can be disabled */
pub const SNDRV_PCM_INFO_HAS_WALL_CLOCK: uint = 0x01000000; /* (Deprecated)has audio wall clock for audio/system time sync */
pub const SNDRV_PCM_INFO_HAS_LINK_ATIME: uint = 0x01000000; /* report hardware link audio time, reset on startup */
pub const SNDRV_PCM_INFO_HAS_LINK_ABSOLUTE_ATIME: uint = 0x02000000; /* report absolute hardware link audio time, not reset on startup */
pub const SNDRV_PCM_INFO_HAS_LINK_ESTIMATED_ATIME: uint = 0x04000000; /* report estimated link audio time */
pub const SNDRV_PCM_INFO_HAS_LINK_SYNCHRONIZED_ATIME: uint = 0x08000000; /* report synchronized audio/system time */
pub const SNDRV_PCM_INFO_EXPLICIT_SYNC: uint = 0x10000000; /* needs explicit sync of pointers and data */
pub const SNDRV_PCM_INFO_NO_REWINDS: uint = 0x20000000; /* hardware can only support monotonic changes of appl_ptr */
pub const SNDRV_PCM_INFO_DRAIN_TRIGGER: uint = 0x40000000; /* internal kernel flag - trigger in drain */
pub const SNDRV_PCM_INFO_FIFO_IN_FRAMES: uint = 0x80000000; /* internal kernel flag - FIFO size is in frames */

#[allow(non_camel_case_types)]
pub type snd_pcm_state_t = int;
pub const SNDRV_PCM_STATE_OPEN: snd_pcm_state_t = 0; /* stream is open */
pub const SNDRV_PCM_STATE_SETUP: snd_pcm_state_t = 1; /* stream has a setup */
pub const SNDRV_PCM_STATE_PREPARED: snd_pcm_state_t = 2; /* stream is ready to start */
pub const SNDRV_PCM_STATE_RUNNING: snd_pcm_state_t = 3; /* stream is running */
pub const SNDRV_PCM_STATE_XRUN: snd_pcm_state_t = 4; /* stream reached an xrun */
pub const SNDRV_PCM_STATE_DRAINING: snd_pcm_state_t = 5; /* stream is draining */
pub const SNDRV_PCM_STATE_PAUSED: snd_pcm_state_t = 6; /* stream is paused */
pub const SNDRV_PCM_STATE_SUSPENDED: snd_pcm_state_t = 7; /* hardware is suspended */
pub const SNDRV_PCM_STATE_DISCONNECTED: snd_pcm_state_t = 8; /* hardware is disconnected */

pub const SNDRV_PCM_MMAP_OFFSET_DATA: usize = 0x00000000;
#[cfg(target_pointer_width = "32")]
pub const SNDRV_PCM_MMAP_OFFSET_STATUS: usize = 0x80000000;
#[cfg(target_pointer_width = "64")]
pub const SNDRV_PCM_MMAP_OFFSET_STATUS: usize = 0x82000000;
#[cfg(target_pointer_width = "32")]
pub const SNDRV_PCM_MMAP_OFFSET_CONTROL: usize = 0x81000000;
#[cfg(target_pointer_width = "64")]
pub const SNDRV_PCM_MMAP_OFFSET_CONTROL: usize = 0x83000000;

#[repr(C)]
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy)]
pub struct snd_pcm_info {
    /// Device number. Usually read only, but writable for control.
    pub device: uint,
    /// Subdevice number. Usually read only, but writable for control.
    pub subdevice: uint,
    /// Stream direction. Usually read only, but writable for control.
    pub stream: int,
    /// Card number. Read-only.
    pub card: int,
    /// User-selectable ID.
    pub id: [uchar; 64],
    /// Name of this device.
    pub name: [uchar; 80],
    /// Subdevice name.
    pub subname: [uchar; 32],
    /// Device class, using `SNDRV_PCM_CLASS_*` constants.
    pub dev_class: int,
    /// Device subclass, using `SNDRV_PCM_SUBCLASS_*` constants.
    pub dev_subclass: int,
    pub subdevices_count: uint,
    pub subdevices_avail: uint,
    /// Formerly the hardware synchronization id, but no longer used.
    pub pad1: [uchar; 16],
    pub reserved: [uchar; 64],
}

#[allow(non_camel_case_types)]
pub type snd_pcm_hw_param_t = int;
pub const SNDRV_PCM_HW_PARAM_ACCESS: snd_pcm_hw_param_t = 0; /* Access type */
pub const SNDRV_PCM_HW_PARAM_FORMAT: snd_pcm_hw_param_t = 1; /* Format */
pub const SNDRV_PCM_HW_PARAM_SUBFORMAT: snd_pcm_hw_param_t = 2; /* Subformat */
pub const SNDRV_PCM_HW_PARAM_FIRST_MASK: usize = SNDRV_PCM_HW_PARAM_ACCESS as usize;
pub const SNDRV_PCM_HW_PARAM_LAST_MASK: usize = SNDRV_PCM_HW_PARAM_SUBFORMAT as usize;
pub const SNDRV_PCM_HW_PARAM_SAMPLE_BITS: snd_pcm_hw_param_t = 8; /* Bits per sample */
pub const SNDRV_PCM_HW_PARAM_FRAME_BITS: snd_pcm_hw_param_t = 9; /* Bits per frame */
pub const SNDRV_PCM_HW_PARAM_CHANNELS: snd_pcm_hw_param_t = 10; /* Channels */
pub const SNDRV_PCM_HW_PARAM_RATE: snd_pcm_hw_param_t = 11; /* Approx rate */
pub const SNDRV_PCM_HW_PARAM_PERIOD_TIME: snd_pcm_hw_param_t = 12; /* Approx distance between interrupts in us */
pub const SNDRV_PCM_HW_PARAM_PERIOD_SIZE: snd_pcm_hw_param_t = 13; /* Approx frames between interrupts			 */
pub const SNDRV_PCM_HW_PARAM_PERIOD_BYTES: snd_pcm_hw_param_t = 14; /* Approx bytes between interrupts */
pub const SNDRV_PCM_HW_PARAM_PERIODS: snd_pcm_hw_param_t = 15; /* Approx interrupts per buffer */
pub const SNDRV_PCM_HW_PARAM_BUFFER_TIME: snd_pcm_hw_param_t = 16; /* Approx duration of buffer  in us */
pub const SNDRV_PCM_HW_PARAM_BUFFER_SIZE: snd_pcm_hw_param_t = 17; /* Size of buffer in frames */
pub const SNDRV_PCM_HW_PARAM_BUFFER_BYTES: snd_pcm_hw_param_t = 18; /* Size of buffer in bytes */
pub const SNDRV_PCM_HW_PARAM_TICK_TIME: snd_pcm_hw_param_t = 19; /* Approx tick duration in us */
pub const SNDRV_PCM_HW_PARAM_FIRST_INTERVAL: usize = SNDRV_PCM_HW_PARAM_SAMPLE_BITS as usize;
pub const SNDRV_PCM_HW_PARAM_LAST_INTERVAL: usize = SNDRV_PCM_HW_PARAM_TICK_TIME as usize;

pub const SNDRV_PCM_HW_PARAMS_NORESAMPLE: int = 1 << 0; /* avoid rate resampling */
pub const SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER: int = 1 << 1; /* export buffer */
pub const SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP: int = 1 << 2; /* disable period wakeups */
pub const SNDRV_PCM_HW_PARAMS_NO_DRAIN_SILENCE: int = 1 << 3; /* suppress drain with the filling of the silence samples */

#[repr(C)]
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy)]
pub struct snd_interval {
    pub min: uint,
    pub max: uint,
    /// Bitmask:
    ///
    /// - bit 0: openmin
    /// - bit 1: openmax
    /// - bit 2: integer
    /// - bit 3: empty
    pub flags: uint,
}

pub const SNDRV_MASK_MAX: usize = 256;

#[repr(C)]
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy)]
pub struct snd_mask {
    pub bits: [u32; (SNDRV_MASK_MAX + 31) / 32],
}

#[repr(C)]
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy)]
pub struct snd_pcm_hw_params {
    pub flags: uint,
    pub masks: [snd_mask; SNDRV_PCM_HW_PARAM_LAST_MASK - SNDRV_PCM_HW_PARAM_FIRST_MASK + 1],
    pub mres: [snd_mask; 5], /* reserved masks */
    pub intervals:
        [snd_interval; SNDRV_PCM_HW_PARAM_LAST_INTERVAL - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1],
    pub ires: [snd_interval; 9],      /* reserved intervals */
    pub rmask: uint,                  /* W: requested masks */
    pub cmask: uint,                  /* R: changed masks */
    pub info: uint,                   /* R: Info flags for returned setup */
    pub msbits: uint,                 /* R: used most significant bits (in sample bit-width) */
    pub rate_num: uint,               /* R: rate numerator */
    pub rate_den: uint,               /* R: rate denominator */
    pub fifo_size: snd_pcm_uframes_t, /* R: chip FIFO size in frames */
    pub sync: [uchar; 16],            /* R: synchronization ID (perfect sync - one clock source) */
    pub reserved: [uchar; 48],        /* reserved for future */
}

pub const SNDRV_PCM_TSTAMP_NONE: int = 0;
pub const SNDRV_PCM_TSTAMP_ENABLE: int = 1;

#[repr(C)]
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy)]
pub struct snd_pcm_sw_params {
    pub tstamp_mode: int, /* timestamp mode */
    pub period_step: uint,
    pub sleep_min: uint,                      /* min ticks to sleep */
    pub avail_min: snd_pcm_uframes_t,         /* min avail frames for wakeup */
    pub xfer_align: snd_pcm_uframes_t,        /* obsolete: xfer size need to be a multiple */
    pub start_threshold: snd_pcm_uframes_t,   /* min hw_avail frames for automatic start */
    pub stop_threshold: snd_pcm_uframes_t,    /* - stop playback */
    pub silence_threshold: snd_pcm_uframes_t, /* - pre-fill buffer with silence */
    pub silence_size: snd_pcm_uframes_t, /* max size of silence pre-fill; when >= boundary, fill played area with silence immediately */
    pub boundary: snd_pcm_uframes_t,     /* pointers wrap point */
    pub proto: uint,                     /* protocol version */
    pub tstamp_type: uint,               /* timestamp type (req. proto >= 2.0.12) */
    pub reserved: [uchar; 56],           /* reserved for future */
}

#[repr(C)]
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy)]
pub struct snd_pcm_channel_info {
    pub channel: uint,
    pub offset: off_t, /* mmap offset */
    pub first: uint,   /* offset to first sample in bits */
    pub step: uint,    /* samples distance in bits */
}

#[repr(C)]
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy)]
pub struct snd_pcm_status {
    pub state: snd_pcm_state_t, /* stream state */
    pub pad1: [u8; core::mem::size_of::<time_t>() - core::mem::size_of::<int>()], /* align to timespec */
    pub trigger_tstamp: timespec, /* time when stream was started/stopped/paused */
    pub tstamp: timespec,         /* reference timestamp */
    pub appl_ptr: snd_pcm_uframes_t, /* appl ptr */
    pub hw_ptr: snd_pcm_uframes_t, /* hw ptr */
    pub delay: snd_pcm_uframes_t, /* current delay in frames */
    pub avail: snd_pcm_uframes_t, /* number of frames available */
    pub avail_max: snd_pcm_uframes_t, /* max frames available on hw since last status */
    pub overrange: snd_pcm_uframes_t, /* count of ADC (capture) overrange detections from last status */
    pub suspended_state: snd_pcm_state_t, /* suspended stream state */
    pub audio_tstamp_data: u32, /* needed for 64-bit alignment, used for configs/report to/from userspace */
    pub audio_tstamp: timespec, /* sample counter, wall clock, PHC or on-demand sync'ed */
    pub driver_tstamp: timespec, /* useful in case reference system tstamp is reported with delay */
    pub audio_tstamp_accuracy: u32, /* in ns units, only valid if indicated in audio_tstamp_data */
    pub reserved: [uchar; 52 - 2 * core::mem::size_of::<timespec>()], /* must be filled with zero */
}

// TODO: Finish this
// https://github.com/torvalds/linux/blob/186f3edfdd41f2ae87fc40a9ccba52a3bf930994/include/uapi/sound/asound.h#L549C1-L559C3
/*
#[repr(C)]
#[allow(non_camel_case_types)]
#[derive(Clone, Copy)]
pub union __snd_pcm_sync_ptr_s {
    status: __snd_pcm_mmap_status,
    reserved: [uchar; 64],
}

#[repr(C)]
#[allow(non_camel_case_types)]
#[derive(Clone, Copy)]
pub union __snd_pcm_sync_ptr_c {
    status: __snd_pcm_mmap_control,
    reserved: [uchar; 64],
}

#[repr(C)]
#[allow(non_camel_case_types)]
#[derive(Clone, Copy)]
struct __snd_pcm_sync_ptr {
    pub flags :uint,
    pub s: __snd_pcm_sync_ptr_s,
    pub c: __snd_pcm_sync_ptr_c,
};
*/

#[repr(C)]
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy)]
pub struct snd_xferi {
    pub result: snd_pcm_sframes_t,
    pub buf: *mut void,
    pub frames: snd_pcm_uframes_t,
}

#[repr(C)]
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy)]
pub struct snd_xfern {
    pub result: snd_pcm_sframes_t,
    pub bufs: *mut *mut void,
    pub frames: snd_pcm_uframes_t,
}

pub const SNDRV_CHMAP_UNKNOWN: uint = 0;
pub const SNDRV_CHMAP_NA: uint = 1; /* N/A, silent */
pub const SNDRV_CHMAP_MONO: uint = 2; /* mono stream */
pub const SNDRV_CHMAP_FL: uint = 3; /* front left */
pub const SNDRV_CHMAP_FR: uint = 4; /* front right */
pub const SNDRV_CHMAP_RL: uint = 5; /* rear left */
pub const SNDRV_CHMAP_RR: uint = 6; /* rear right */
pub const SNDRV_CHMAP_FC: uint = 7; /* front center */
pub const SNDRV_CHMAP_LFE: uint = 8; /* LFE */
pub const SNDRV_CHMAP_SL: uint = 9; /* side left */
pub const SNDRV_CHMAP_SR: uint = 10; /* side right */
pub const SNDRV_CHMAP_RC: uint = 11; /* rear center */
pub const SNDRV_CHMAP_FLC: uint = 12; /* front left center */
pub const SNDRV_CHMAP_FRC: uint = 13; /* front right center */
pub const SNDRV_CHMAP_RLC: uint = 14; /* rear left center */
pub const SNDRV_CHMAP_RRC: uint = 15; /* rear right center */
pub const SNDRV_CHMAP_FLW: uint = 16; /* front left wide */
pub const SNDRV_CHMAP_FRW: uint = 17; /* front right wide */
pub const SNDRV_CHMAP_FLH: uint = 18; /* front left high */
pub const SNDRV_CHMAP_FCH: uint = 19; /* front center high */
pub const SNDRV_CHMAP_FRH: uint = 20; /* front right high */
pub const SNDRV_CHMAP_TC: uint = 21; /* top center */
pub const SNDRV_CHMAP_TFL: uint = 22; /* top front left */
pub const SNDRV_CHMAP_TFR: uint = 23; /* top front right */
pub const SNDRV_CHMAP_TFC: uint = 24; /* top front center */
pub const SNDRV_CHMAP_TRL: uint = 25; /* top rear left */
pub const SNDRV_CHMAP_TRR: uint = 26; /* top rear right */
pub const SNDRV_CHMAP_TRC: uint = 27; /* top rear center */
pub const SNDRV_CHMAP_TFLC: uint = 28; /* top front left center */
pub const SNDRV_CHMAP_TFRC: uint = 29; /* top front right center */
pub const SNDRV_CHMAP_TSL: uint = 30; /* top side left */
pub const SNDRV_CHMAP_TSR: uint = 31; /* top side right */
pub const SNDRV_CHMAP_LLFE: uint = 32; /* left LFE */
pub const SNDRV_CHMAP_RLFE: uint = 33; /* right LFE */
pub const SNDRV_CHMAP_BC: uint = 34; /* bottom center */
pub const SNDRV_CHMAP_BLC: uint = 35; /* bottom left center */
pub const SNDRV_CHMAP_BRC: uint = 36; /* bottom right center */
pub const SNDRV_CHMAP_POSITION_MASK: uint = 0xffff;
pub const SNDRV_CHMAP_PHASE_INVERSE: uint = 0x01 << 16;
pub const SNDRV_CHMAP_DRIVER_SPEC: uint = 0x02 << 16;