JACoders / OpenJK

Community effort to maintain and improve Jedi Academy (SP & MP) + Jedi Outcast (SP only) released by Raven Software
GNU General Public License v2.0
2.03k stars 615 forks source link

OpenJK SP interacting with UI/menu breaks sound #1214

Closed Jon-guy30 closed 7 months ago

Jon-guy30 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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

https://github.com/etlegacy/etlegacy/commit/beb4f921a30b782a06efbb9b7b2dac8baa9a726f

Jon-guy30 commented 8 months ago

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 commented 8 months ago

Here's the video I made.

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

ensiform commented 8 months ago

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 / https://github.com/JACoders/OpenJK/commit/97c7291fb5267abdac412385469146fd3fe1542e

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 commented 8 months ago

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.

https://github.com/JACoders/OpenJK/pull/1221 Have just opened this PR that seems related.