Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8209d477 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hal: Avoid setting wrong sample rate for headset device"

parents dd4dfb6d 5c3fb9a7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6396,7 +6396,7 @@ static bool platform_check_codec_backend_cfg(struct audio_device* adev,
     * Handset and speaker may have diffrent backend. Check if the device is speaker or handset,
     * and these devices are restricited to 48kHz.
     */
    if ((platform_get_backend_index(snd_device) == DEFAULT_CODEC_BACKEND) &&
    if (!codec_device_supports_native_playback(usecase->devices) &&
        (platform_check_backends_match(SND_DEVICE_OUT_SPEAKER, snd_device) ||
         platform_check_backends_match(SND_DEVICE_OUT_HANDSET, snd_device))) {
        sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
+3 −1
Original line number Diff line number Diff line
@@ -7370,7 +7370,9 @@ static bool platform_check_codec_backend_cfg(struct audio_device* adev,
     * Handset and speaker may have diffrent backend. Check if the device is speaker or handset,
     * and these devices are restricited to 48kHz.
     */
    if (platform_check_backends_match(SND_DEVICE_OUT_SPEAKER, snd_device)) {
    if (!codec_device_supports_native_playback(usecase->devices) &&
        (platform_check_backends_match(SND_DEVICE_OUT_SPEAKER, snd_device) ||
         platform_check_backends_match(SND_DEVICE_OUT_HANDSET, snd_device))) {
        int bw = platform_get_snd_device_bit_width(SND_DEVICE_OUT_SPEAKER);
        if ((-ENOSYS != bw) && (bit_width > (uint32_t)bw)) {
            bit_width = (uint32_t)bw;