Lines Matching refs:profile
51 int proxy_prepare(alsa_device_proxy * proxy, const alsa_device_profile* profile, in proxy_prepare() argument
56 ALOGD("proxy_prepare(c:%d, d:%d)", profile->card, profile->device); in proxy_prepare()
58 proxy->profile = profile; in proxy_prepare()
64 if (config->format != PCM_FORMAT_INVALID && profile_is_format_valid(profile, config->format)) { in proxy_prepare()
69 proxy->alsa_config.format = profile->default_config.format; in proxy_prepare()
71 config->format, profile->default_config.format); in proxy_prepare()
78 if (config->rate != 0 && profile_is_sample_rate_valid(profile, config->rate)) { in proxy_prepare()
83 proxy->alsa_config.rate = profile->default_config.rate; in proxy_prepare()
85 config->rate, profile->default_config.rate); in proxy_prepare()
92 if (config->channels != 0 && profile_is_channel_count_valid(profile, config->channels)) { in proxy_prepare()
97 proxy->alsa_config.channels = profile_get_closest_channel_count(profile, config->channels); in proxy_prepare()
106 proxy->alsa_config.period_count = profile->default_config.period_count; in proxy_prepare()
108 profile_get_period_size(proxy->profile, proxy->alsa_config.rate); in proxy_prepare()
128 int max_rate_index = proxy_scan_rates(proxy, profile->sample_rates, require_exact_match); in proxy_prepare()
130 if (proxy->alsa_config.rate > profile->sample_rates[max_rate_index]) { in proxy_prepare()
132 proxy->alsa_config.rate, profile->sample_rates[max_rate_index]); in proxy_prepare()
133 proxy->alsa_config.rate = profile->sample_rates[max_rate_index]; in proxy_prepare()
141 const alsa_device_profile * profile) in proxy_prepare_from_default_config() argument
143 ALOGD("proxy_prepare_from_default_config(c:%d, d:%d)", profile->card, profile->device); in proxy_prepare_from_default_config()
145 proxy->profile = profile; in proxy_prepare_from_default_config()
148 log_pcm_config(&profile->default_config, "proxy_prepare_from_default_config()"); in proxy_prepare_from_default_config()
151 proxy->alsa_config.format = profile->default_config.format; in proxy_prepare_from_default_config()
152 proxy->alsa_config.rate = profile->default_config.rate; in proxy_prepare_from_default_config()
153 proxy->alsa_config.channels = profile->default_config.channels; in proxy_prepare_from_default_config()
154 proxy->alsa_config.period_count = profile->default_config.period_count; in proxy_prepare_from_default_config()
155 proxy->alsa_config.period_size = profile->default_config.period_size; in proxy_prepare_from_default_config()
157 enum pcm_format format = profile->default_config.format; in proxy_prepare_from_default_config()
169 const alsa_device_profile* profile = proxy->profile; in proxy_open() local
170 ALOGD("proxy_open(card:%d device:%d %s)", profile->card, profile->device, in proxy_open()
171 profile->direction == PCM_OUT ? "PCM_OUT" : "PCM_IN"); in proxy_open()
173 if (profile->card < 0 || profile->device < 0) { in proxy_open()
177 proxy->pcm = pcm_open(profile->card, profile->device, in proxy_open()
178 profile->direction | ALSA_CLOCK_TYPE, &proxy->alsa_config); in proxy_open()
245 return proxy->profile->extra_latency_ms; in proxy_get_extra_latency_ms()
371 const alsa_device_profile* profile = proxy->profile; in proxy_scan_rates() local
372 if (profile->card < 0 || profile->device < 0) { in proxy_scan_rates()
387 alsa_pcm = pcm_open(profile->card, profile->device, in proxy_scan_rates()
388 profile->direction | ALSA_CLOCK_TYPE, &alsa_config); in proxy_scan_rates()