Skip to content
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

PATCH: rewritten pulseaudio support #458

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

PATCH: rewritten pulseaudio support #458

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 1.2.13
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2009-02-13 01:10:52 +0000, Hans de Goede wrote:

Created attachment 295
New SDL_pulseaudio.c replacement file

Since the new "glitch free" version of pulseaudio (used in Fedora 10 amongst others), the sound of SDL using apps (like a simple playmus call) has been crackling.

While looking in to fixing this I noticed that the current pulseaudio code in SDL uses pa_simple. However pa_simple uses a thread to pump pulseaudio events and ipc, given that SDL already has its own thread for audio handling this is clearly suboptimal, leading to unnecessary context switching IPC, etc. Also pa_simple does not allow one to implement the WaitAudio() callback for SDL audiodrivers properly.

Given that my work is mostly a rewrite (although some original pieces remain) I'm attaching the new .c and .h file, as that is easier to review then the huge diff.

Let me know if you also want the diff.

This new version has the following features:
-no longer use an additional thread next to the SDL sound thread
-do not crackle with glitch free audio
-when used with a newer pulse, which does glitch free audio, the total latency is
the same as with the alsa driver
-proper WaitAudio() implementation, saving another mixlen worth of latency
-adds a WaitDone() implementation

This patch has been written in consultancy with Lennart Poetering (the pulseaudio author) and has been reviewed by him for correct use of the pa API.

On 2009-02-13 01:11:45 +0000, Hans de Goede wrote:

Created attachment 296
New SDL_pulseaudio.h replacement file

On 2009-03-06 10:09:48 +0000, Ozkan Sezer wrote:

Created attachment 304
compatibility patch for pulseaudio <= 0.9.10

The attached patch (against the new SDL_pulseaudio.h posted here) is required for compatibility with old pulseaudio versions (<= 0.9.10), such as the one in Fedora 9.

On 2009-03-08 00:30:29 +0000, Hans de Goede wrote:

Compatibility patch looks good to me, thanks.

On 2009-09-13 16:33:28 +0000, Ryan C. Gordon wrote:

Tagging this bug with "target-1.2.14" so we can try to resolve it for SDL 1.2.14.

Please note that we may choose to resolve it as WONTFIX. This tag is largely so we have a comprehensive wishlist of bugs to examine for 1.2.14 (and so we can close bugs that we'll never fix, rather than have them live forever in Bugzilla).

--ryan.

On 2009-09-17 05:09:15 +0000, Rene Dudfield wrote:

I can confirm the crackling. Haven't tested this patch though.

On 2009-09-18 08:54:14 +0000, Patrice Mandin wrote:

I just tried loopwave with sample.wav, confirms also cracking using current svn. Will try the patch as soon as possible.

On 2009-09-18 12:14:38 +0000, Patrice Mandin wrote:

(In reply to comment # 6)

I just tried loopwave with sample.wav, confirms also cracking using current
svn. Will try the patch as soon as possible.

I just tried your patch, and at least I did not get any regression. It also seems audio is clearer with it, but I may have a bad ear. I don't know pulse audio enough to know if your patch improves something or not, but I think it's OK, given the improvements you did (if it does not break audio for someone else).

On 2009-09-21 02:28:05 +0000, Sam Lantinga wrote:

This is fixed in subversion, thanks!

Do you give me permission to release your code with SDL 1.3 and future
versions of SDL under both the LGPL and a closed-source commercial
license?

On 2009-09-21 03:32:45 +0000, Hans de Goede wrote:

(In reply to comment # 8)

This is fixed in subversion, thanks!

Great.

Do you give me permission to release your code with SDL 1.3 and future
versions of SDL under both the LGPL and a closed-source commercial
license?

Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant