[Partially-Solved] PCem v12 and Sound Lag

Support and general discussion.
User avatar
James-F
Posts: 69
Joined: Tue 30 May, 2017 10:26 am

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby James-F » Wed 07 Jun, 2017 3:17 pm

Thanks Battler!
libopenal-1.dll indeed fixed all the issues PCem had with sound.
I just copied it to PCem folder and renamed it to openAL32.dll.
Malik
Posts: 17
Joined: Sat 20 May, 2017 2:43 am

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby Malik » Sat 10 Jun, 2017 2:19 am

Alright, I can say that Battler's build is safe to be regarded as solved in terms of sound lag. I have found it works perfectly for me without compiling anything myself.

But I'll leave the thread title to be partially solved because I see official PCem binary is still affected, out of the box. At least for newer system users, perhaps. (And since Battler's **build** seem not to be welcomed here.)

Thanks for so many genuine suggestions and relevant discussions here. Sound department was what nagging me a lot in emulating these classic PCs.

I would still love to see a user adjustable buffer/block size option as suggested by James-F and concurred by others (basic2004 and myself) for better audio output control for end-users, so that we can at least try to eliminate the lags across various machines we are using.

I'm no programmer and I'm just a classic PC hobbyist and so do not know how hard it will be to implement this option, but it's just a friendly suggestion.

"Without software and games testers, no development is complete." - hence the difference in the sound lags across the various machines we are using.

Thank you.
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby Battler » Sat 10 Jun, 2017 3:53 pm

- Malike: It would be solved for mainline PCem quite easily if Sarah switched to a recent GCC which uses libopenal-1.dll.
Malik
Posts: 17
Joined: Sat 20 May, 2017 2:43 am

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby Malik » Sat 10 Jun, 2017 5:00 pm

Battler, is it possible to implement what James'-F has mentioned regarding end-user selectable lag adjustment?

Anyway, Thanks Battler, you've been a great help. I appreciate all the improvements you have been making, continuously.

I really like your shortcuts like full screen toggling and ctr-alt-del. There are quite a number of additional improvements I would like, but for the reason I registered here to get help with audio latency, it's been fulfilled.

I don't know how much work you guys have put into this project, but everything is worth it, sincerely. Either from Sarah or from you or numerous other contributors.

I believe we should all work together instead of finding faults, to make this project great.

Thanks again to all those who helped with this issue of mine. For now, I'm really satisfied with the audio improvements, Battler.

Thanks to James-F too with his help with Sound Blaster improvements. We are both from Vogons.

I'm not sure how many of you guys are from Vogons too. :)
SarahWalker
Site Admin
Posts: 1325
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby SarahWalker » Sat 10 Jun, 2017 8:19 pm

Sound buffer size is now configurable as of rev 762.

Anyone who's been following this thread may notice a discrepancy between the buffer lengths I've mentioned in this thread, and what's been implemented in this commit. The difference simply is that I was previously talking about individual buffer lengths, hence talk about lengths between 20 and 100 ms. However, PCem actually uses 4 buffers in a loop. So the values exposed in the menu take this into account, and hence are given as 100, 200 and 400 ms. In previous terminology, and for those who've been modifying the buffer length by changing SOUNDBUFLEN, this gives actual buffer lengths of 25, 50 and 100 ms. However, the new values are roughly the maximum latency you should actually hear.
SarahWalker
Site Admin
Posts: 1325
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby SarahWalker » Sat 10 Jun, 2017 8:20 pm

Battler wrote:- Malike: It would be solved for mainline PCem quite easily if Sarah switched to a recent GCC which uses libopenal-1.dll.

GCC version has absolutely nothing to do with third party libraries. Pretty certain I've mentioned this to you before...
User avatar
leilei
Posts: 431
Joined: Fri 25 Apr, 2014 4:47 pm

Re: [Solved] PCem v12 and Sound Lag

Postby leilei » Sat 10 Jun, 2017 8:37 pm

Not to mention I brought that up right before the flamewar

leilei wrote:In my case, just using a recent OpenAL-Soft DLL in place helped latency issues, and that's probably where that dll came from anyway (i'm still using an older GCC/MinGW)


FWIW when I played with a much newer enhanced TDM GCC for debunking automatic parallelizing benefiting PCem performance years ago, sound lag was very much still there with Creative's library.
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby Battler » Sat 10 Jun, 2017 9:42 pm

- SarahWalker: But recent MingW/MSys has better/more recent libraries. James-F has said above that with the libopenal-1.dll from my development environment, the audio lag issues are gone.

- leilei: I can give you my development environment's libopenal-1.dll and you can try that.
Malik
Posts: 17
Joined: Sat 20 May, 2017 2:43 am

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby Malik » Sun 11 Jun, 2017 1:32 am

SarahWalker wrote:Sound buffer size is now configurable as of rev 762.


Thank you Sarah, really appreciate it!
User avatar
James-F
Posts: 69
Joined: Tue 30 May, 2017 10:26 am

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby James-F » Sun 11 Jun, 2017 4:59 am

Thanks Sarah.

Only 100, 200, 400?
This is quite limited, the point was to set the buffer value as low as possible without crackling, so the end-user can actually find the lowest value for his system.
Values of 80 (20ms), 60 (15ms), and 40 (10ms) should be included at least for testing.
Better yet, a box where the user can type any latency between 1 and 400, this was the original idea.

@Battler,
Not only the lag issue is gone, but the stereo, aliasing, and crackling/popping issues are gone with libopenal-1.dll.

Sarah, OpenAL32.dll bugs are real and tested, no need to deny or ignore them.
If you can, use the latest library as suggested by Battler.
Malik
Posts: 17
Joined: Sat 20 May, 2017 2:43 am

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby Malik » Sun 11 Jun, 2017 6:01 am

James-F wrote:Thanks Sarah.

Only 100, 200, 400?
This is quite limited, the point was to set the buffer value as low as possible without crackling, so the end-user can actually find the lowest value for his system.
Values of 80 (20ms), 60 (15ms), and 40 (10ms) should be included at least for testing.
Better yet, a box where the user can type any latency between 1 and 400, this was the original idea.

@Battler,
Not only the lag issue is gone, but the stereo, aliasing, and crackling/popping issues are gone with libopenal-1.dll.

Sarah, OpenAL32.dll bugs are real and tested, no need to deny or ignore them.
If you can, use the latest library as suggested by Battler.


I see.

I'm continuing using Battler's build, since I don't need to compile from source. (And latest commits there are also available in various binaries.) Hence didn't notice the limited selectable choices yet from the main PCem latest source.
User avatar
James-F
Posts: 69
Joined: Tue 30 May, 2017 10:26 am

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby James-F » Sun 11 Jun, 2017 6:33 am

Unfortunately the single SOUNDBUFLEN line was replaced with almost 100 new code lines, so tweaking the buffers in the code is no longer easy :(
I think it was a very poor choice to make only 3 configurable values with a lot of dependencies all over the code...
SarahWalker
Site Admin
Posts: 1325
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby SarahWalker » Sun 11 Jun, 2017 6:55 am

You can tweak it in pcem.cfg instead...

I found that anything below 100ms caused OpenAL to break horribly.
SarahWalker
Site Admin
Posts: 1325
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby SarahWalker » Sun 11 Jun, 2017 6:56 am

James-F wrote:Sarah, OpenAL32.dll bugs are real and tested, no need to deny or ignore them.
If you can, use the latest library as suggested by Battler.

I'm not denying or ignoring them, I just haven't got the faintest idea where Battler got his library from! I tried a new MingW installation (with GCC 5.3.0) and unsurprisingly there's no OpenAL library.

I also don't know why he's continuing to conflate GCC version with a totally unrelated library, despite this having been pointed out to him several times.
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby Battler » Sun 11 Jun, 2017 2:12 pm

- SarahWalker: MingW/MSYS2 installation with GCC 6.3.0. Here's my development environment: http://tinyurl.com/pcemude .

SarahWalker wrote:I also don't know why he's continuing to conflate GCC version with a totally unrelated library, despite this having been pointed out to him several times.

I am not conflating anything, I am going from experience here. When I updated my MingW/MSYS2 to GCC 6.3.0, it also updated from OpenAL32.dll to libopenal-1.dll. Now, I wouldn't be surprised if this had nothing to do with GCC itself and all to do with the headers and libraries that also happened to be updated at the same time, but this just goes to prove that keeping your development environment regularly updated is another thing that should be done.
User avatar
James-F
Posts: 69
Joined: Tue 30 May, 2017 10:26 am

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby James-F » Sun 11 Jun, 2017 2:49 pm

Thanks Sarah, I can go as low as 40 without stuttering, this is a big improvement.
SarahWalker
Site Admin
Posts: 1325
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby SarahWalker » Sun 11 Jun, 2017 3:06 pm

Now, I wouldn't be surprised if this had nothing to do with GCC itself and all to do with the headers and libraries that also happened to be updated at the same time,

I don't know, OpenAL could be an integral part of the compiler. It's obviously impossible to compile any C code without a specific audio library after all...

but this just goes to prove that keeping your development environment regularly updated is another thing that should be done.

To be honest, I'd rather keep a stable build environment rather than chasing every single update possible.

Which reminds me, why are you still using 6.3.0. That's ancient, you should be using 7.1! It's 0.8 better so it must be worth you upgrading immediately and then blaming me for any stability issues.
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby Battler » Sun 11 Jun, 2017 3:50 pm

- SarahWalker: Because 6.3.0 is the latest MingW-GCC. 7.1 does not yet exist for MingW.

Also, the stability issues have to do with Direct3D 9, not the compiler. I have the exact same crashes and freezes when using DOSBox's Direct3D 9 renderer and I am certainly not compiling DOSBox on my own. The problem might have actually be with Windows 10 since I never had that problem with DOSBox on Windows 7, but that happens, Microsoft does changes which break things. I did recommend writing a Direct3D 10 or 11 renderer.
SarahWalker
Site Admin
Posts: 1325
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby SarahWalker » Sun 11 Jun, 2017 5:03 pm

I feel you need to read up on the concept of sarcasm...
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby Battler » Sun 11 Jun, 2017 5:16 pm

- SarahWalker: I got your sarcasm, I just pointed out why it was wrong. :p
User avatar
leilei
Posts: 431
Joined: Fri 25 Apr, 2014 4:47 pm

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby leilei » Sun 11 Jun, 2017 9:33 pm

The mysterious obfuscated "86box fixed audio lag its better" DLL is OpenAL Soft 1.16.0 (Aug 2014) which originated from here.
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby Battler » Sun 11 Jun, 2017 9:46 pm

Well then, what exactly prevents mainline PCem from being distributed with this DLL? :p

Also, about the Direct3D freezes, it turns out the compiler is not the issue. On the mainline PCem executable compiled by SA1988 with the same development environment and GCC version, the freezes are not there. Making sure win-d3d-*.cc are identical to Sarah's has not fixed the issue, either. At this point, I suspect the fact I initialize Direct3D with a child window hWnd instead of the main window hWnd is the reason, and I do that because I added a status bar so if I use the main window as the Direct3D (or DirectDraw) host, the status bar disappears. So I need to figure out what it happens. It apparently only happens when you move the window at the same time the emulator is resizing it.
Malik
Posts: 17
Joined: Sat 20 May, 2017 2:43 am

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby Malik » Mon 12 Jun, 2017 2:32 am

My point is rather simple. Battler's build just works, out of the box. And for every development commit, there are still pre-compiled binaries ready for testing.

As of now, PCem still needs to be compiled by end-user with alterations either in the source or cfg to work properly in all my systems - core i7 4790K desktop, core i7 6700HQ laptop and core M 5Y10 Dell Tablet. All running Windows 10 pro. Also have Win7 in my desktop and laptop.

This is a GPL software right? I just don't understand the hatred against Battler or his build.

Any improvements are always welcome.

(Another user also had difficulty in cooperating with the developer here, it seems - [Moderator : How many times do I have to repeat myself? DO NOT LINK TO COPYRIGHTED MATERIAL]... but this going away from this topic in hand. But I can also see this had already deviated a lot in the first place. I think if so much restrictions needed on how this should be distributed including the distributions of development builds , make it closed source,no? No need to answer to questions for other builds. Just place a sticky that no questions will be answered by PCem mainline developers for those builds.)

This thread can be closed. I see it just has become a fanning of dying flames.

Thanks again for all the help.

Sorry for opening up the can of worms.
User avatar
leilei
Posts: 431
Joined: Fri 25 Apr, 2014 4:47 pm

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby leilei » Mon 12 Jun, 2017 2:37 am

You could have simply replaced the OpenAL32.dll in PCem v12 with the OpenAL-Soft DLL. No compiling environment necessary.

Also that guy's a rom/software repacking hack on a quest for fame from exploiting others' hard work, not to mention the site you linked has a complete disregard for intellectual property law where you wouldn't find any respect for authorship and rights in the first place...
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby Battler » Mon 12 Jun, 2017 1:35 pm

- leilei: What? SoftPCMuseum_ is working on a fork of PCE... he indeed had difficulty cooperating with Sarah and has since switched to forking Hampa's PCE instead, and somehow has no problems now.

Also, while I have my fair share of problems with WinWorld, you seem to think of preservation of software for the posterity as being in some way disrespectful for authorship and rights... I respect authorship and right, I own several games on legit CD's (a few of them even twice), but I think that at some point, when the software becomes abandoned, and the authors are making no money on it anymore anyway and there's no longer any way to obtain it legitimately, it's time to preserve it for the posterity.
Also consider that physical media are not eternal. Floppies have limited span, as do CD's and DVD's. One day, those will rot away and the now oh-so-reviled "pirate" floppy images and CUE/BIN's or MDF/MDS's are going to be the only copies left of the software.
Now yes, I do realize we have different views on this but it would be appreciated if you finally started respecting views differ from yours instead of insulting anyone who doesn't share your views.
SarahWalker
Site Admin
Posts: 1325
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby SarahWalker » Mon 12 Jun, 2017 5:13 pm

Battler wrote:- leilei: What? SoftPCMuseum_ is working on a fork of PCE... he indeed had difficulty cooperating with Sarah

He never even tried! From what I recall, he made a 'fork' of PCem (which I believe only changed a few GUI elements - mainly the name), refused to make any source available (in violation of the GPL), and got arsey when it was pointed out that distributing copyrighted ROMs was probably not a good idea.

To be honest, I'm not even sure I've had any conversations with him. So I'm not sure where this 'difficulty cooperating' claim comes from.

Now yes, I do realize we have different views on this but it would be appreciated if you finally started respecting views differ from yours instead of insulting anyone who doesn't share your views.

In addition to sarcasm, I suggest you look up irony and hypocrisy!
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby Battler » Mon 12 Jun, 2017 6:43 pm

OK, tell me where have I insulted anyone for not sharing my views? And please let it not be stuff from 2014 or 2015...

Edit: And while I do admit I was a bit hard on you a few times, I have however never insulted entire communities simply for daring to have policies not agreeing with my views or morals. There's a difference between pointing out to an individual why I think they're wrong, and insulting entire groups of people for not doing things my way.

SarahWalker wrote:refused to make any source available (in violation of the GPL),

I think he was just making binary hacks at that point, and had not yet delved into modifying the source code. I think after he did get into modifying the source code, he complained that the CPU code was unreadable and switched to Hampa's PCE.

and got arsey when it was pointed out that distributing copyrighted ROMs was probably not a good idea.

I think he removed it, or tried but messed up, and leilei assumed bad faith and started flinging accusations. Then he properly removed the copyrighted materials.

To be honest, I'm not even sure I've had any conversations with him. So I'm not sure where this 'difficulty cooperating' claim comes from.

He was attacked by leilei and that was the other reason why he switched to Hampa's PCE. Having been attacked by leilei myself numerous times, I can understand how SoftPCMuseum_ felt.
SarahWalker
Site Admin
Posts: 1325
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby SarahWalker » Mon 12 Jun, 2017 7:08 pm

Battler wrote:OK, tell me where have I insulted anyone for not sharing my views? And please let it not be stuff from 2014 or 2015...

You threw a massive strop at me on IRC for not allowing copyrighted material on this forum. Pretty sure that counts, and wasn't from 2014/2015.

I also recall you throwing a massive strop about me not liking anime as well... You're not very good with people who have different opinions.

SarahWalker wrote:refused to make any source available (in violation of the GPL),

I think he was just making binary hacks at that point, and had not yet delved into modifying the source code. I think after he did get into modifying the source code, he complained that the CPU code was unreadable and switched to Hampa's PCE.

Pretty sure that's still a GPL violation. Also still not sure how this counts as me 'not cooperating', unless it's simply by writing code that he doesn't understand.

and got arsey when it was pointed out that distributing copyrighted ROMs was probably not a good idea.

I think he removed it, or tried but messed up, and leilei assumed bad faith and started flinging accusations. Then he properly removed the copyrighted materials.

I've just gone through his postings on Vogons, and it's not exactly difficult to assume bad faith from his postings! He acts like an arrogant tit despite having very little knowledge or talent.
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby Battler » Mon 12 Jun, 2017 7:17 pm

You threw a massive strop at me on IRC for not allowing copyrighted material on this forum. Pretty sure that counts, and wasn't from 2014/2015.

I don't remember that but it might have happened. Now what I do remember is an argument over the Diamond Stealth32 BIOS, and I offered to e-mail Diamond asking what their policy on old ROM distribution is, from an e-mail of mine that is in no way associated with any emulator so they'd have no way of finding out, and you didn't like that. There might have been more that I honestly forgot, so much drama happens on my IRC network all the time that I tend to lose track of what happened and when.

I also recall you throwing a massive strop about me not liking anime as well... You're not very good with people who have different opinions.

I do recall having an argument about anime with you, but from what I remember, I was just a bit annoyed at how you kept pronoun-correcting me so I pointed out I felt you were hypocritical by caring so much about that while apparently it was OK for you to denigrate anime by calling them "cartoons". I have no problem with people who do not like anime, but I do have problems with people I perceive as being prejudiced against anime, though I do admit that concluding prejudice from you merely calling them "cartoons" was jumping to conclusions.

Pretty sure that's still a GPL violation. Also still not sure how this counts as me 'not cooperating', unless it's simply by writing code that he doesn't understand.

From what I remember, back then, he forked not mainline PCem directly but my PCem-X fork and did some binary hacks to it. This means that the corresponding source code was the vanilla PCem-X source code which was publicly available. So I don't see where the GPL violation was. However I might be wrong, that was in 2015 so I might not be remembering right.
Also, true, you're right that there was no lack of cooperation from you.

I've just gone through his postings on Vogons, and it's not exactly difficult to assume bad faith from his postings! He acts like an arrogant tit despite having very little knowledge or talent.

How does he have very little knowledge or talent when he's single-handedly adding accurate 286 and 386 emulation onto Hampa's PCE? Now yes he often comes across as arrogant, that much I agree with.
SarahWalker
Site Admin
Posts: 1325
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Partially-Solved] PCem v12 and Sound Lag

