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

OpenJK SP interacting with UI/menu breaks sound #1214

Closed
Jon-guy30 opened this issue Feb 24, 2024 · 6 comments · Fixed by #1225
Closed

OpenJK SP interacting with UI/menu breaks sound #1214

Jon-guy30 opened this issue Feb 24, 2024 · 6 comments · Fixed by #1225

Comments

@Jon-guy30
Copy link

Reporting a bug? Please make sure you've given the following information - thanks!

Operating system and version:

Windows 11 23H2 build 22631.3155 x64

Is this for single player or multiplayer?

Singleplayer

Description of the bug (and if possible, steps to reproduce the bug):

Interacting with game menus breaks sound in SP. Clicking or just hovering over the menu button cuts the sound and ingame dialogue. Easiest way to reproduce is to hit tab while on a mission. Also, mission briefings hovering over the next button while Kyle or Luke goes over the mission the sound breaks. Also the weapon selection and force upgrade screens. Or saving the game, hovering and clicking the menu buttons the sound cuts off. Also character creation screen. It's only briefly but it can be very jarring. It doesn't happen in MP.

EAX is turned off as it's disabled by default, it's not even an option in the x64 build.

What did you expect to happen instead?
Sound is continuous without cutting itself or breaking. If you only play multiplayer it's not affected and you won't notice the bug. Older versions in the old openJK build site work fine.

@Jon-guy30
Copy link
Author

Jon-guy30 commented Feb 26, 2024

Today I downloaded and installed OBS, I recorded a short video clip demonstrating this issue.

If you're interested in seeing it. just tell me, I'll upload to youtube. I also recorded the multiplayer bot issue.

@ensiform
Copy link
Member

Wonder if this is caused by newer SDL and certain OS and hardware configurations depending on the backend used.

This commit and possibly others could be related

etlegacy/etlegacy@beb4f92

@Jon-guy30
Copy link
Author

LOL "Setting lower sample count improves audio latency, at the cost of potentially introducing audio issues, such as cracking."

My PC is 6 cores 6 threads, 32GB RAM with integrated Intel graphics. Theoretically I shouldn't experience this.

Could my PC be TOO FAST???

@Jon-guy30
Copy link
Author

Here's the video I made.

https://www.youtube.com/watch?v=n_apTiRtZ54

@ensiform
Copy link
Member

ensiform commented Mar 1, 2024

I found part of the cause of this issue but not sure the exact reason why its doing this.

When you turn developer on you can see that it is spamming trying to load font:
Can't find fonts/arialnb_sharp1.fontdat

cc @Daggolin

Related to PR #1184 / 97c7291

Also seems to only affect SP, not MP.

Upon further analysis, it seems related to Item_Paint -> (a text item with keyword descText) triggers 2 calls to MenuFontToReal(4) which polls UI_RegisterFont 2x per frame of rendering each object in the menu that has the descText when hovering over them.

Seems the intention is to use 4 == smallFont2 which is arialnb however smallFont2 is not referenced in SP menu registration code like it is in MP.

Actually, if you look at vanilla jasp main.menu there is:

		smallFont				"aurabesh" 	18	
		mediumFont				"ergoec" 	18
		bigFont					"anewhope" 	20
		smallFont				"arialnb" 	14	

So I'm not sure which one is really referenced in the menu parser.

@taysta
Copy link
Contributor

taysta commented Mar 2, 2024

I found part of the cause of this issue but not sure the exact reason why its doing this.

When you turn developer on you can see that it is spamming trying to load font: Can't find fonts/arialnb_sharp1.fontdat

cc @Daggolin

Related to PR #1184 / 97c7291

Also seems to only affect SP, not MP.

Upon further analysis, it seems related to Item_Paint -> (a text item with keyword descText) triggers 2 calls to MenuFontToReal(4) which polls UI_RegisterFont 2x per frame of rendering each object in the menu that has the descText when hovering over them.

Seems the intention is to use 4 == smallFont2 which is arialnb however smallFont2 is not referenced in SP menu registration code like it is in MP.

Actually, if you look at vanilla jasp main.menu there is:

		smallFont				"aurabesh" 	18	
		mediumFont				"ergoec" 	18
		bigFont					"anewhope" 	20
		smallFont				"arialnb" 	14	

So I'm not sure which one is really referenced in the menu parser.

#1221
Have just opened this PR that seems related.

Daggolin added a commit to Daggolin/OpenJK that referenced this issue Mar 24, 2024
ensiform pushed a commit that referenced this issue Mar 25, 2024
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

Successfully merging a pull request may close this issue.

3 participants