You've already forked linux-t2-patches
mirror of
https://github.com/t2linux/linux-t2-patches.git
synced 2026-04-30 13:52:11 -07:00
Fix audio output latency
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
From 6b6cd186e0187042aaa121f9d3af62a6836a83bc Mon Sep 17 00:00:00 2001
|
||||
From: Aditya Garg <gargaditya08@live.com>
|
||||
Date: Sun, 22 Feb 2026 04:00:19 +0000
|
||||
From 4ef99b787fa01fd3f5845f66cb0a3e1c83150841 Mon Sep 17 00:00:00 2001
|
||||
From: "github-actions[bot]"
|
||||
<41898282+github-actions[bot]@users.noreply.github.com>
|
||||
Date: Thu, 26 Feb 2026 08:51:45 +0000
|
||||
Subject: [PATCH] Add apple-bce driver
|
||||
|
||||
---
|
||||
@@ -590,7 +591,7 @@ index 000000000..58dbeff79
|
||||
+#endif //APPLE_BCE_H
|
||||
diff --git a/drivers/staging/apple-bce/audio/audio.c b/drivers/staging/apple-bce/audio/audio.c
|
||||
new file mode 100644
|
||||
index 000000000..bd16ddd16
|
||||
index 000000000..16bd50fd1
|
||||
--- /dev/null
|
||||
+++ b/drivers/staging/apple-bce/audio/audio.c
|
||||
@@ -0,0 +1,711 @@
|
||||
@@ -868,10 +869,10 @@ index 000000000..bd16ddd16
|
||||
+ dev_err(a->dev, "Failed to get input stream list for device %llx\n", dev_id);
|
||||
+ goto fail;
|
||||
+ }
|
||||
+ if (stream_cnt > AAUDIO_DEIVCE_MAX_INPUT_STREAMS) {
|
||||
+ if (stream_cnt > AAUDIO_DEVICE_MAX_INPUT_STREAMS) {
|
||||
+ dev_warn(a->dev, "Device %s input stream count %llu is larger than the supported count of %u\n",
|
||||
+ sdev->uid, stream_cnt, AAUDIO_DEIVCE_MAX_INPUT_STREAMS);
|
||||
+ stream_cnt = AAUDIO_DEIVCE_MAX_INPUT_STREAMS;
|
||||
+ sdev->uid, stream_cnt, AAUDIO_DEVICE_MAX_INPUT_STREAMS);
|
||||
+ stream_cnt = AAUDIO_DEVICE_MAX_INPUT_STREAMS;
|
||||
+ }
|
||||
+ sdev->in_stream_cnt = stream_cnt;
|
||||
+ for (i = 0; i < stream_cnt; i++) {
|
||||
@@ -885,17 +886,17 @@ index 000000000..bd16ddd16
|
||||
+ dev_err(a->dev, "Failed to get output stream list for device %llx\n", dev_id);
|
||||
+ goto fail;
|
||||
+ }
|
||||
+ if (stream_cnt > AAUDIO_DEIVCE_MAX_OUTPUT_STREAMS) {
|
||||
+ dev_warn(a->dev, "Device %s input stream count %llu is larger than the supported count of %u\n",
|
||||
+ sdev->uid, stream_cnt, AAUDIO_DEIVCE_MAX_OUTPUT_STREAMS);
|
||||
+ stream_cnt = AAUDIO_DEIVCE_MAX_OUTPUT_STREAMS;
|
||||
+ if (stream_cnt > AAUDIO_DEVICE_MAX_OUTPUT_STREAMS) {
|
||||
+ dev_warn(a->dev, "Device %s output stream count %llu is larger than the supported count of %u\n",
|
||||
+ sdev->uid, stream_cnt, AAUDIO_DEVICE_MAX_OUTPUT_STREAMS);
|
||||
+ stream_cnt = AAUDIO_DEVICE_MAX_OUTPUT_STREAMS;
|
||||
+ }
|
||||
+ sdev->out_stream_cnt = stream_cnt;
|
||||
+ for (i = 0; i < stream_cnt; i++) {
|
||||
+ sdev->out_streams[i].id = stream_list[i];
|
||||
+ sdev->out_streams[i].buffer_cnt = 0;
|
||||
+ aaudio_init_stream_info(sdev, &sdev->out_streams[i]);
|
||||
+ sdev->out_streams[i].latency += sdev->in_latency;
|
||||
+ sdev->out_streams[i].latency += sdev->out_latency;
|
||||
+ }
|
||||
+
|
||||
+ if (sdev->is_pcm)
|
||||
@@ -1050,10 +1051,10 @@ index 000000000..bd16ddd16
|
||||
+{
|
||||
+ size_t i;
|
||||
+ strm->buffer_cnt = bs_strm->num_buffers;
|
||||
+ if (bs_strm->num_buffers > AAUDIO_DEIVCE_MAX_BUFFER_COUNT) {
|
||||
+ if (bs_strm->num_buffers > AAUDIO_DEVICE_MAX_BUFFER_COUNT) {
|
||||
+ dev_warn(a->dev, "BufferStruct buffer count %u exceeds driver limit of %u\n", bs_strm->num_buffers,
|
||||
+ AAUDIO_DEIVCE_MAX_BUFFER_COUNT);
|
||||
+ strm->buffer_cnt = AAUDIO_DEIVCE_MAX_BUFFER_COUNT;
|
||||
+ AAUDIO_DEVICE_MAX_BUFFER_COUNT);
|
||||
+ strm->buffer_cnt = AAUDIO_DEVICE_MAX_BUFFER_COUNT;
|
||||
+ }
|
||||
+ if (!strm->buffer_cnt)
|
||||
+ return;
|
||||
@@ -1307,7 +1308,7 @@ index 000000000..bd16ddd16
|
||||
+MODULE_PARM_DESC(id, "ID string for Apple Internal Audio soundcard.");
|
||||
diff --git a/drivers/staging/apple-bce/audio/audio.h b/drivers/staging/apple-bce/audio/audio.h
|
||||
new file mode 100644
|
||||
index 000000000..004bc1e22
|
||||
index 000000000..ebbfaa116
|
||||
--- /dev/null
|
||||
+++ b/drivers/staging/apple-bce/audio/audio.h
|
||||
@@ -0,0 +1,125 @@
|
||||
@@ -1323,9 +1324,9 @@ index 000000000..004bc1e22
|
||||
+#define AAUDIO_SIG 0x19870423
|
||||
+
|
||||
+#define AAUDIO_DEVICE_MAX_UID_LEN 128
|
||||
+#define AAUDIO_DEIVCE_MAX_INPUT_STREAMS 1
|
||||
+#define AAUDIO_DEIVCE_MAX_OUTPUT_STREAMS 1
|
||||
+#define AAUDIO_DEIVCE_MAX_BUFFER_COUNT 1
|
||||
+#define AAUDIO_DEVICE_MAX_INPUT_STREAMS 1
|
||||
+#define AAUDIO_DEVICE_MAX_OUTPUT_STREAMS 1
|
||||
+#define AAUDIO_DEVICE_MAX_BUFFER_COUNT 1
|
||||
+
|
||||
+#define AAUDIO_BUFFER_ID_NONE 0xffu
|
||||
+
|
||||
@@ -1390,9 +1391,9 @@ index 000000000..004bc1e22
|
||||
+ int alsa_id;
|
||||
+ char uid[AAUDIO_DEVICE_MAX_UID_LEN + 1];
|
||||
+ size_t in_stream_cnt;
|
||||
+ struct aaudio_stream in_streams[AAUDIO_DEIVCE_MAX_INPUT_STREAMS];
|
||||
+ struct aaudio_stream in_streams[AAUDIO_DEVICE_MAX_INPUT_STREAMS];
|
||||
+ size_t out_stream_cnt;
|
||||
+ struct aaudio_stream out_streams[AAUDIO_DEIVCE_MAX_OUTPUT_STREAMS];
|
||||
+ struct aaudio_stream out_streams[AAUDIO_DEVICE_MAX_OUTPUT_STREAMS];
|
||||
+ bool is_pcm;
|
||||
+ struct snd_pcm *pcm;
|
||||
+ struct snd_jack *jack;
|
||||
@@ -5931,5 +5932,5 @@ index 000000000..d1e80d8e8
|
||||
+
|
||||
+#endif //BCE_VHCI_H
|
||||
--
|
||||
2.52.0
|
||||
2.53.0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user