diff --git a/src/common/droid-util.c b/src/common/droid-util.c index a352778..094e7ed 100644 --- a/src/common/droid-util.c +++ b/src/common/droid-util.c @@ -107,7 +107,7 @@ struct user_options { #define DEFAULT_PRIORITY (100) #define DEFAULT_AUDIO_FORMAT (AUDIO_FORMAT_PCM_16_BIT) - +#define DROID_VOIP_RX_SAMPLE_RATE (16000) #ifndef AUDIO_PARAMETER_VALUE_ON #define AUDIO_PARAMETER_VALUE_ON "on" @@ -1344,6 +1344,13 @@ static bool stream_config_fill(pa_droid_hw_module *hw, sample_spec->rate = 16000; } + if (output && mix_port->flags & AUDIO_OUTPUT_FLAG_VOIP_RX) { + pa_log_info("Override voip_rx channel map (mono) and sample rate (%d)", DROID_VOIP_RX_SAMPLE_RATE); + pa_channel_map_init_mono(channel_map); + sample_spec->channels = channel_map->channels; + sample_spec->rate = DROID_VOIP_RX_SAMPLE_RATE; + } + if (!compatible_port(mix_port, sample_spec, channel_map, NULL, &compatible_sample_spec, &compatible_channel_map, &hal_channel_mask)) { pa_log("Couldn't find compatible configuration for mix port \"%s\"", mix_port->name);