Audio Lag with PCem 11 (was able to repro in latest source)

Support and general discussion.
szadycbr
Posts: 295
Joined: Mon 21 Nov, 2016 6:23 pm

Re: Audio Lag with PCem 11 (was able to repro in latest source)

Post by szadycbr »

Battler, i checked 1400 and still fluttering, the thing is that on 1200 it is alike :cst cst cst cst cst ..... and on 1400 : ccsstt ccsstt ccsstt ccsstt..... i hope you know what i m trying to say , i cant hear anything on 1600 , maybe it is CCCCCSSSSSSSSSSSSSSSTTTTTTTT once during the play, so i dont know, or maybe its not there. Just check by yourself do #define SOUNDBUFLEN (1600) line without /40 just plain 1600 and you will see, the whole job takes 2 min. 1 min for preparing the src (i always delete old and copy new folder cos i dont know what is that file from previous job) and 1 min to compile. You know it better than me, just check.
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: Audio Lag with PCem 11 (was able to repro in latest source)

Post by Battler »

- szadycbr: I'm on a Pentium Dual-Core, so it takes like 4 minutes for me to compile the thing. Also, I don't have your host hardware, so it might not flutter at all on my end, with any setting... I also think it might be the fact mainline PCem uses the long deprecated ALUT that causes the fluttering.

Edit: I have attached soundopenal.c and makefile.mingw without ALUT. Try to compile using these and the default sound buffer, and see if the fluttering is gone.
Attachments
soundopenal_and_makefile_without_alut.zip
(2.86 KiB) Downloaded 453 times
szadycbr
Posts: 295
Joined: Mon 21 Nov, 2016 6:23 pm

Re: Audio Lag with PCem 11 (was able to repro in latest source)

Post by szadycbr »

(i removed this useless post, Battler improvements works, You must only delete OpenAL32.dll, and fluttering is gone (thanks to MR.NACHO))
Last edited by szadycbr on Sun 05 Feb, 2017 8:11 am, edited 4 times in total.
szadycbr
Posts: 295
Joined: Mon 21 Nov, 2016 6:23 pm

Re: Audio Lag with PCem 11 (was able to repro in latest source)

Post by szadycbr »

i have to add, that as far as i remember sb16 had sampling rate at 44khz, so PCem dont have to sample 48khz , unless there are other cards that do this, but not sb16.
User avatar
leilei
Posts: 1039
Joined: Fri 25 Apr, 2014 4:47 pm

Re: Audio Lag with PCem 11 (was able to repro in latest source)

Post by leilei »

OPL2/3 is 49716Hz and OpenAL's (hardcoded, iirc) sampling rate is 48khz (which lines up with the native hardware that it was originally designed for, i.e. SB Live, as well as many many many other onboard/pci sound cards that natively mixed to 48khz by default to follow AC'97 standards).


Don't forget the Windows Sound System, which also needed 48KHz.
Mr.Nacho
Posts: 10
Joined: Sun 29 Jan, 2017 3:12 pm

Re: Audio Lag with PCem 11 (was able to repro in latest source)

Post by Mr.Nacho »

Battler I think you might be on to something! I have no fluttering or stuttering audio with your changes. Tested in both Doom and Windows 98 (P75 - P133). Here's the catch, that's as long as I remove the "OpenAL32.dll" file from the pcem folder.

With your changes, if I keep the "OpenAL32.dll" file in the root folder with the executable, I get really bad audio stuttering (on top of the fluttering). I also noticed that leaving that file in the root folder will make my speakers pop and crackle when I launch pcem (as the main pcem window shows-up). I'm assuming the popping / crackling is when the audio gets initialized. Removing the file prevents all of those issues from happening. Any ideas why?

All in all, sounds much better!
szadycbr
Posts: 295
Joined: Mon 21 Nov, 2016 6:23 pm

Re: Audio Lag with PCem 11 (was able to repro in latest source)

Post by szadycbr »

Leilei, you are right but only the new PCi versions used 48khz, I dont even thought for a second that PCem emulate Fifth gen. PCi ver. I had many sb's in the past and all isa versions had sampling rate up to 44khz, i had sb 1.0 it was horrible and sampling on it was even less, sb pro wasnt much better. http://support.creative.com/kb/ShowArti ... x?sid=5800 , you can find there also PCi versions, but i remembered well, ISA didnt had 48khz. You did go a bit forward.
szadycbr
Posts: 295
Joined: Mon 21 Nov, 2016 6:23 pm

Re: Audio Lag with PCem 11 (was able to repro in latest source)

Post by szadycbr »

Bahh, MR. Battler!!! Nacho is right!!! i removed openAL32.dll, and with your improvements there is no fluttering, sounds much better.
Why didnt you tell us to remove that file? and crack poping sound on start disappear as well.
You are the Man!!! congrats!!! everybody, after you do, the Battler changes , remove this file and it will be all ok.
Thank You MR. NACHO
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: Audio Lag with PCem 11 (was able to repro in latest source)

Post by Battler »

szadycbr wrote:Why didnt you tell us to remove that file? and crack poping sound on start disappear as well.
Because I had no idea that your specific version of the file was the cause of this problem. I use a newer version of this file, renamed to libopenal.dll, and never had this problem. You were probably using an outdated version.
szadycbr
Posts: 295
Joined: Mon 21 Nov, 2016 6:23 pm

