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

Commit 4fd1cd0a authored by Grzegorz Kołodziejczyk's avatar Grzegorz Kołodziejczyk
Browse files

le_audio: Add single microphone scenario for conversational context

Some devices may be microphone only audio devices, allow them to be
usable in LE Audio context.

Test: atest bluetooth_le_audio_client_test
Sponsor: @jpawlowski
Bug: 229802353
Change-Id: Id5f5afc0130c5642d6cad8098ac8502783c15621
(cherry picked from commit e32b43e20549a549f659ea81432d805d6b7d69de)
parent 82b06cbe
Loading
Loading
Loading
Loading
+142 −0
Original line number Diff line number Diff line
@@ -362,6 +362,16 @@
            "codec_config_name": "SingleDev_OneChanMonoSnk_OneChanMonoSrc_16_1",
            "qos_config_name": ["QoS_Config_16_1_1"]
        },
        {
            "name": "SingleDev_OneChanMonoSrc_24_2_Server_Preferred",
            "codec_config_name": "SingleDev_OneChanMonoSrc_24_2",
            "qos_config_name": ["QoS_Config_Server_Preferred"]
        },
        {
            "name": "SingleDev_OneChanMonoSrc_16_2_Server_Preferred",
            "codec_config_name": "SingleDev_OneChanMonoSrc_16_2",
            "qos_config_name": ["QoS_Config_Server_Preferred"]
        },
        {
            "name": "SingleDev_OneChanMonoSnk_OneChanMonoSrc_16_1_2",
            "codec_config_name": "SingleDev_OneChanMonoSnk_OneChanMonoSrc_16_1",
@@ -1226,6 +1236,72 @@
                }
            ]
        },
        {
            "name": "SingleDev_OneChanMonoSrc_24_2",
            "subconfigurations": [
                {
                    "device_cnt": 1,
                    "ase_cnt": 1,
                    "direction": "SOURCE",
                    "codec_id": {
                        "coding_format": 6,
                        "vendor_company_id": 0,
                        "vendor_codec_id": 0
                    },
                    "codec_configuration": [
                        {
                            "name": "sampling_frequency",
                            "type": 1,
                            "compound_value": {
                                "value": [
                                    5
                                ]
                            }
                        },
                        {
                            "name": "frame_duration",
                            "type": 2,
                            "compound_value": {
                                "value": [
                                    1
                                ]
                            }
                        },
                        {
                            "name": "audio_channel_allocation",
                            "type": 3,
                            "compound_value": {
                                "value": [
                                    1,
                                    0,
                                    0,
                                    0
                                ]
                            }
                        },
                        {
                            "name": "octets_per_codec_frame",
                            "type": 4,
                            "compound_value": {
                                "value": [
                                    60,
                                    0
                                ]
                            }
                        },
                        {
                            "name": "codec_frame_blocks_per_sdu",
                            "type": 5,
                            "compound_value": {
                                "value": [
                                    1
                                ]
                            }
                        }
                    ]
                }
            ]
        },
        {
            "name": "SingleDev_OneChanMonoSnk_16_2",
            "subconfigurations": [
@@ -3277,6 +3353,72 @@
                }
            ]
        },
        {
            "name": "SingleDev_OneChanMonoSrc_16_2",
            "subconfigurations": [
                {
                    "device_cnt": 1,
                    "ase_cnt": 1,
                    "direction": "SOURCE",
                    "codec_id": {
                        "coding_format": 6,
                        "vendor_company_id": 0,
                        "vendor_codec_id": 0
                    },
                    "codec_configuration": [
                        {
                            "name": "sampling_frequency",
                            "type": 1,
                            "compound_value": {
                                "value": [
                                    3
                                ]
                            }
                        },
                        {
                            "name": "frame_duration",
                            "type": 2,
                            "compound_value": {
                                "value": [
                                    1
                                ]
                            }
                        },
                        {
                            "name": "audio_channel_allocation",
                            "type": 3,
                            "compound_value": {
                                "value": [
                                    1,
                                    0,
                                    0,
                                    0
                                ]
                            }
                        },
                        {
                            "name": "octets_per_codec_frame",
                            "type": 4,
                            "compound_value": {
                                "value": [
                                    40,
                                    0
                                ]
                            }
                        },
                        {
                            "name": "codec_frame_blocks_per_sdu",
                            "type": 5,
                            "compound_value": {
                                "value": [
                                    1
                                ]
                            }
                        }
                    ]
                }
            ]
        },
        {
            "name": "DualDev_OneChanStereoSnk_48_4",
            "subconfigurations": [
+2 −0
Original line number Diff line number Diff line
@@ -75,6 +75,8 @@
                "SingleDev_OneChanMonoSnk_OneChanMonoSrc_16_2_1",
                "SingleDev_OneChanMonoSnk_OneChanMonoSrc_16_1_Server_Preferred",
                "SingleDev_OneChanMonoSnk_OneChanMonoSrc_16_1_1",
                "SingleDev_OneChanMonoSrc_24_2_Server_Preferred",
                "SingleDev_OneChanMonoSrc_16_2_Server_Preferred",
                "VND_SingleDev_TwoChanStereoSnk_TwoChanStereoSrc_32khz_Server_Prefered_1",
                "VND_SingleDev_TwoChanStereoSnk_TwoChanStereoSrc_32khz_60oct_R3_L22_1"
            ]
+10 −2
Original line number Diff line number Diff line
@@ -206,7 +206,7 @@ bool IsLc3SettingSupported(LeAudioContextType context_type, Lc3SettingId id) {

    case LeAudioContextType::CONVERSATIONAL:
      if (id == Lc3SettingId::LC3_16_1 || id == Lc3SettingId::LC3_16_2 ||
          id == Lc3SettingId::LC3_32_2)
          id == Lc3SettingId::LC3_24_2 || id == Lc3SettingId::LC3_32_2)
        return true;

      break;
@@ -586,9 +586,15 @@ class LeAudioAseConfigurationTest : public Test {

  void TestAsesActive(LeAudioCodecId codec_id, uint8_t sampling_frequency,
                      uint8_t frame_duration, uint16_t octets_per_frame) {
    bool active_ase = false;

    for (const auto& device : devices_) {
      for (const auto& ase : device->ases_) {
        ASSERT_TRUE(ase.active);
        if (!ase.active) continue;

        /* Configure may request only partial ases to be activated */
        if (!active_ase && ase.active) active_ase = true;

        ASSERT_EQ(ase.codec_id, codec_id);

        /* FIXME: Validate other codec parameters than LC3 if any */
@@ -600,6 +606,8 @@ class LeAudioAseConfigurationTest : public Test {
        }
      }
    }

    ASSERT_TRUE(active_ase);
  }

  void TestActiveAses(void) {