Author Topic: Question to HANDLE_AUDIO and error reports upon deinstall  (Read 2407 times)

Offline jastey

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1524
  • Gender: Female
Question to HANDLE_AUDIO and error reports upon deinstall
« on: February 07, 2019, 06:00:37 AM »
Kulyok's Xan mod offers an optinal component after the main one with an alternative soundset. If installed, HANDLE_AUDIO is used to convert .ogg files on the original engine and replace the first version of wavs in the override, installed in the main component also from .ogg files with HANDLE_AUDIO. The replaced files share the same name, obviously.

The oggdec and sox are in the same folder as the first soundset called "audio", thus in the main component, HANDLE_AUDIO is simply called via LAF HANDLE_AUDIO END.

The optional component uses the same oggdec in xan/audio, but the sound files are in xan/audio2, so it uses
Code: [Select]
LAF HANDLE_AUDIO
  STR_VAR
    audio_path = ~Xan/audio2~
    oggdec_path = ~Xan/audio~
    sox_path = ~Xan/audio~
END


What happens upon install: when installing the optional component, the created wav-files are placed into the xan/audio2 folder. (This does not happen for the main component, i.e. when the soundfiles are installed the first time.)
This is what the debug says if installing the audio files from the optional component:
Code: [Select]
Copied [.../fl#inlined/null.file] to [Xan/audio2/O#XAN001.wav]
MOVE [Xan/audio2/O#XAN001.wav] [override/O#XAN001.wav]: destination exists, falling back to COPY_LARGE

Upon deinstallation the first time, the wavs in xan/audio2 are not deleted and there is the following error message:

Code: [Select]
(...)
Install Component [Xan NPC MOD for Baldur's Gate II]?
[R]e-Install, [N]o Change or [U]ninstall or [Q]uit?
Removing [Xan NPC MOD for Baldur's Gate II] (component #0)
uninstall: XAN/XAN.TP2 0
We must temporarily uninstall [XAN/XAN.TP2] component 6
[Xan/Backup/6/UNSETSTR.6] SET_STRING uninstall info not found
Will uninstall 629 files for [XAN/XAN.TP2] component 6.
  Restoring backed-up [Xan/Backup/6/O#XAN001.wav]
Xan/Backup/6/O#XAN001.wav copied to Xan/audio2/O#XAN001.wav, 332302 bytes
  Restoring backed-up [Xan/Backup/6/O#XAN001.wav]
ERROR: error copying [Xan/Backup/6/O#XAN001.wav]
(...)
WARNING: unable to restore [Xan/audio/O#XAN316.wav]: Unix.Unix_error(20, "rename", "override/O#XAN316.wav")
(...)
WARNING: unable to restore [Xan/audio/O#XAN316.wav]: Unix.Unix_error(20, "rename", "override/O#XAN316.wav")



If the mod is installed again - with the wavs in the xan/audio2 folder - and deinstalled, there is no error messages:
Code: [Select]
Will uninstall 629 files for [XAN/XAN.TP2] component 6.
  Restoring backed-up [Xan/Backup/6/O#XAN001.wav]
Xan/Backup/6/O#XAN001.wav copied to Xan/audio2/O#XAN001.wav, 332302 bytes
  Restoring backed-up [Xan/Backup/6/override.O#XAN001.wav]
Xan/Backup/6/override.O#XAN001.wav copied to override/O#XAN001.wav, 332302 bytes
  Restoring backed-up [Xan/Backup/6/O#XAN002.wav]
(...)

What I would expect:
1. the wavs not being placed into the mod folder. (I need to delete them by hand to get rid of them.)
2. no error message upon deinstallation, especially not one that tells me that it couldn't "restore" wav files that wheren't in the folder before the installation.

Questions:
Is this intended behavior?
How would I prevent the wav files in the mod package and the error messages?

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1176
Re: Question to HANDLE_AUDIO and error reports upon deinstall
« Reply #1 on: February 09, 2019, 10:03:18 AM »
Wavs remaning in audio2 while the mod is installed is expected. That they remain after the uninstall is not expected, nor is the pear-shaped uninstall itself. Will look into.

Offline jastey

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1524
  • Gender: Female
Re: Question to HANDLE_AUDIO and error reports upon deinstall
« Reply #2 on: March 08, 2019, 04:31:22 AM »
Hello, did you have a chance to look at this? :)

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1176
Re: Question to HANDLE_AUDIO and error reports upon deinstall
« Reply #3 on: March 08, 2019, 08:54:48 PM »
I have now. The bad news is that this is a bug in WeiDU's uninstall code. Uninstalling component 6 breaks the audio for component 0. The missing files are the ones you find in xan/audio2. The best I can do in the short term is probably to device some way for HANDLE_AUDIO to deogg directly into the output dir. It won't fix the bug, but it should circumvent the problem in this case. In the mean time, I would suggest you keep a copy of the mod in, say, your My Documents or similar and use that for working on and for creating mod packages. When you need to test it, you create a copy in your game folder.
« Last Edit: March 08, 2019, 08:59:15 PM by Wisp »

Offline jastey

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1524
  • Gender: Female
Re: Question to HANDLE_AUDIO and error reports upon deinstall
« Reply #4 on: March 09, 2019, 04:16:23 AM »
Thank you very much!
If you say uninstalling component 6 breaks the audio for component 0, does it mean the player cannot uninstall the alternative soundset in the middle of his game but will be left with no audio in this case?

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1176
Re: Question to HANDLE_AUDIO and error reports upon deinstall
« Reply #5 on: March 09, 2019, 03:14:02 PM »
Yes, uninstalling component 6 breaks component 0 (no audio files in the game) until component 0 is reinstalled.

Offline jastey

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1524
  • Gender: Female
Re: Question to HANDLE_AUDIO and error reports upon deinstall
« Reply #6 on: March 10, 2019, 09:08:45 AM »
OK, good to know. Thank you!

Offline jastey

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1524
  • Gender: Female
Re: Question to HANDLE_AUDIO and error reports upon deinstall
« Reply #7 on: March 10, 2019, 09:15:39 AM »
And one related question: Does this also apply to for example alternate portraits of the same name that are installed later etcpp or is it something that only shows in connection to HANDLE_AUDIO?
Would a separate mod with alternate sounds also lead to the same problem (mod 1 would need to be reinstalled to fix audio in game)?
If you'd find a way to circumvent it, is would be great.

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1176
Re: Question to HANDLE_AUDIO and error reports upon deinstall
« Reply #8 on: March 10, 2019, 03:28:05 PM »
This is goes beyond HANDLE_AUDIO and can affect any combination of different components or different mods that act in this particular way. However, the bug only occurs if you use TP2 to create a file somewhere (i.e., copy it to a location where it does not overwrite anything) and then copy it to overwrite elsewhere (I think). Merely overwriting is not affected.

Offline jastey

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1524
  • Gender: Female
Re: Question to HANDLE_AUDIO and error reports upon deinstall
« Reply #9 on: March 11, 2019, 08:26:54 AM »
Thank you!

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: