Skip to content

Commit c1fec7d

Browse files
akanisettisysopenci
authored andcommitted
Fix Audio server crash
Fixes the crash by resetting device number from -1 to 0. Tracked-On: OAM-134648 Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
1 parent dedbb13 commit c1fec7d

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From c8f4ffb18fc5d7256ff4e4b40814c57dc6f55179 Mon Sep 17 00:00:00 2001
2+
From: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
3+
Date: Thu, 4 Dec 2025 12:45:21 +0000
4+
Subject: [PATCH] Added a fix for Audio server crash
5+
6+
Fixes the crash by resetting device number from -1 to 0.
7+
8+
Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
9+
---
10+
audio/aidl/default/primary/StreamPrimary.cpp | 3 +++
11+
1 file changed, 3 insertions(+)
12+
13+
diff --git a/audio/aidl/default/primary/StreamPrimary.cpp b/audio/aidl/default/primary/StreamPrimary.cpp
14+
index 4e9e2d863e..a3c36e3086 100644
15+
--- a/audio/aidl/default/primary/StreamPrimary.cpp
16+
+++ b/audio/aidl/default/primary/StreamPrimary.cpp
17+
@@ -183,6 +183,9 @@ StreamPrimary::AlsaDeviceId StreamPrimary::getCardAndDeviceId(
18+
AlsaDeviceId cardAndDeviceId;
19+
cardAndDeviceId.first = primary::PrimaryMixer::get_pcm_card("PCH");
20+
cardAndDeviceId.second = primary::PrimaryMixer::get_pcm_device(cardAndDeviceId.first);
21+
+ if (cardAndDeviceId.second == -1) {
22+
+ cardAndDeviceId.second = 0;
23+
+ }
24+
LOG(DEBUG) << __func__ << ": parsed with card id " << cardAndDeviceId.first << ", device id "
25+
<< cardAndDeviceId.second;
26+
return cardAndDeviceId;
27+
--
28+
2.34.1
29+

0 commit comments

Comments
 (0)