SDLPoP and SDL 2.0.6

Open-source port of PoP that runs natively on Windows, Linux, etc.

Moderator: English Moderator Team

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3140
Joined: April 9th, 2009, 10:58 pm
Contact:

SDLPoP and SDL 2.0.6

Post by Norbert » September 5th, 2017, 7:31 pm

Not sure if it brings anything useful for SDLPoP, but there's now a prerelease of SDL 2.0.6:
https://discourse.libsdl.org/t/sdl-2-0-6-prerelease/

David
The Prince of Persia
The Prince of Persia
Posts: 1496
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: SDLPoP; David's open-source port of PoP

Post by David » September 9th, 2017, 10:30 am

Norbert wrote:Not sure if it brings anything useful for SDLPoP, but there's now a prerelease of SDL 2.0.6:
https://discourse.libsdl.org/t/sdl-2-0-6-prerelease/
I tried the new DLL, and at least there are no new bugs, like this one with SDL 2.0.4: viewtopic.php?p=18142#p18142
This is good, considering that a commenter wrote that SDL_mixer can't play anything with this new SDL.

Falcury
Wise Scribe
Wise Scribe
Posts: 327
Joined: June 25th, 2009, 10:01 pm

Re: SDLPoP; David's open-source port of PoP

Post by Falcury » September 12th, 2017, 6:32 pm

For me too the 2.0.6 pre-release seems to work well.
The DLL became a bit smaller as compared to 2.0.5, oddly.

Edit: Ran into the following problem when building SDLPoP with the new SDL version:

Code: Select all

In file included from C:\work\code\SDLPoP\src\common.h:38:0,
                 from C:\work\code\SDLPoP\src\seg000.c:21:
C:\work\code\SDLPoP\src\types.h:44:0: warning: "SDL_COMPILE_TIME_ASSERT" redefined
 #define SDL_COMPILE_TIME_ASSERT(name, x)               \
 
In file included from C:/work/libraries/SDL2-2.0.6/i686-w64-mingw32/include/SDL2/SDL_main.h:25:0,
                 from C:/work/libraries/SDL2-2.0.6/i686-w64-mingw32/include/SDL2/SDL.h:32,
                 from C:\work\code\SDLPoP\src\types.h:25,
                 from C:\work\code\SDLPoP\src\common.h:38,
                 from C:\work\code\SDLPoP\src\seg000.c:21:
C:/work/libraries/SDL2-2.0.6/i686-w64-mingw32/include/SDL2/SDL_stdinc.h:274:0: note: this is the location of the previous definition
 #define SDL_COMPILE_TIME_ASSERT(name, x)               \
At first I thought that the change from 2.0.5 to 2.0.6 must have been that they removed the #undef at the end of the header file where the SDL_COMPILE_TIME_ASSERT macro was defined. However, in the 2.0.5 headers, I also couldn't find the #undef anywhere.
So, I suspect that the #undef has been removed for some time now, and we haven't noticed up until now, because the C compiler silently accepts redefinitions.
The catch is, redefinitions are only accepted as long as the redefined macro stays exactly the same. And in SDL 2.0.6, the definition changed slightly:

Code: Select all

// SDL 2.0.5
#define SDL_COMPILE_TIME_ASSERT(name, x)               \
       typedef int SDL_dummy_ ## name[(x) * 2 - 1]
       
// SDL 2.0.6
#define SDL_COMPILE_TIME_ASSERT(name, x)               \
       typedef int SDL_compile_time_assert_ ## name[(x) * 2 - 1]
Suggested fix here:
https://github.com/NagyD/SDLPoP/pull/136

David
The Prince of Persia
The Prince of Persia
Posts: 1496
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: SDLPoP; David's open-source port of PoP

Post by David » September 17th, 2017, 9:45 am

Falcury wrote:Suggested fix here:
https://github.com/NagyD/SDLPoP/pull/136
I added some information about SDL_COMPILE_TIME_ASSERT in a comment.

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3140
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: SDLPoP; David's open-source port of PoP

Post by Norbert » September 23rd, 2017, 5:22 pm

David wrote:
September 9th, 2017, 10:30 am
This is good, considering that a commenter wrote that SDL_mixer can't play anything with this new SDL.
And it looks like they have now released 2.0.6 (~20 hours ago) without first fixing that issue.
(See comments on linked page.)

David
The Prince of Persia
The Prince of Persia
Posts: 1496
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: SDLPoP; David's open-source port of PoP

Post by David » September 24th, 2017, 10:16 am

Norbert wrote:
September 23rd, 2017, 5:22 pm
And it looks like they have now released 2.0.6 (~20 hours ago) without first fixing that issue.
(See comments on linked page.)
Well, I don't have that problem.

Instead I have something else: The slamming of the level door has some popping/cracking noises.
This bug is only present in the final 2.0.6, it was not present in the pre-release 2.0.6 version!
EDIT: This happens on both Windows and Linux.

David
The Prince of Persia
The Prince of Persia
Posts: 1496
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: SDLPoP and SDL 2.0.6

Post by David » September 24th, 2017, 2:31 pm

Moved posts to a new topic.

I am currently trying to figure out which change (in SDL) introduced the popping noises.
hg bisect seems to be useful for this.

David
The Prince of Persia
The Prince of Persia
Posts: 1496
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: SDLPoP and SDL 2.0.6

