-
Notifications
You must be signed in to change notification settings - Fork 720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libcanberra: Fix sound not playing on Colibri iMX8X #894
Open
Fighter19
wants to merge
1
commit into
openembedded:master
Choose a base branch
from
Fighter19:pr-canberra
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
...ipes-support/libcanberra/files/0001-Determine-audio-buffer-size-for-a-time-of-500ms.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
From 86488a7fc209ac08dd92c9d50a77e3330e7aedd9 Mon Sep 17 00:00:00 2001 | ||
From: Patrick Zacharias <[email protected]> | ||
Date: Thu, 7 Nov 2024 14:03:29 +0100 | ||
Subject: [PATCH] Determine audio buffer size for a time of 500ms | ||
|
||
On some hardware like the SGTL5000, not specifying a buffer size | ||
results to EINVAL being returned. | ||
|
||
This code sets the buffer time to 500ms and the period time to a fourth of that, | ||
or whatever is nearest to that. | ||
--- | ||
src/alsa.c | 15 +++++++++++++++ | ||
1 file changed, 15 insertions(+) | ||
|
||
diff --git a/src/alsa.c b/src/alsa.c | ||
index bebcc4a..ac26578 100644 | ||
--- a/src/alsa.c | ||
+++ b/src/alsa.c | ||
@@ -258,6 +258,21 @@ static int open_alsa(ca_context *c, struct outstanding *out) { | ||
if ((ret = snd_pcm_hw_params_set_channels(out->pcm, hwparams, ca_sound_file_get_nchannels(out->file))) < 0) | ||
goto finish; | ||
|
||
+ unsigned int buffer_time = 0; | ||
+ if ((ret = snd_pcm_hw_params_get_buffer_time_max(hwparams, &buffer_time, 0)) < 0) | ||
+ goto finish; | ||
+ | ||
+ // Cap the buffer time to 500ms | ||
+ if (buffer_time > 500000) | ||
+ buffer_time = 500000; | ||
+ | ||
+ unsigned int period_time = buffer_time / 4; | ||
+ if ((ret = snd_pcm_hw_params_set_period_time_near(out->pcm, hwparams, &period_time, 0)) < 0) | ||
+ goto finish; | ||
+ | ||
+ if ((ret = snd_pcm_hw_params_set_buffer_time_near(out->pcm, hwparams, &buffer_time, 0)) < 0) | ||
+ goto finish; | ||
+ | ||
if ((ret = snd_pcm_hw_params(out->pcm, hwparams)) < 0) | ||
goto finish; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add
Upstream-Status
field to patch. This is a required field these days.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would Upstream-Status: Pending be appropriate?
The mailing list archive is defunct and no updates to the project have been made on Upstream in 12 years.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes