Music Freeze Hook

A Forum dedicated to the Suggestion, Creation and Editing of XWA Dynamic Link Library Files

Moderator: JeremyaFr

Post Reply

Music Freeze Hook

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Fri Jun 12, 2020 4:54 pm

Hello,

I've created a hook (xwa_hook_music) that fixes the music freeze.

It replaces the DirectSound API with the XAudio2 API to play the music.
With this hook, it is no longer needed to set the process affinity mask to a single core.

Feel free to say if you have the music freeze again (even with this hook) or if you no longer encounter the music freeze.

You can download the hook with the XwaHooksSetup tool.

User avatar
Rookie_One1
Rebel Alliance
Posts: 1656
Joined: Thu Feb 26, 2004 12:01 am

Post by Rookie_One1 » Sun Jun 14, 2020 1:16 pm

Thanks Jeremy, you are a programming god!
Rookie One, is that you?? - Ru Merleen, Rebel Spy at Imdaar Alpha
Current Holder of the Frying Pan of Death

Chri360936
Cadet 3rd Class
Posts: 39
Joined: Thu Jun 20, 2019 3:28 am

Post by Chri360936 » Sun Jun 14, 2020 7:23 pm

When I run the hooks setup app, I am not getting the new music hook? Any reason for this that you can think of?

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Jun 14, 2020 7:38 pm

Hello,
You have to delete the "Hooks" directory, as written in the XwaHooksSetup's readme file.

Or extract XwaHooksSetup.zip to a new directory and run XwaHooksSetup.exe

Chri360936
Cadet 3rd Class
Posts: 39
Joined: Thu Jun 20, 2019 3:28 am

Post by Chri360936 » Sun Jun 14, 2020 7:40 pm

Got it. Thanks.

User avatar
DarHan
Rebel Alliance
Posts: 325
Joined: Mon Dec 05, 2005 12:01 am
Contact:

Post by DarHan » Mon Jun 15, 2020 3:16 pm

Huh. I just experienced the music freeze bug despite having installed the hook. It happened after a few minutes of playing (Battle 4, mission 6—more precisely, shortly after the ISD Avenger first started deploying fighters).
“Red Four, nothing’s gone wrong yet.”
— Hobbie Klivian

User avatar
BenKenobi
Cadet 2nd Class
Posts: 94
Joined: Wed Mar 18, 2020 12:30 pm

Post by BenKenobi » Tue Jun 16, 2020 9:38 am

Hi.
It happened to me too unfortunately. Just after entering hyperspace on Battle 1 Mission 4.
Need more info? Just let me know.

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7826
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Wed Jun 17, 2020 2:44 pm

DarHan wrote:
Mon Jun 15, 2020 3:16 pm
Huh. I just experienced the music freeze bug despite having installed the hook. It happened after a few minutes of playing (Battle 4, mission 6—more precisely, shortly after the ISD Avenger first started deploying fighters).
BenKenobi wrote:
Tue Jun 16, 2020 9:38 am
Hi. It happened to me too unfortunately. Just after entering hyperspace on Battle 1 Mission 4.
Need more info? Just let me know.
Just to confirm please: You both have Hook_Music.dll and Xaudio2_9redist.dll in your main XWA folder?

Also in DDraw.cfg that this file has a setting of 0 in this section

Code: Select all

; ProcessAffinityCore = int value
; When set to 0, the process affinity is not changed
; The value indicates the core you want the process to run on
ProcessAffinityCore = 0
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

User avatar
DarHan
Rebel Alliance
Posts: 325
Joined: Mon Dec 05, 2005 12:01 am
Contact:

Post by DarHan » Wed Jun 17, 2020 4:01 pm

Yup, both files are present (XWA won’t even start if Xaudio2_9redist.dll is missing), and I double-checked the ProcessAffinityCore setting.
“Red Four, nothing’s gone wrong yet.”
— Hobbie Klivian

User avatar
BenKenobi
Cadet 2nd Class
Posts: 94
Joined: Wed Mar 18, 2020 12:30 pm

Post by BenKenobi » Wed Jun 17, 2020 6:08 pm

Ace Antilles wrote:
Wed Jun 17, 2020 2:44 pm
Just to confirm please: You both have Hook_Music.dll and Xaudio2_9redist.dll in your main XWA folder?
No, it seems the Xaudio2_9redist.dll was missing, I had no problem launching XWA without it however. Double checked; the ProcessAffinityCore is set to 0

I will check it again and report back.

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7826
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Wed Jun 17, 2020 6:13 pm

BenKenobi wrote:
Wed Jun 17, 2020 6:08 pm
Ace Antilles wrote:
Wed Jun 17, 2020 2:44 pm
Just to confirm please: You both have Hook_Music.dll and Xaudio2_9redist.dll in your main XWA folder?
No, it seems the Xaudio2_9redist.dll was missing, I had no problem launching XWA without it however. Double checked; the ProcessAffinityCore is set to 0

I will check it again and report back.
It should be in your Setup folder that the Hook downloader extracted. If it's not then you don't have the latest updates.
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

User avatar
BenKenobi
Cadet 2nd Class
Posts: 94
Joined: Wed Mar 18, 2020 12:30 pm

Post by BenKenobi » Thu Jul 02, 2020 4:43 pm

Update: Haven’t had a music crash in over 2 weeks so it is fixed for me.

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Thu Jul 02, 2020 4:48 pm

BenKenobi wrote:
Thu Jul 02, 2020 4:43 pm
Update: Haven’t had a music crash in over 2 weeks so it is fixed for me.
Thanks for the feedback.

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Mon Mar 22, 2021 7:04 pm

UPDATE

Hello,
I've updated the music hook.

I've fixed a conflict with the effects ddraw dll.

GABICV
Cadet 3rd Class
Posts: 30
Joined: Wed Mar 17, 2021 1:47 pm

Post by GABICV » Thu Apr 22, 2021 4:35 pm

Hello,

I don't know if I'm the only one but I'm still experiencing music freezes from time to time. It seems to be random. It can happen during tour missions or skirmishes. It also happened once while I was in the flight simulator menu, setting up a skirmish.
Sometimes it freezes after 10 minutes of play, sometimes I can play 1h without issue.

I'm playing on a Steam version with Mega Patch and Update 2.1. I also made sure I have the latest Music Hook.

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Mon May 23, 2022 7:15 pm

UPDATE

Hello,
I've updated the music hook.

I've fixed a bug where the xwa exe is still alive when the game ends and a custom movie was played.

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Mon Dec 04, 2023 2:34 pm

UPDATE

Hello,
I've updated the music hook.

You can now control the volume of the briefing sounds with the Concourse SFX Volume setting.

Post Reply