Re: Audio Lag with PCem 11 (was able to repro in latest source)

Post by szadycbr »

Sarah, could You include the Battler changes in repository? please do test it , it works well. You did nice job making the lag disappear and Battler also did nice job make fluttering disappear. If it works well , then everybody should be happy, all these little things by You guys make the PCem the best emu ever written.
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: Audio Lag with PCem 11 (was able to repro in latest source)

Post by SarahWalker »

ALUT dependency removed in rev 633.
szadycbr
Posts: 295
Joined: Mon 21 Nov, 2016 6:23 pm

Re: Audio Lag with PCem 11 (was able to repro in latest source)

Post by szadycbr »

Thank You Sarah, i just did 633, no lag and no fluttering, win/win ;)

add: its kind of pitty , that most users dont know, how much is being done, through the years to get to that stage. :(
Before , even myself, didnt realise how great PCem is, and how hard You guys worked on it.
Mr.Nacho
Posts: 10
Joined: Sun 29 Jan, 2017 3:12 pm

Re: Audio Lag with PCem 11 (was able to repro in latest source)

Post by Mr.Nacho »

Thanks SarahWalker and Battler. I'll keep testing to see if I notice any other regressions with these changes.
Katakis
Posts: 118
Joined: Thu 05 Mar, 2015 6:42 am

Re: Audio Lag with PCem 11 (was able to repro in latest source)

Post by Katakis »

I completed Woodruff and the Schnibble of Azimuth using WinBIOS 486 + 8MB with PCem v11 and I had no trouble at all with sync most of the time, although there were some times I did something else while I was playing that cause the audio to become out of sync. All I had to do to fix it was shut down the emulated machine and everything was back to normal. CPU remain at 100%.
szadycbr
Posts: 295
Joined: Mon 21 Nov, 2016 6:23 pm

Re: Audio Lag with PCem 11 (was able to repro in latest source)

Post by szadycbr »

sadly in v12 same fluttering and cracking sound at boot appear, looks as if Alut is used again? i removed OpenAL32.dll from PCem directory and and MY build v12 from src included in v12 distribution downloaded from PCem-emulator.co.uk is working fine, all problems disappear, but original distributed v12 does do not boot due to lack OpenAL32.dll , why? why my build v12 from the same src does not need OpenAL32.dll? why OpenAL32.dll is still distributed and why new (distributed) v12 needs it?

one more thing, i dont now why but original v12 size is 3 012 KB my build is 3 650 KB, are there some other files included? or it is just the way my build enviroment works?
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: Audio Lag with PCem 11 (was able to repro in latest source)

Post by Battler »

- szadycbr: Because Sarah uses a way outdated development environment and version of GCC.

The file size difference is because she compiles with -DRELEASE_BUILD added to CFLAGS in the makefile, which disables the logging. That, and older compiler version makes a slightly smaller executable as well.
szadycbr
Posts: 295
Joined: Mon 21 Nov, 2016 6:23 pm

Re: Audio Lag with PCem 11 (was able to repro in latest source)

Post by szadycbr »

Thanks Battler, i m sure that i m not only one experiencing sluttering again. Why use it? if in v11 633 was removed and it was good? maybe there is a bigger picture? and it is better to use openAL? why? why? why?....
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: Audio Lag with PCem 11 (was able to repro in latest source)

Post by Battler »

- szadycbr: Your compile also uses OpenAL, it just uses libopenal.dll instead of OpenAL32.dll, and you probably have a newer version of that installed, which works better than the OpenAL32.dll included with PCem. Again, Sarah would have to update to a newer version of GCC to solve the problem.
szadycbr
Posts: 295
Joined: Mon 21 Nov, 2016 6:23 pm

Re: Audio Lag with PCem 11 (was able to repro in latest source)

Post by szadycbr »

if so,mr. batler then why on my whole drive c: there is no such file as libopenal.dll i dont have it on my drive, so how can it be?
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: Audio Lag with PCem 11 (was able to repro in latest source)

Post by Battler »

I was wrong, it's actually libopenal-1.dll. Try searching for that.
szadycbr
Posts: 295
Joined: Mon 21 Nov, 2016 6:23 pm

Re: Audio Lag with PCem 11 (was able to repro in latest source)

Post by szadycbr »

well i had libopenal-1.dll in old pcem distribution directory, but i deldeted. i did search the drive and i finally find that openAL32.dll was in windows/sysWOW64 directory and apparentely my builds use that file, cos after deleting that last file they stopped working as well, this openAL32.dll is 106KB in size ver.6.14.357.24 standard implementation , and that file is the last alut library left on my drive c. The distributed v12 uses 124KB size file ver.0.99.0.28 from creative labs and does not work with the other and it makes fluttering sound.
So yes they are using openal as well. thanks.
Grassini
Posts: 3
Joined: Wed 15 Apr, 2020 1:58 pm

Re: Audio Lag with PCem 11 (was able to repro in latest source)

Post by Grassini »

I also have sound stuttering, very sporadically, but there are applications where stuttering are terrible, e.g. when playing pop.mid demo using AWE32 emulation, or music in pinball fantasy.

Code: Select all

https://youtu.be/5sbh6TVoXy0
Post Reply