Lines Matching defs:config
146 struct submix_config config;
359 const struct audio_config * const config,
377 rsxadev->routes[route_idx].config.input_channel_mask = config->channel_mask;
379 rsxadev->routes[route_idx].config.input_sample_rate = config->sample_rate;
384 rsxadev->routes[route_idx].config.output_sample_rate = 48000;
385 rsxadev->routes[route_idx].config.output_channel_mask = AUDIO_CHANNEL_OUT_STEREO;
392 rsxadev->routes[route_idx].config.output_channel_mask = config->channel_mask;
394 rsxadev->routes[route_idx].config.output_sample_rate = config->sample_rate;
403 struct submix_config * const device_config = &rsxadev->routes[route_idx].config;
406 channel_count = audio_channel_count_from_out_mask(config->channel_mask);
408 channel_count = audio_channel_count_from_in_mask(config->channel_mask);
417 const NBAIO_Format format = Format_from_SR_C(config->sample_rate, pipe_channel_count,
418 config->format);
440 memcpy(&device_config->common, config, sizeof(device_config->common));
518 // Sanitize the user specified audio config for a submix input / output stream.
519 static void submix_sanitize_config(struct audio_config * const config, const bool is_input_format)
521 config->channel_mask = is_input_format ? get_supported_channel_in_mask(config->channel_mask) :
522 get_supported_channel_out_mask(config->channel_mask);
523 config->sample_rate = get_supported_sample_rate(config->sample_rate);
524 config->format = DEFAULT_FORMAT;
531 const struct audio_config * const config,
538 // Query the device for the current audio config and whether input and output streams are open.
541 memcpy(&pipe_config, &rsxadev->routes[route_idx].config.common, sizeof(pipe_config));
551 "%s_channel_mask=%x", config->sample_rate, config->format,
552 opening_input ? "in" : "out", config->channel_mask);
554 // If either stream is open, verify the existing audio config the pipe matches the user
555 // specified config.
557 const audio_config * const input_config = opening_input ? config : &pipe_config;
558 const audio_config * const output_config = opening_input ? &pipe_config : config;
561 opening_input ? rsxadev->routes[route_idx].config.output_channel_mask :
562 rsxadev->routes[route_idx].config.input_channel_mask;
603 const struct submix_config *config,
607 const size_t pipe_frame_size = config->pipe_frame_size;
609 return (pipe_frames * config->pipe_frame_size) / max_frame_size;
619 const uint32_t out_rate = out->dev->routes[out->route_handle].config.output_sample_rate;
621 const uint32_t out_rate = out->dev->routes[out->route_handle].config.common.sample_rate;
634 if (rate != out->dev->routes[out->route_handle].config.output_sample_rate) {
637 out->dev->routes[out->route_handle].config.output_sample_rate, rate,
647 out->dev->routes[out->route_handle].config.common.sample_rate = rate;
655 const struct submix_config * const config = &out->dev->routes[out->route_handle].config;
659 stream, config, config->buffer_period_size_frames, stream_frame_size);
670 uint32_t channel_mask = out->dev->routes[out->route_handle].config.output_channel_mask;
679 const audio_format_t format = out->dev->routes[out->route_handle].config.common.format;
687 if (format != out->dev->routes[out->route_handle].config.common.format) {
758 const struct submix_config * const config = &out->dev->routes[out->route_handle].config;
762 &stream->common, config, config->buffer_size_frames, stream_frame_size);
960 const uint32_t rate = in->dev->routes[in->route_handle].config.input_sample_rate;
962 const uint32_t rate = in->dev->routes[in->route_handle].config.common.sample_rate;
974 if (rate != in->dev->routes[in->route_handle].config.input_sample_rate) {
976 "%u to %u", in->dev->routes[in->route_handle].config.input_sample_rate, rate);
984 in->dev->routes[in->route_handle].config.common.sample_rate = rate;
993 const struct submix_config * const config = &in->dev->routes[in->route_handle].config;
997 stream, config, config->buffer_period_size_frames, stream_frame_size);
1002 (float)config->input_sample_rate) /
1003 (float)config->output_sample_rate);
1016 in->dev->routes[in->route_handle].config.input_channel_mask;
1025 const audio_format_t format = in->dev->routes[in->route_handle].config.common.format;
1033 if (format != in->dev->routes[in->route_handle].config.common.format) {
1136 rsxadev->routes[in->route_handle].config.input_channel_mask);
1138 rsxadev->routes[in->route_handle].config.output_channel_mask);
1143 ALOG_ASSERT(rsxadev->routes[in->route_handle].config.common.format ==
1153 rsxadev->routes[in->route_handle].config.output_sample_rate;
1163 ALOG_ASSERT(rsxadev->routes[in->route_handle].config.common.format ==
1166 rsxadev->routes[in->route_handle].config.input_channel_mask) == 1);
1338 struct audio_config *config,
1352 // Make sure it's possible to open the device given the current audio config.
1353 submix_sanitize_config(config, false);
1366 if (!submix_open_validate_l(rsxadev, route_idx, config, false)) {
1401 force_pipe_creation = rsxadev->routes[route_idx].config.common.sample_rate
1402 != config->sample_rate;
1416 submix_audio_device_create_pipe_l(rsxadev, config, DEFAULT_PIPE_SIZE_IN_FRAMES,
1529 const struct audio_config *config)
1531 if (audio_is_linear_pcm(config->format)) {
1537 if (rsxadev->routes[i].config.buffer_period_size_frames > max_buffer_period_size_frames)
1539 max_buffer_period_size_frames = rsxadev->routes[i].config.buffer_period_size_frames;
1542 const size_t frame_size_in_bytes = audio_channel_count_from_in_mask(config->channel_mask) *
1543 audio_bytes_per_sample(config->format);
1555 struct audio_config *config,
1581 config.
1582 submix_sanitize_config(config, true);
1583 if (!submix_open_validate_l(rsxadev, route_idx, config, true)) {
1652 submix_audio_device_create_pipe_l(rsxadev, config, DEFAULT_PIPE_SIZE_IN_FRAMES,
1701 rsxadev->routes[i].config.input_sample_rate,
1702 rsxadev->routes[i].config.output_sample_rate,