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

Commit 2169b100 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "le_audio: Add two source requirements for conversational context" am: 07839ffb

parents b8f4bf8a 07839ffb
Loading
Loading
Loading
Loading
+585 −13

File changed.

Preview size limit exceeded, changes collapsed.

+12 −0
Original line number Diff line number Diff line
@@ -29,6 +29,12 @@
        {
            "name": "Conversational",
            "configurations": [
                "DualDev_OneChanStereoSnk_OneChanStereoSrc_16_2_Server_Preferred",
                "DualDev_OneChanStereoSnk_OneChanStereoSrc_16_2_1",
                "DualDev_OneChanStereoSnk_OneChanStereoSrc_16_2_2",
                "DualDev_OneChanStereoSnk_OneChanStereoSrc_16_1_Server_Preferred",
                "DualDev_OneChanStereoSnk_OneChanStereoSrc_16_1_1",
                "DualDev_OneChanStereoSnk_OneChanStereoSrc_16_1_2",
                "DualDev_OneChanStereoSnk_OneChanMonoSrc_16_2_Server_Preferred",
                "DualDev_OneChanStereoSnk_OneChanMonoSrc_16_2_1",
                "DualDev_OneChanStereoSnk_OneChanMonoSrc_16_1_Server_Preferred",
@@ -37,6 +43,12 @@
                "DualDev_OneChanDoubleStereoSnk_OneChanMonoSrc_16_2_1",
                "DualDev_OneChanDoubleStereoSnk_OneChanMonoSrc_16_1_Server_Preferred",
                "DualDev_OneChanDoubleStereoSnk_OneChanMonoSrc_16_1_1",
                "SingleDev_TwoChanStereoSnk_TwoChanStereoSrc_16_2_Server_Preferred",
                "SingleDev_TwoChanStereoSnk_TwoChanStereoSrc_16_2_1",
                "SingleDev_TwoChanStereoSnk_TwoChanStereoSrc_16_2_2",
                "SingleDev_TwoChanStereoSnk_TwoChanStereoSrc_16_1_Server_Preferred",
                "SingleDev_TwoChanStereoSnk_TwoChanStereoSrc_16_1_1",
                "SingleDev_TwoChanStereoSnk_TwoChanStereoSrc_16_1_2",
                "SingleDev_TwoChanStereoSnk_OneChanMonoSrc_16_2_Server_Preferred",
                "SingleDev_TwoChanStereoSnk_OneChanMonoSrc_16_2_1",
                "SingleDev_TwoChanStereoSnk_OneChanMonoSrc_16_1_Server_Preferred",
+6 −2
Original line number Diff line number Diff line
@@ -947,11 +947,15 @@ uint32_t PickAudioLocation(types::LeAudioConfigurationStrategy strategy,
      }
      break;
    default:
      LOG_ASSERT(0) << " Shall never happen ";
      LOG_ALWAYS_FATAL("%s: Unknown strategy: %hhu", __func__, strategy);
      return 0;
  }

  LOG_ASSERT(0) << " Shall never happen ";
  LOG_ALWAYS_FATAL(
      "%s: Shall never exit switch statement, strategy: %hhu, "
      "locations: %lx, group_locations: %lx",
      __func__, strategy, audio_locations.to_ulong(),
      group_audio_locations->to_ulong());
  return 0;
}

