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

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

Merge "hal: Add 8K, 11.025K, 16K, 22.05K and 32K SR support for USB."

parents bb3db122 63c02ea4
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -53,7 +53,7 @@
#define SAMPLE_RATE_11025         11025
#define SAMPLE_RATE_11025         11025
// Supported sample rates for USB
// Supported sample rates for USB
static uint32_t supported_sample_rates[] =
static uint32_t supported_sample_rates[] =
    {44100, 48000, 64000, 88200, 96000, 176400, 192000, 352800, 384000};
    {8000, 11025, 16000, 22050, 32000, 44100, 48000, 64000, 88200, 96000, 176400, 192000, 352800, 384000};


#define  MAX_SAMPLE_RATE_SIZE  sizeof(supported_sample_rates)/sizeof(supported_sample_rates[0])
#define  MAX_SAMPLE_RATE_SIZE  sizeof(supported_sample_rates)/sizeof(supported_sample_rates[0])


+59 −40
Original line number Original line Diff line number Diff line
@@ -5383,16 +5383,34 @@ static int platform_set_codec_backend_cfg(struct audio_device* adev,
            char *rate_str = NULL;
            char *rate_str = NULL;
            struct  mixer_ctl *ctl = NULL;
            struct  mixer_ctl *ctl = NULL;


            if (backend_idx == USB_AUDIO_RX_BACKEND ||
                    backend_idx == USB_AUDIO_TX_BACKEND) {
                switch (sample_rate) {
                switch (sample_rate) {
                case 32000:
                case 32000:
                if (passthrough_enabled) {
                        rate_str = "KHZ_32";
                        rate_str = "KHZ_32";
                        break;
                        break;
                }
                case 8000:
                case 8000:
                        rate_str = "KHZ_8";
                        break;
                case 11025:
                case 11025:
                        rate_str = "HZ_11P025";
                        break;
                case 16000:
                case 16000:
                        rate_str = "KHZ_16";
                        break;
                case 22050:
                case 22050:
                        rate_str = "KHZ_22P05";
                        break;
                }
            }

            if (rate_str == NULL) {
                switch (sample_rate) {
                case 32000:
                    if (passthrough_enabled) {
                        rate_str = "KHZ_32";
                        break;
                    }
                case 48000:
                case 48000:
                    rate_str = "KHZ_48";
                    rate_str = "KHZ_48";
                    break;
                    break;
@@ -5427,6 +5445,7 @@ static int platform_set_codec_backend_cfg(struct audio_device* adev,
                    rate_str = "KHZ_48";
                    rate_str = "KHZ_48";
                    break;
                    break;
                }
                }
            }


            ctl = mixer_get_ctl_by_name(adev->mixer,
            ctl = mixer_get_ctl_by_name(adev->mixer,
                my_data->current_backend_cfg[backend_idx].samplerate_mixer_ctl);
                my_data->current_backend_cfg[backend_idx].samplerate_mixer_ctl);
+59 −40
Original line number Original line Diff line number Diff line
@@ -5259,16 +5259,34 @@ static int platform_set_codec_backend_cfg(struct audio_device* adev,
            char *rate_str = NULL;
            char *rate_str = NULL;
            struct  mixer_ctl *ctl = NULL;
            struct  mixer_ctl *ctl = NULL;


            if (backend_idx == USB_AUDIO_RX_BACKEND ||
                    backend_idx == USB_AUDIO_TX_BACKEND) {
                switch (sample_rate) {
                switch (sample_rate) {
                case 32000:
                case 32000:
                if (passthrough_enabled) {
                        rate_str = "KHZ_32";
                        rate_str = "KHZ_32";
                        break;
                        break;
                }
                case 8000:
                case 8000:
                        rate_str = "KHZ_8";
                        break;
                case 11025:
                case 11025:
                        rate_str = "HZ_11P025";
                        break;
                case 16000:
                case 16000:
                        rate_str = "KHZ_16";
                        break;
                case 22050:
                case 22050:
                        rate_str = "KHZ_22P05";
                        break;
                }
            }

            if (rate_str == NULL) {
                switch (sample_rate) {
                case 32000:
                    if (passthrough_enabled) {
                        rate_str = "KHZ_32";
                        break;
                    }
                case 48000:
                case 48000:
                    rate_str = "KHZ_48";
                    rate_str = "KHZ_48";
                    break;
                    break;
@@ -5303,6 +5321,7 @@ static int platform_set_codec_backend_cfg(struct audio_device* adev,
                    rate_str = "KHZ_48";
                    rate_str = "KHZ_48";
                    break;
                    break;
                }
                }
            }


            ctl = mixer_get_ctl_by_name(adev->mixer,
            ctl = mixer_get_ctl_by_name(adev->mixer,
                my_data->current_backend_cfg[backend_idx].samplerate_mixer_ctl);
                my_data->current_backend_cfg[backend_idx].samplerate_mixer_ctl);