snd_pcm_channel_params_t

PCM channel parameters

Synopsis:

typedef struct snd_pcm_channel_params
{
    int32_t             channel;
    int32_t             mode;
    snd_pcm_sync_t      sync;               /* hardware synchronization ID */
    snd_pcm_format_t    format;
    snd_pcm_digital_t   digital;
    int32_t             start_mode;
    int32_t             stop_mode;
    int32_t             time:1, ust_time:1;
    uint32_t            why_failed;
    union
    {
        struct
        {
            int32_t     queue_size;
            int32_t     fill;
            int32_t     max_fill;
            uint8_t     reserved[124];    /* must be filled with zeroes */
        }       stream;
        struct
        {
            int32_t     frag_size;
            int32_t     frags_min;
            int32_t     frags_max;
            uint32_t    frags_buffered_max;
            uint8_t     reserved[120];   /* must be filled with zeroes */
        }       block;
        uint8_t     reserved[128];       /* must be filled with zeroes */
    }       buf;
    char        sw_mixer_subchn_name[32];
    char        audio_type_name[32];
    uint8_t     reserved[64];            /* must be filled with zeroes */
} snd_pcm_channel_params_t;

Description:

The snd_pcm_channel_params_t structure describes the parameters of a PCM capture or playback channel. The members include:

channel
The channel direction; one of SND_PCM_CHANNEL_PLAYBACK or SND_PCM_CHANNEL_CAPTURE.
mode
The channel mode: SND_PCM_MODE_BLOCK. (SND_PCM_MODE_STREAM is deprecated.)

You can OR in the following flags:

  • SND_PCM_MODE_FLAG_PROTECTED_CONTENT — indicates that the output path may not change without the client's approval. When the output path does change, the client will change to state SND_PCM_STATUS_UNSECURE. The client can then check the current output path, and call snd_pcm_channel_prepare() to continue playback.
  • SND_PCM_MODE_FLAG_REQUIRE_PROTECTION — indicates that digital protection is required on the audio path. For example, for HDMI, it indicates that HDCP must be enabled for audio to play.
sync
The synchronization group. Not supported; don't use this member.
format
The data format; see snd_pcm_format_t.
digital
Not currently implemented.
start_mode
The start mode; one of:
  • SND_PCM_START_DATA — start when some data is written (playback) or requested (capture).
  • SND_PCM_START_FULL — start when the whole queue is filled (playback only).
  • SND_PCM_START_GO — start on the Go command.
stop_mode
The stop mode; one of:
  • SND_PCM_STOP_STOP — stop when an underrun or overrun occurs.
  • SND_PCM_STOP_ROLLOVER_RESET — when recovering from writing or reading more data, reset the counter. Use this option for fault tolerant systems.
  • SND_PCM_STOP_ROLLOVER — Rollover the fragments when an underrun or overrun occurs. Use this option to overcome jitter between audio that is being captured or played by the client application.
time
If set, the driver offers, in the status structure, the time when the transfer began. The time is in the format used by gettimeofday() (see the QNX Neutrino C Library Reference).
ust_time
If set, the driver offers, in the status structure, the time when the transfer began. The time is in UST format.
why_failed
An indication why an operation failed; one of:
  • SND_PCM_PARAMS_BAD_MODE
  • SND_PCM_PARAMS_BAD_START
  • SND_PCM_PARAMS_BAD_STOP
  • SND_PCM_PARAMS_BAD_FORMAT
  • SND_PCM_PARAMS_BAD_RATE
  • SND_PCM_PARAMS_BAD_VOICES
  • SND_PCM_PARAMS_NO_CHANNEL
queue_size
The queue size, in bytes, for the stream mode. Not supported; don't use this member.
fill
The fill mode (SND_PCM_FILL_* constants). Not supported; don't use this member.
max_fill
The number of bytes to be filled ahead with silence. Not supported; don't use this member.
frag_size
The size of fragment, in bytes.
frags_min
Depends on the mode:
  • Capture — the minimum filled fragments to allow wakeup (usually one).
  • Playback — the minimum free fragments to allow wakeup (usually one).
frags_max
For playback, the maximum filled fragments to allow wakeup. This value specifies the total number of fragments that could be written to by an application. This excludes the fragment that's currently playing, so the actual total number of fragments is frags_max + 1.
frags_buffered_max
If this is set, io-audio may block the caller after fewer than frags_max fragments have been passed, if it chooses, but won't block the client before frags_buffered_max fragments have been written.
sw_mixer_subchn_name
By default, the name of all sw_mixer subchannel groups is PCM Subchannel; you can use this field to assign a different name.
audio_type_name
The name of the audio type the subchannel is associated with. This is used for audio concurrency management policies, such as audio ducking. For more information, see the Audio Concurrency Management chapter. If there's no matching audio type defined in your audio policy configuration file, then the audio type named default is used. If there's no audio type named default, the lowest priority audio type is used instead.

Classification:

QNX Neutrino