Post by David » September 24th, 2017, 6:56 pm

David wrote:
September 24th, 2017, 2:31 pm
I am currently trying to figure out which change (in SDL) introduced the popping noises.
hg bisect seems to be useful for this.
First of all, I have to fully recompile SDL every time I checkout (hg update) a different version.
And that's *very* slow: it takes about 4 minutes!
That's because the build process modifies include/SDL_config.h and include/SDL_revision.h, on which *all* source files depend!


This is what I found:

https://hg.libsdl.org/SDL/rev/bb99dede0675 (2016 Nov 05)
This changeset makes sounds too high-pitched. The level door slam sounds almost metallic.
(This exact revision won't compile, you need to go forward 2 revisions.)

https://bugzilla.libsdl.org/show_bug.cgi?id=3507
https://hg.libsdl.org/SDL/rev/f6cd81aab88e (2016 Dec 17)
This changeset fixed the pitch, but the popping is still there.

https://hg.libsdl.org/SDL/rev/329d6d46fb90 (2017 Jan 05)
This *might* be the one that fixed popping, but this exact revision crashes SDLPoP on startup, and I'm too tired for further recompilations...

EDIT: Nope, this is what fixed the (first) popping:
https://bugzilla.libsdl.org/show_bug.cgi?id=3775
https://hg.libsdl.org/SDL/rev/4cdc242e4102 (2017 Aug 29)

https://bugzilla.libsdl.org/show_bug.cgi?id=3661
https://hg.libsdl.org/SDL/rev/a8382e3d0b54 (2017 Sep 21)
This changeset fully rewrote the resampling.
This re-added the popping! (The previous revision does not have the popping.)
This change seems like an afterthought, one day before the final release, and much after the pre-release.
Ironically, this was intended to *fix* some noise...


The prerelease page doesn't tell which revision it is.
The files in the pre-release are dated 2017 September 5, 7:55.
The last changeset before that date is: https://hg.libsdl.org/SDL/rev/a2424c89f53e (2017 Sep 04)
The popping is not present here!

In the final 2.0.6, the files are dated 2017 September 22, 20:54.
It's from this revision: https://hg.libsdl.org/SDL/rev/release-2.0.6 (2017 Sep 22)

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3140
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: SDLPoP and SDL 2.0.6

Post by Norbert » September 24th, 2017, 8:05 pm

A lot of time and energy you've invested in this.
It's unfortunate that they didn't polish SDL enough to prevent this struggle.
I guess close the research chapter with a bug report that points to your findings?
If you want, I can file the bug report for you.

David
The Prince of Persia
The Prince of Persia
Posts: 1496
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: SDLPoP and SDL 2.0.6

Post by David » September 24th, 2017, 8:24 pm

Norbert wrote:
September 24th, 2017, 8:05 pm
It's unfortunate that they didn't polish SDL enough to prevent this struggle.
Do you mean the popping bug, or the long full recompiling, or both?
Norbert wrote:
September 24th, 2017, 8:05 pm
I guess close the research chapter with a bug report that points to your findings?
If you want, I can file the bug report for you.
We need some simple testcase for that.
Maybe a simple program that plays the door slam wav.
(We could attach the wav as exported by PR.
Or, to make sure it uses the exact same data: change SDLPoP to export the in-memory wav that is generated from DIGISND*.DAT, to a file, and attach that.)

I'm already working on the testcase.

And maybe I could file another report about why do I have to fully recompile after each `hg update`, instead of recompiling only the changed sources?

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3140
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: SDLPoP and SDL 2.0.6

Post by Norbert » September 24th, 2017, 8:43 pm

David wrote:
September 24th, 2017, 8:24 pm
Norbert wrote:
September 24th, 2017, 8:05 pm
It's unfortunate that they didn't polish SDL enough to prevent this struggle.
Do you mean the popping bug, or the long full recompiling, or both?
I meant both, but especially the tedious recompiling.
I'd say definitely add a bug report about having to recompile fully each time...

David
The Prince of Persia
The Prince of Persia
Posts: 1496
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: SDLPoP and SDL 2.0.6

Post by David » September 24th, 2017, 9:59 pm

Here is the bug report about the popping: https://bugzilla.libsdl.org/show_bug.cgi?id=3846

David
The Prince of Persia
The Prince of Persia
Posts: 1496
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: SDLPoP and SDL 2.0.6

Post by David » October 1st, 2017, 5:54 pm

It seems that SDL 2.0.6 is causing other problems as well: https://github.com/NagyD/SDLPoP/issues/ ... -333372888

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3140
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: SDLPoP and SDL 2.0.6

Post by Norbert » October 2nd, 2017, 12:52 am

Well, at least you don't have to invest time and energy into fixing this.
Other developers are also (having and) reporting sound issues with 2.0.6.
If you ignore SDLPoP bug reports related to audio for the next 3-6 months...
...SDL developers will probably have fixed the issues then. :P

David
The Prince of Persia
The Prince of Persia
Posts: 1496
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: SDLPoP and SDL 2.0.6

Post by David » October 15th, 2017, 8:26 am

David wrote:
September 24th, 2017, 9:59 pm
Here is the bug report about the popping: https://bugzilla.libsdl.org/show_bug.cgi?id=3846
Further developments:
Ryan marked it as a duplicate, but my bug is still present.
So I attached a recording and some analysis.

Post Reply