• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

Fixing .HPS files to prevent random instances of silence when used with Nintendont

Decipio-Carmen

Smash Apprentice
Joined
Apr 2, 2010
Messages
88
Intro:

Sometimes when using Nintendont, the game's BGM gets messed up when it tries to load a new HPS file. What happens is you'll get a split second of audio at the very beginning of a soundtrack and then the audio that SHOULD be playing from the HPS file immediately goes silent, while other sound effects will play just fine, and the game will run just fine. It seems to happen randomly when you try to start a match. For me, the bug would NEVER occur when I test an ISO in dolphin, but when I put the same ISO on my Wii, it would often occur usually within 30 minutes of playing friendlies. This ONLY started happening to me when I added custom .HPS files (non-original).

This is a problem that has been bugging me for a long time, and from what I have seen in various forums and from discussing it with friends, it seems to be a common problem with Nintendont. It's not a big deal, you can just restart a match however many times until the music is back, but it's annoying. In my attempts to fix this, I tried many things unsuccessfully. I tried different SD Cards, loading from a USB, updating Nintendont, using uncompressed ISOs, I even tried writing a program that fixes the left/right decoder states in every block header given an input HPS file, which ended up not fixing the said issue RIP

Eventually though, I found a pretty simple fix. With the new versions of 20XX including playlists and the ability to add many songs, which can potentially mess up Nintendont if the files aren't created properly, I thought I'd share it.

Here's the tl;dr of the guide: Original Melee .HPS files mostly (but not all the time) use a block size of 0x010000. This is what they should be so that Nintendont doesn't mess up.

A lot of the files created by audio hacking tutorials on here use a much smaller block size of 0x04000. I assume that this is done to allow higher precision when creating audio loops. To elaborate: each block holds some #seconds of audio. For example, Block 1 holds the 1st second of data, Block 2 holds the 2nd second of data, Block 3 holds the 3rd second of data, etc. To loop from the end, you loop to any of the previous blocks. So with 1 second blocks, you can only loop to the 1st second, 2nd second, etc. You can't jump to for example, 1.5 seconds into the track.. unless you develop your own audio hacking tools, as most of the tools we use to make custom .HPS files assume a constant block size. The advantage of higher control is why I'm guessing smaller block sizes are used. By going to a larger block size, we have less control over where we can loop, and it makes editing .wav files slightly more difficult, but it's what needs to be done to fix this issue.

Guide:

1.) Follow this guide:

http://smashboards.com/threads/how-...-includes-brstm-file-conversion-guide.401142/

and STOP when you get to the part when you open up LEFT.txt or RIGHT.txt to copy the number of samples. (this is step 4 in "outputting the HPS file"

2.) Download and open up this spreadsheet:

http://www.mediafire.com/download/az2azo9gdwxga5s/HPS_Helper.ods

I have changed the list of offsets and changed block size "Block Size" number to 32768 to reflect the new block size.

Aside: In my spreadsheet, I've changed the "Block Size" field to "Block Size (1 Channel)" to be a bit more precise. 32768 in hex is 0x8000, which is half of the target block size. There are actually 2 channels, left and right in our application. In one block there is 0x8000 bytes (or 0x8000 * 2 samples, since 1 sample is actually a nibble) of data for the left channel which is followed by 0x8000 bytes of data for the right channel.

3.) Paste the number of samples that you copied into the "NumSamples" field in the spreadsheet.

4.) Open up main.asm and copy NumSamples into "Samples" and Blocks Needed into "Blocks"



5.) If you want a custom loop, use the Block Info in the spreadsheet to figure out which block to loop to. Take your desired block number and put it into the "Block # to loop on:" field in the spreadsheet. If you are doing a basic loop, just put '1' for this field.

Scroll down to the bottom on main.asm and copy BlockStart and BlockLoop to their respective locations at the end of main.asm.



6.) You see the values underlined in green in the picture above? Make sure all those values are 0x8000 like in the picture.

Aside: You might be thinking, wait a second, didn't you say the block sizes should be 0x10000? Yes they should be. If you've read the first 'aside' you know that the channels are set to 0x8000 bytes of data per block. The values underlined in green only control the size of data for one channel. What we're doing is creating blocks with 0x8000 bytes worth of left-channel data and 0x8000 worth of right-channel data for a total block size of 0x8000 + 0x8000 = 0x10000 (not counting the block header).

7.) Save main.asm and run "build.bat". A command prompt should open. Wait for it to tell you to hit any button to exit and then press anything you want.

8.) output.hps is your new HPS file

