Lines Matching refs:iodev

7  * cras_iodev represents playback or capture devices on the system.  Each iodev
10 * render the samples it gets to the iodev. For capture the process is
31 * playback path of an iodev with the samples that are being played back.
37 /* State of an iodev.
51 * dev - iodev which this node belongs to.
129 * update_channel_layout - Update the channel layout base on set iodev->format,
130 * expect the best available layout be filled to iodev->format.
131 * set_hotword_model - Sets the hotword model to this iodev.
133 * hotword models of this iodev.
136 * iodev was created.
153 * is_enabled - True if this iodev is enabled, false otherwise.
174 void (*set_volume)(struct cras_iodev *iodev);
175 void (*set_mute)(struct cras_iodev *iodev);
176 void (*set_capture_gain)(struct cras_iodev *iodev);
177 void (*set_capture_mute)(struct cras_iodev *iodev);
178 int (*set_swap_mode_for_node)(struct cras_iodev *iodev,
181 int (*open_dev)(struct cras_iodev *iodev);
182 int (*close_dev)(struct cras_iodev *iodev);
183 int (*update_supported_formats)(struct cras_iodev *iodev);
184 int (*frames_queued)(const struct cras_iodev *iodev,
186 int (*delay_frames)(const struct cras_iodev *iodev);
187 int (*get_buffer)(struct cras_iodev *iodev,
190 int (*put_buffer)(struct cras_iodev *iodev, unsigned nwritten);
191 int (*flush_buffer)(struct cras_iodev *iodev);
192 int (*start)(const struct cras_iodev *iodev);
193 int (*output_should_wake)(const struct cras_iodev *iodev);
194 int (*output_underrun)(struct cras_iodev *iodev);
195 int (*no_stream)(struct cras_iodev *iodev, int enable);
196 void (*update_active_node)(struct cras_iodev *iodev,
198 int (*update_channel_layout)(struct cras_iodev *iodev);
199 int (*set_hotword_model)(struct cras_iodev *iodev,
201 char *(*get_hotword_models)(struct cras_iodev *iodev);
202 unsigned int (*get_num_underruns)(const struct cras_iodev *iodev);
203 unsigned int (*get_num_severe_underruns)(const struct cras_iodev *iodev);
269 * Utility functions to be used by iodev implementations.
272 /* Sets up the iodev for the given format if possible. If the iodev can't
274 * It also allocates a dsp context for the iodev.
276 * iodev - the iodev you want the format for.
279 int cras_iodev_set_format(struct cras_iodev *iodev,
282 /* Clear the format previously set for this iodev.
285 * iodev - the iodev you want to free the format.
287 void cras_iodev_free_format(struct cras_iodev *iodev);
289 /* Initializes the audio area for this iodev.
291 * iodev - the iodev to init audio area
294 void cras_iodev_init_audio_area(struct cras_iodev *iodev,
297 /* Frees the audio area for this iodev.
299 * iodev - the iodev to free audio area
301 void cras_iodev_free_audio_area(struct cras_iodev *iodev);
303 /* Free resources allocated for this iodev.
306 * iodev - the iodev you want to free the resources for.
308 void cras_iodev_free_resources(struct cras_iodev *iodev);
345 * iodev - device which the state changes.
347 void cras_iodev_update_dsp(struct cras_iodev *iodev);
355 * iodev - device to be changed for swap mode.
361 int cras_iodev_dsp_set_swap_mode_for_node(struct cras_iodev *iodev,
384 /* Adds a node to the iodev's node list. */
385 void cras_iodev_add_node(struct cras_iodev *iodev, struct cras_ionode *node);
387 /* Removes a node from iodev's node list. */
388 void cras_iodev_rm_node(struct cras_iodev *iodev, struct cras_ionode *node);
391 void cras_iodev_set_active_node(struct cras_iodev *iodev,
409 struct cras_iodev *iodev, unsigned int system_volume)
411 if (!iodev->active_node)
414 return cras_iodev_adjust_node_volume(iodev->active_node, system_volume);
419 const struct cras_iodev *iodev, long system_gain)
421 if (!iodev->active_node)
424 return iodev->active_node->capture_gain + system_gain;
427 /* Returns true if the active node of the iodev needs software volume. */
429 const struct cras_iodev *iodev)
431 if (iodev->software_volume_needed)
434 if (!iodev->active_node)
437 return iodev->active_node->software_volume_needed;
440 /* Returns maximum software gain for the iodev.
442 * iodev - The device.
447 const struct cras_iodev *iodev)
449 if (!cras_iodev_software_volume_needed(iodev))
451 if (!iodev->active_node)
453 return iodev->active_node->max_software_gain;
458 * iodev - The device.
462 float cras_iodev_get_software_gain_scaler(const struct cras_iodev *iodev);
464 /* Gets the software volume scaler of the iodev. The scaler should only be
466 float cras_iodev_get_software_volume_scaler(struct cras_iodev *iodev);
469 int cras_iodev_add_stream(struct cras_iodev *iodev,
473 struct dev_stream *cras_iodev_rm_stream(struct cras_iodev *iodev,
477 unsigned int cras_iodev_stream_offset(struct cras_iodev *iodev,
481 unsigned int cras_iodev_max_stream_offset(const struct cras_iodev *iodev);
484 void cras_iodev_stream_written(struct cras_iodev *iodev,
492 unsigned int cras_iodev_all_streams_written(struct cras_iodev *iodev);
494 /* Return the state of an iodev. */
495 enum CRAS_IODEV_STATE cras_iodev_state(const struct cras_iodev *iodev);
497 /* Open an iodev, does setup and invokes the open_dev callback. */
498 int cras_iodev_open(struct cras_iodev *iodev, unsigned int cb_level);
500 /* Open an iodev, does teardown and invokes the close_dev callback. */
501 int cras_iodev_close(struct cras_iodev *iodev);
504 int cras_iodev_buffer_avail(struct cras_iodev *iodev, unsigned hw_level);
507 int cras_iodev_put_input_buffer(struct cras_iodev *iodev, unsigned int nframes);
510 int cras_iodev_put_output_buffer(struct cras_iodev *iodev, uint8_t *frames,
515 * iodev - The device.
519 int cras_iodev_get_input_buffer(struct cras_iodev *iodev,
525 * iodev - The device.
529 int cras_iodev_get_output_buffer(struct cras_iodev *iodev,
534 int cras_iodev_update_rate(struct cras_iodev *iodev, unsigned int level,
538 int cras_iodev_reset_rate_estimator(const struct cras_iodev *iodev);
542 double cras_iodev_get_est_rate_ratio(const struct cras_iodev *iodev);
545 int cras_iodev_get_dsp_delay(const struct cras_iodev *iodev);
549 * iodev - The device.
555 int cras_iodev_frames_queued(struct cras_iodev *iodev,
559 static inline int cras_iodev_delay_frames(const struct cras_iodev *iodev)
561 return iodev->delay_frames(iodev) + cras_iodev_get_dsp_delay(iodev);
565 static inline int cras_iodev_is_open(const struct cras_iodev *iodev)
567 if (iodev && iodev->state != CRAS_IODEV_STATE_CLOSE)
573 void cras_iodev_register_pre_dsp_hook(struct cras_iodev *iodev,
578 void cras_iodev_register_post_dsp_hook(struct cras_iodev *iodev,
587 * iodev[in] - The device.
599 * iodev[in] - The output device.
611 * iodev[in] - The output device.
619 /* Get current state of iodev.
621 * iodev[in] - The device.
625 enum CRAS_IODEV_STATE cras_iodev_state(const struct cras_iodev *iodev);
640 * iodev[in] - The device.
644 unsigned int cras_iodev_get_num_underruns(const struct cras_iodev *iodev);
648 * iodev[in] - The device.
650 * An unsigned int for number of severe underruns recorded since iodev
654 const struct cras_iodev *iodev);
660 * iodev[in] - The device.
664 int cras_iodev_reset_request(struct cras_iodev* iodev);
676 * iodev[in] - The device.
685 /* Set iodev to mute/unmute state.
687 * iodev[in] - The device.
691 int cras_iodev_set_mute(struct cras_iodev* iodev);
694 * Checks if an output iodev's volume is zero.