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

Commit 83134581 authored by Venugopal Nadipalli's avatar Venugopal Nadipalli Committed by Gerrit - the friendly Code Review server
Browse files

hal: 64KHz clips are playing mute on HDMI

- 64KHz clips are playing mute on HDMI device
- The root cause of the issue is copp is getting
  configured at stream sample rate which is not
  supported by ADM(DSP)
- Fix contains mapping of sample rates to the
  closest match supported by HDMI device
- CRs-Fixed: 2107374

Change-Id: I918df1d7adcbbde00d82a47fc95b96d9b18fe334
parent 71a01c16
Loading
Loading
Loading
Loading
+45 −0
Original line number Diff line number Diff line
@@ -6708,6 +6708,9 @@ void platform_check_and_update_copp_sample_rate(void* platform, snd_device_t snd
     } else
         *sample_rate = stream_sr;

     if (snd_device == SND_DEVICE_OUT_HDMI)
         *sample_rate = platform_get_supported_sampling_rate_on_hdmi(stream_sr);

     ALOGI("sn_device %d device sr %d stream sr %d copp sr %d", snd_device, device_sr, stream_sr
, *sample_rate);

@@ -7811,6 +7814,48 @@ int platform_get_max_codec_backend() {
    return MAX_CODEC_BACKENDS;
}

int platform_get_supported_sampling_rate_on_hdmi(uint32_t stream_sr)
{
    int sample_rate;
    switch (stream_sr){
        case 8000:
        case 11025:
        case 16000:
        case 22050:
        case 32000:
        case 48000:
            sample_rate = 48000;
            break;
        case 44100:
            sample_rate = 44100;
            break;
        case 64000:
        case 96000:
            sample_rate = 96000;
            break;
        case 88200:
            sample_rate = 88200;
            break;
        case 176400:
            sample_rate = 176400;
            break;
        case 192000:
            sample_rate = 192000;
            break;
        case 352800:
            sample_rate = 352800;
            break;
        case 384000:
            sample_rate = 384000;
            break;
        case 144000:
        default:
            sample_rate = 48000;
            break;
    }
    return sample_rate;
}

#if defined(PLATFORM_MSMFALCON)
int platform_get_mmap_data_fd(void *platform, int fe_dev, int dir, int *fd,
                              uint32_t *size)
+45 −2
Original line number Diff line number Diff line
@@ -6739,8 +6739,10 @@ void platform_check_and_update_copp_sample_rate(void* platform, snd_device_t snd
     } else
         *sample_rate = stream_sr;

     ALOGI("sn_device %d device sr %d stream sr %d copp sr %d", snd_device, device_sr, stream_sr
, *sample_rate);
    if (snd_device == SND_DEVICE_OUT_HDMI)
        *sample_rate = platform_get_supported_sampling_rate_on_hdmi(stream_sr);

     ALOGI("sn_device %d device sr %d stream sr %d copp sr %d", snd_device, device_sr, stream_sr, *sample_rate);

}

@@ -7548,6 +7550,47 @@ int platform_get_max_codec_backend() {

    return MAX_CODEC_BACKENDS;
}
int platform_get_supported_sampling_rate_on_hdmi(uint32_t stream_sr)
{
    int sample_rate;
    switch (stream_sr){
        case 8000:
        case 11025:
        case 16000:
        case 22050:
        case 32000:
        case 48000:
            sample_rate = 48000;
            break;
        case 44100:
            sample_rate = 44100;
            break;
        case 64000:
        case 96000:
            sample_rate = 96000;
            break;
        case 88200:
            sample_rate = 88200;
            break;
        case 176400:
            sample_rate = 176400;
            break;
        case 192000:
            sample_rate = 192000;
            break;
        case 352800:
            sample_rate = 352800;
            break;
        case 384000:
            sample_rate = 384000;
            break;
        case 144000:
        default:
            sample_rate = 48000;
            break;
    }
    return sample_rate;
}

#if defined (PLATFORM_MSM8998) || (PLATFORM_SDM845) || (PLATFORM_SDM670)
int platform_get_mmap_data_fd(void *platform, int fe_dev, int dir, int *fd,
+1 −0
Original line number Diff line number Diff line
@@ -184,6 +184,7 @@ void platform_get_device_to_be_id_map(int **be_id_map, int *length);

int platform_set_channel_allocation(void *platform, int channel_alloc);
int platform_get_edid_info(void *platform);
int platform_get_supported_sampling_rate_on_hdmi(uint32_t stream_sr);
int platform_set_channel_map(void *platform, int ch_count, char *ch_map,
                             int snd_id);
int platform_set_stream_channel_map(void *platform, audio_channel_mask_t channel_mask,