Postby SarahWalker » Mon 12 Jun, 2017 7:32 pm

Battler wrote:
You threw a massive strop at me on IRC for not allowing copyrighted material on this forum. Pretty sure that counts, and wasn't from 2014/2015.

I don't remember that but it might have happened. Now what I do remember is an argument over the Diamond Stealth32 BIOS, and I offered to e-mail Diamond asking what their policy on old ROM distribution is, from an e-mail of mine that is in no way associated with any emulator so they'd have no way of finding out, and you didn't like that. There might have been more that I honestly forgot, so much drama happens on my IRC network all the time that I tend to lose track of what happened and when.

Very convenient...

I also recall you throwing a massive strop about me not liking anime as well... You're not very good with people who have different opinions.

I do recall having an argument about anime with you, but from what I remember, I was just a bit annoyed at how you kept pronoun-correcting me so I pointed out I felt you were hypocritical by caring so much about that while apparently it was OK for you to denigrate anime by calling them "cartoons". I have no problem with people who do not like anime, but I do have problems with people I perceive as being prejudiced against anime, though I do admit that concluding prejudice from you merely calling them "cartoons" was jumping to conclusions.

What on earth are you even talking about here?

Are you seriously comparing misgendering a trans person (basically transphobia) with someone not liking a particular form of TV? How have you managed to come to the conclusion that the two are even remotely comparable?