Note that if you are running into the issue with Nintendont described here, you will probably have to re-do every non-original .HPS file for the issue to be fixed (don't forget the menu music). I've redone all my .HPS files and haven't run into the issue since then.

Using larger block sizes might also fix this issue if you run into it when trying to play other games on Nintendont. I'm not sure though, I haven't looked at the audio files for other games.
 
Last edited:
D

Deleted member 337186

Guest
THANK. YOU. SO. MUCH. I've gotten into this problem so many times and I never realized the reason it happened. One question: because this deals with none-original HPS files, does that mean that I have to do this with the custom music that Achilles added?
 
Last edited by a moderator:

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Interesting. I'm glad you found a solution. Do you know why the problem only occurs on certain setups? There were a few in the 20XX thread using Nintendont without problems. (And Dios Mios users having issues while others, like myself, were not).

Edit: addressing comments like this: http://smashboards.com/threads/the-...-update-3-17-16.351221/page-136#post-20938901

There has to be more to the story or something.
 
Last edited:

Decipio-Carmen

Smash Apprentice
Joined
Apr 2, 2010
Messages
88
THANK. YOU. SO. MUCH. I've gotten into this problem so many times and I never realized the reason it happened. One question: because this deals with none-original HPS files, does that mean that I have to do this with the custom music that Achilles added?
To determine this, open up the HPS file in HxD and look at offsets 0x80 through 0x83. That is the block size for block 1. If it's not the right number, then unfortunately you need to re-make the file to fix the issue.

Interesting. I'm glad you found a solution. Do you know why the problem only occurs on certain setups? There were a few in the 20XX thread using Nintendont without problems. (And Dios Mios users having issues while others, like myself, were not).
I have a new Wii and from my understanding I can't use Dios Mios Lite, so I haven't been able to test anything with that.. so I can only guess. Maybe it's purely on chance that they are only using the files that have block size 0x10000, or the method that they use for audio hacks creates files with 0x10000 block sizes. Many of the tutorials I've seen that use Godfed's hps_insert involve inserting audio data into some provided "tmp.hps" and the tmp.hps's that I've seen use a block size of 0x10000. If they used your MeleeHPS guide that I linked (and thus use a smaller block size) and still don't run into issues with Nintendont, I'm not sure what's going on... one variable I can think of in that case is whether or not they have a new or old Wii
 
Last edited:

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
@Rawkstar what block size have you been using for your HPS files?

Also, decipio if you are by your computer, download an HPS file from brawlcustommusic.com and check the block size from those. I'm curious (but on mobile)
 

Decipio-Carmen

Smash Apprentice
Joined
Apr 2, 2010
Messages
88
@Rawkstar what block size have you been using for your HPS files?

Also, decipio if you are by your computer, download an HPS file from brawlcustommusic.com and check the block size from those. I'm curious (but on mobile)
omg I never knew this website existed. Downloaded a .hack//infection song for melee... the HPS sound file is the right block size (0x10000)
 
Last edited:

Acryte

Smash Ace
Joined
Mar 30, 2005
Messages
986
I use nintendon't and I noticed it happened, but only when I was in the menu playing tracks for the playlist. I didn't notice it in game yet, and it seemed to only affect certain songs, so I certainly figured that had something to do with it. Interesting. Wonder if it will be addressed in later versions of Nintendont.
 

Decipio-Carmen

Smash Apprentice
Joined
Apr 2, 2010
Messages
88
Achilles1515 Achilles1515 , After DL'ing some more HPS files from brawlcustommusic.com I've found that the block sizes vary from file to file... I guess it depends on the uploader or game

edit: Alright... sometimes even files from the same game and same uploader will have varying block sizes. Looks like there's no way around having to check in HxD.. luckily it's not that hard to check (drag and drop ftw!)
 
Last edited:

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Achilles1515 Achilles1515 , After DL'ing some more HPS files from brawlcustommusic.com I've found that the block sizes vary from file to file... I guess it depends on the uploader or game

edit: Alright... sometimes even files from the same game and same uploader will have varying block sizes. Looks like there's no way around having to check in HxD.. luckily it's not that hard to check (drag and drop ftw!)
Are you having problems playing one of the files that doesn't have 0x10000 block sizes but still downloaded from that website?
 
D

Deleted member 269706

Guest
@Rawkstar what block size have you been using for your HPS files?
Pretty sure I've just been using the standard 8192(dec) / 0x2000(hex). Never changed anything in your tutorials, just did what they said.
 
Last edited by a moderator:

Decipio-Carmen

Smash Apprentice
Joined
Apr 2, 2010
Messages
88
Are you having problems playing one of the files that doesn't have 0x10000 block sizes but still downloaded from that website?
So I just tried the a file that doesn't have 0x10000 block sizes from smashcustommusic on my Wii and the music messed up. It uses 0x4000 block sizes just in case you want to know
 
Top Bottom