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

Commit 33a69853 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes from topic "le-audio-mic-only-scenario"

* changes:
  LeAudioTestApp: Use primitive int.class as matching parameter for int
  le_audio: Add dual device source ASE only scenario
  le_audio: Add double CIS source ASE only scenario
  le_audio: Add single microphone scenario for conversational context
parents 66cb2c03 42e7658f
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -985,7 +985,7 @@ public class BluetoothProxy {

        try {
            Method groupAddNodeMethod = BluetoothLeAudio.class.getDeclaredMethod("groupAddNode",
                    Integer.class, BluetoothDevice.class);
                    int.class, BluetoothDevice.class);
            groupAddNodeMethod.setAccessible(true);
            groupAddNodeMethod.invoke(bluetoothLeAudio, group_id, device);
        } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
@@ -998,7 +998,7 @@ public class BluetoothProxy {

        try {
            Method groupRemoveNodeMethod = BluetoothLeAudio.class
                    .getDeclaredMethod("groupRemoveNode", Integer.class, BluetoothDevice.class);
                    .getDeclaredMethod("groupRemoveNode", int.class, BluetoothDevice.class);
            groupRemoveNodeMethod.setAccessible(true);
            groupRemoveNodeMethod.invoke(bluetoothLeAudio, group_id, device);
        } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
@@ -1172,7 +1172,7 @@ public class BluetoothProxy {
        // Use hidden API
        try {
            Method getPresetInfoMethod = BluetoothHapClient.class.getDeclaredMethod("getPresetInfo",
                    BluetoothDevice.class, Integer.class);
                    BluetoothDevice.class, int.class);
            getPresetInfoMethod.setAccessible(true);

            new_preset = (BluetoothHapPresetInfo) getPresetInfoMethod.invoke(bluetoothHapClient,
@@ -1268,7 +1268,7 @@ public class BluetoothProxy {
        // Use hidden API
        try {
            Method switchToPreviousPresetForGroupMethod = BluetoothHapClient.class
                    .getDeclaredMethod("switchToPreviousPresetForGroup", Integer.class);
                    .getDeclaredMethod("switchToPreviousPresetForGroup", int.class);
            switchToPreviousPresetForGroupMethod.setAccessible(true);

            switchToPreviousPresetForGroupMethod.invoke(bluetoothHapClient, group_id);
@@ -1285,7 +1285,7 @@ public class BluetoothProxy {
        // Use hidden API
        try {
            Method switchToNextPresetForGroupMethod = BluetoothHapClient.class
                    .getDeclaredMethod("switchToNextPresetForGroup", Integer.class);
                    .getDeclaredMethod("switchToNextPresetForGroup", int.class);
            switchToNextPresetForGroupMethod.setAccessible(true);

            switchToNextPresetForGroupMethod.invoke(bluetoothHapClient, group_id);
+285 −0
Original line number Diff line number Diff line
@@ -362,6 +362,26 @@
            "codec_config_name": "SingleDev_OneChanMonoSnk_OneChanMonoSrc_16_1",
            "qos_config_name": ["QoS_Config_16_1_1"]
        },
        {
            "name": "DualDev_OneChanMonoSrc_16_2_Server_Preferred",
            "codec_config_name": "DualDev_OneChanMonoSrc_16_2",
            "qos_config_name": ["QoS_Config_Server_Preferred"]
        },
        {
            "name": "SingleDev_OneChanStereoSrc_16_2_Server_Preferred",
            "codec_config_name": "SingleDev_OneChanStereoSrc_16_2",
            "qos_config_name": ["QoS_Config_Server_Preferred"]
        },
        {
            "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 +1246,139 @@
                }
            ]
        },
        {
            "name": "SingleDev_OneChanStereoSrc_16_2",
            "subconfigurations": [
                {
                    "device_cnt": 1,
                    "ase_cnt": 2,
                    "direction": "SOURCE",
                    "configuration_strategy": "STEREO_TWO_CISES_PER_DEVICE",
                    "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": "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 +3430,138 @@
                }
            ]
        },
        {
            "name": "DualDev_OneChanMonoSrc_16_2",
            "subconfigurations": [
                {
                    "device_cnt": 2,
                    "ase_cnt": 2,
                    "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": "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": [
+4 −0
Original line number Diff line number Diff line
@@ -75,6 +75,10 @@
                "SingleDev_OneChanMonoSnk_OneChanMonoSrc_16_2_1",
                "SingleDev_OneChanMonoSnk_OneChanMonoSrc_16_1_Server_Preferred",
                "SingleDev_OneChanMonoSnk_OneChanMonoSrc_16_1_1",
                "DualDev_OneChanMonoSrc_16_2_Server_Preferred",
                "SingleDev_OneChanStereoSrc_16_2_Server_Preferred",
                "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) {