Pretty sure that's still a GPL violation. Also still not sure how this counts as me 'not cooperating', unless it's simply by writing code that he doesn't understand.

From what I remember, back then, he forked not mainline PCem directly but my PCem-X fork and did some binary hacks to it. This means that the corresponding source code was the vanilla PCem-X source code which was publicly available. So I don't see where the GPL violation was.

I'm not a lawyer, and this case isn't explicitly stated in the licence, but my understanding is that you have to provide source for any modifications you make. That would rule out distributing binary hacks of GPL programs.

Find a lawyer if you want a definite answer, but that's my interpretation.

I also find it a bit unethical to take someone else's code, make a few binary hacks, and claim it as 'your project'.

Also, true, you're right that there was no lack of cooperation from you.

Then don't state that there was! If you want me to believe that you're acting in good faith, a good start would be to stop spreading lies around like this.

I've just gone through his postings on Vogons, and it's not exactly difficult to assume bad faith from his postings! He acts like an arrogant tit despite having very little knowledge or talent.

How does he have very little knowledge or talent when he's single-handedly adding accurate 286 and 386 emulation onto Hampa's PCE? Now yes he often comes across as arrogant, that much I agree with.

I'm basing this off his Vogons postings, where he's mostly complaining about not being able to compile stuff and gives off the impression of having little if any C knowledge. If he's actually doing something useful now, then fine.

Return to “General”

Who is online

Users browsing this forum: Google [Bot] and 2 guests