+3 −2
Original line number Diff line number Diff line
@@ -434,7 +434,8 @@ class LeAudioAseConfigurationTest : public Test {
        ::le_audio::codec_spec_conf::kLeAudioLocationFrontLeft |
        ::le_audio::codec_spec_conf::kLeAudioLocationFrontRight;
    device->src_audio_locations_ =
        ::le_audio::codec_spec_conf::kLeAudioLocationFrontLeft;
        ::le_audio::codec_spec_conf::kLeAudioLocationFrontLeft |
        ::le_audio::codec_spec_conf::kLeAudioLocationFrontRight;

    device->conn_id_ = index;
    return device.get();
@@ -756,7 +757,7 @@ TEST_F(LeAudioAseConfigurationTest, test_earbuds_conversional) {
      {left, kLeAudioCodecLC3ChannelCountSingleChannel,
       kLeAudioCodecLC3ChannelCountSingleChannel, 1, 1},
      {right, kLeAudioCodecLC3ChannelCountSingleChannel,
       kLeAudioCodecLC3ChannelCountSingleChannel, 1, 0}};
       kLeAudioCodecLC3ChannelCountSingleChannel, 1, 1}};

  TestGroupAseConfiguration(LeAudioContextType::CONVERSATIONAL, data, 2);
}
+12 −10
Original line number Diff line number Diff line
@@ -1632,7 +1632,8 @@ class UnicastTestNoInit : public Test {
  }

  void TestAudioDataTransfer(int group_id, uint8_t cis_count_out,
                             uint8_t cis_count_in, int data_len) {
                             uint8_t cis_count_in, int data_len,
                             int in_data_len = 40) {
    ASSERT_NE(audio_unicast_sink_receiver_, nullptr);

    // Expect two channels ISO Data to be sent
@@ -1645,8 +1646,9 @@ class UnicastTestNoInit : public Test {
    std::vector<uint8_t> data(data_len);
    audio_unicast_sink_receiver_->OnAudioDataReady(data);

    // Inject microphone data from a single peer device
    EXPECT_CALL(*mock_audio_sink_, SendData(_, _)).Times(cis_count_in);
    // Inject microphone data from group
    EXPECT_CALL(*mock_audio_sink_, SendData(_, _))
        .Times(cis_count_in > 0 ? 1 : 0);
    ASSERT_EQ(streaming_groups.count(group_id), 1u);

    if (cis_count_in) {
@@ -1657,7 +1659,7 @@ class UnicastTestNoInit : public Test {
           device = group->GetNextDevice(device)) {
        for (auto& ase : device->ases_) {
          if (ase.direction == le_audio::types::kLeAudioDirectionSource) {
            InjectIncomingIsoData(group_id, ase.cis_conn_hdl);
            InjectIncomingIsoData(group_id, ase.cis_conn_hdl, in_data_len);
            --cis_count_in;
            if (!cis_count_in) break;
          }
@@ -1678,7 +1680,7 @@ class UnicastTestNoInit : public Test {
  }

  void InjectIncomingIsoData(uint16_t cig_id, uint16_t cis_con_hdl,
                             size_t payload_size = 40) {
                             size_t payload_size) {
    BT_HDR* bt_hdr = (BT_HDR*)malloc(sizeof(BT_HDR) + payload_size);

    bt_hdr->offset = 0;
@@ -2679,8 +2681,8 @@ TEST_F(UnicastTest, TwoEarbudsStreaming) {

  // Verify Data transfer on two peer sinks and one source
  uint8_t cis_count_out = 2;
  uint8_t cis_count_in = 1;
  TestAudioDataTransfer(group_id, cis_count_out, cis_count_in, 1920);
  uint8_t cis_count_in = 2;
  TestAudioDataTransfer(group_id, cis_count_out, cis_count_in, 1920, 40);

  // Suspend
  LeAudioClient::Get()->GroupSuspend(group_id);
@@ -2694,7 +2696,7 @@ TEST_F(UnicastTest, TwoEarbudsStreaming) {
  Mock::VerifyAndClearExpectations(mock_audio_sink_);

  // Verify Data transfer still works
  TestAudioDataTransfer(group_id, cis_count_out, cis_count_in, 1920);
  TestAudioDataTransfer(group_id, cis_count_out, cis_count_in, 1920, 40);

  // Stop
  StopStreaming(group_id, true);
@@ -2837,8 +2839,8 @@ TEST_F(UnicastTest, TwoEarbudsStreamingContextSwitchReconfigure) {

  // Verify Data transfer on two peer sinks and one source
  cis_count_out = 2;
  cis_count_in = 1;
  TestAudioDataTransfer(group_id, cis_count_out, cis_count_in, 1920);
  cis_count_in = 2;
  TestAudioDataTransfer(group_id, cis_count_out, cis_count_in, 1920, 40);
}

TEST_F(UnicastTest, TwoEarbuds2ndLateConnect) {
Loading