PS2 OPL SND TEST

Status
Not open for further replies.
Just one note regarding the previous suggestion for a PR... It was based on the assumption, that it is stable in all cases and I couldn't test it on the Slim (no internal HDD), nor the FAT with a game-star (no LAN). ;)

...and a pull-request would also have brought up that problem pretty soon, especially since @El_Patas tests the PRs quite thoroughly, before they get merged, or one of the thousands of users (those who update regularly), would have noticed it (possibly at the first day) and that would not have been the first PR, which isn't totally bug-free anyway (which is what I actually wanted to prevent, lol).

After all, my intention was just to prevent this to be as borked as the theme-engine (in some cases) and the older Info-page-implementation. :) Fortunately the current structure seems to be stable and well structured.


Btw.: I think it is quite possible to auto-reload the chosen theme, after exiting from HDL-Server.

Everthing else is great! I will test it later (but still today). I've currently got a lot of work to do.



Edit: It seems to be working quite well, IMO.

I really don't like the fact, that the users should reload OPL or their theme manually... I think that is an issue, which can be fixed.


On another note... There seem to be 2 other issues left.
  1. There seems to be an issue with the sounds playing louder once in a while... I am not sure if that's related to multiple or the same SFX being played at the same time, or what causes it...
  2. If you hold the button when changing overscan, it reacts quite slow and the visuals break apart... I am not sure, if it is an issue of the ifcaro-repo as well (I used the HD Beta v1 of Korium.).
 
Last edited:
Great progress! Well done @Krah , look how much you have achieved! And thanks to everyone else involved.
Anyone cares to post a video showing the glory of the new feature?
 
Hello again,
i just did some testing on the OPLSNDTESTv1.2 build. So here are a few thoughts.
• Regarding the delay of the Splash screen fade out:
- Ideally I think the delay time should vary according to a sfx_files[0].length or something. But I guess there is no such thing-way to retrieve the length of the sound (or there?)..
- If the ideal scenario can't happen, the next best thing I guess would be to read a boot time length value from somewhere inside the theme's cfg (checked to be between 0 and 50, I guess). That would also automatically update the value (in the settings) upon theme application, according to what the theme creator suggests. But that would tie the sounds to specific themes and discourage sfx(-only) creators to contribute their SFX-sets. So a new conf_sound.cfg inside the SND folder may be a better idea.
- User customizable delay is a fine approach for the time being! :) I also love what you did with the busy icon not showing before the splash screen fade out! I think it is better to just show straight the custom theme's one, as soon as the splash screen fades out. More complete custom theme experience.
• The other suggestions and changes i also find good.
• I have not done an excessive bug-hunting but I found that if you enter "Display settings" then hit OK without changing anything, confirmation sound effect acts weird. Mostly like playback is very short (or barely even there). It also happens if you change small things like widescreen or display info page. But not on theme change. On this occasion it playbacks as it should.
• About SFX playing louder once in a while that @TnA mentioned i also thought that they do. But I was not entirely sure if that was really happening or it was just me having already read TnA's comment on it (placebo stuff). So I decided to connect my ps2 sound output to my laptop's microphone input and do a recording to observe the waveforms. But I could not really see a difference and the recording on my computer did not sound to have that. So i guess it was just my idea. Can anyone else confirm of this fact's existence or try and bust that?

I really don't like the fact, that the users should reload OPL or their theme manually... I think that is an issue, which can be fixed.
I have to agree with TnA on this one. Maybe if you contacted the person that merged the HDL server functionality into OPL you could figure something out toghether..
Cheers!
 
As requested, here is an archive containing some code for streaming in the background:
You sir, are a legend. Honestly if it wasn't for your help I probably would've given up already..I'm glad I didn't :)

There seems to be an issue with the sounds playing louder once in a while... I am not sure if that's related to multiple or the same SFX being played at the same time, or what causes it...
I have not done an excessive bug-hunting but I found that if you enter "Display settings" then hit OK without changing anything, confirmation sound effect acts weird. Mostly like playback is very short (or barely even there). It also happens if you change small things like widescreen or display info page. But not on theme change. On this occasion it playbacks as it should.
I think these are both the same thing, I'm not sure I'd call it an issue as it 'seems' to be unavoidable but idk..The only time the sound should playback a little differently (sometimes slightly louder/shorter) is upon selecting OK in the display settings if you haven't changed your theme.

The reason for this is because that's when the function sfxinit is called again in order to update your new themes sfx but if you haven't changed your theme there it happens much quicker since it doesn't have to load new textures etc. It used to happen when selecting OK in the audio settings but since paths don't need to be updated only volume that function call has been moved.
Might be able to make it only call the function if the theme has been changed ideally.

I have to agree with TnA on this one. Maybe if you contacted the person that merged the HDL server functionality into OPL you could figure something out toghether.
My thinking for this was, how often are you going to really use Hdl server? Maybe once to put your games on?? It is possible to not revert to default theme but it doesn't seem possible at this point in time to reload your custom SFX.

The reason for this is because the theme path (for SFX) is retrieved at the call thmLoad which happens whenever you change your theme. Upon entering/exiting hdl server the theme is never actually deinit so therefore it is never reinit with thmLoad so we don't have the theme path upon returning to the GUI because the audio lib and sfx are all deinit at which point we've lost the theme path.

You might think it'd be as easy as calling thmLoad again but unfortunately the arg for this is the themePath which we don't have at that point.

If the ideal scenario can't happen, the next best thing I guess would be to read a boot time length value from somewhere inside the theme's cfg (checked to be between 0 and 50, I guess). That would also automatically update the value (in the settings) upon theme application, according to what the theme creator suggests. But that would tie the sounds to specific themes and discourage sfx(-only) creators to contribute their SFX-sets. So a new conf_sound.cfg inside the SND folder may be a better idea.
This is the approach I was going to take originally but for two reasons I went with the current option.

First one is that I don't really know how the theme configs work atm within the code so I'd have to study it a lil to get it working which could take a few days and I didn't wanna hold the PR back too much longer in case it took me a couple weeks. (It could be looked into at a later date but for the mean time it does work as intended)

Second reason was that it's actually easier for theme developers to figure out what length delay they need to just change the option in OPL reboot and test rather than having to put the cfg back on their PC change one number and move it back constantly. But I guess we're meant to be thinking about the user rather than the theme Creator.

If you hold the button when changing overscan, it reacts quite slow and the visuals break apart... I am not sure, if it is an issue of the ifcaro-repo as well (I used the HD Beta v1 of Korium.).
I'll get both ifcaro and SFX builds and do a comparison on the console and see if it's a SFX related thing (shouldn't be as I haven't touched overscan but you never know).

Thanks for your input guys.
 
Last edited:
Themes are first registered with the themes engine with thmAddElements(), which will scan the specified location for themes. This will add a list of themes to the themes list.

Themes are identified by the path to the config file. The selected theme is set with with thmSetGuiValue().

So a theme would have multiple child elements. When rendering, the UI would iterate through all elements and execute an action based on the function registered by thmAddElem().

There are helper functions for retrieving the current theme index and the array of themes, which can be used together to determine the path to the theme for external code.
 
I saw some of that and had a rough understanding but you explained it a lot better than I could read.

what I couldn't figure out properly was that the filepaths from the theme array seems to be stored as
Code:
themes[i].filePath
and I know 0 is the default theme but couldn't figure out the current theme index in the array..Or do I not set it like that with a static # for the current theme..

You don't have to answer that if youre busy I'm kind of thinking out loud again..I'm going to look into this further, I have seen the helper functions you're talking about.

Thanks again :)

Edit: OK Im pretty sure I've got it but I'm at work so I can't test yet :apologetic:. Excited! About the possibilities though, I'm not happy with the current code structure but this should fix it once and for all :biggrin2:
 
Last edited:
I have a way to trigger it playing louder and more silent again!

I try it later and post how to trigger it!


I was somehow switching between a game-page and an options/settings-submenu or so... I will try the procedure, once I've got a bit more spare time today.



Just to collect some current bugs in a short overview:
  • Seemingly different loudness when doing some transitions or whatever triggers this...
  • Theme&SFX-reload after closing HDL-Server
  • Glitching GUI, when changing overscan (I used Korium HD v1 with @Rival93's sounds.), at least when 'holding' a button to change the values... It could be an Ifcaro-build-issue, tho' (haven't tried it).
  • Some short-play-issue, @Rival93 mentioned.
  • etc.
Have I forgotten something?
 
Last edited:
I can get the name array or the theme id but can't figure out how to get the structure array as its static. Idea was
In sound.c
Code:
int themeId;

theme_file_t themes[THM_MAX_FILES];

themeId = thmGetGuiValue();

sprintf (snd_path, "%s/SND/%s" themes[themeId].filePath, sfxfiles[i].name)

But of course thinking about it...I'm just making that array and it's not populated by anything as the themes.c one holds all the info.
:(

I'm guessing by what sp193 said there is currently already a way in themes.c to get the structure array so making a function in themes.c to return those values would just be a work around. :cower:
 
I can get the name array or the theme id but can't figure out how to get the structure array as its static.

Oh. I saw it wrong.

If you're going to make it part of the theme, why not determine the path from thmLoad()? You can then get the path and check the theme's config file for whether there is a sound registered.
The path can only change with calls to thmLoad(), so you could just use the last path that was generated when handleHdlSrv() returns.
 
If you're going to make it part of the theme, why not determine the path from thmLoad()? You can then get the path and check the theme's config file for whether there is a sound registered.
The path can only change with calls to thmLoad(), so you could just use the last path that was generated when handleHdlSrv() returns.
Very similar to what it's currently doing, thmLoad gets the path stores it for later (i should probably just have it return the path as a value so I can keep sound in its own source though) then when sfxinit is called if there is a themepath it loads the custom SFX.

Hdl server unloads and reinit the audiolib which should restore the custom SFX if there is a theme path but it seems to lose the theme path at deinit (Ive got it set to reload the default theme in the code I linked because without it, it reinits the audiolib but doesn't reload the custom SFX)...

Or maybe I just need to change the condition a lil as now I think about it the trigger I'm using is switched off after the first load...If theme_path != Null might work better here :ambivalence: that explains it lmao
 
There seems to be a bug, which can cause OPL to freeze, once it loads OPL's main-config-file! ;)

I think 2-3 more tests would be fine.
 
There seems to be a bug, which can cause OPL to freeze, once it loads OPL's main-config-file! ;)
Any way I can replicate this?

As of today the only 'bug' I can replicate is hdl server reverting to default theme (which was intentional).

The overscan issue is not related to SFX builds (happens in Ifcaro builds) but even then I'm not sure you're meant to hold the button down when adjusting overscan?

The random volume changes, I cannot replicate this issue and code wise there is no reason this should happen as volume is adjusted by the user defined integer only at one point throughout the program.

The network config changing/saving issue you said about a week ago I cannot replicate either, I can change, save and load network config settings without any problems.

Changing themes you mentioned around the same time, I'm not having any issues there either..No bug to replicate (as of today...Per theme SFX was causing an issue with custom SFX not being reloaded if display settings OK selected without changing theme) but that's fixed and Ive never had any freezes changing themes. (This fix is in my fork, problem will be present in latest test but I can confirm it's fixed)
 
Last edited:
  • Like
Reactions: TnA
@TnA
I've tried to replicate the problem above but everything is fine on my end, thought it might be a forwards/backwards compatibility issue with saving configs and switching to ifcaro builds but I can change settings, save in ifcaro and load up SFX builds and vice versa without any problems.

In regards to hdl svr, I figured out that as long as your custom theme is saved to the cfg before loading hdl svr everything turns out fine (otherwise if you just switch theme and load hdl svr you get a console stall at unload when it tries to reload your custom sfx). Only solution I could come up with was to call saveConfig before launching HDL Server. Everything works out fine now BUT I don't know if you guys are happy with that??

@sp193
(with the help of @Tupakaveli) I've been trying to automate the fade delay based on the duration of the boot sound, the formula I'm using is
Code:
fileSizeinbytes / byteRate
It works fine for uncompressed wav files but not so well for the compressed adps. Since all the users boot sounds will be converted using the same converter in the homebrew sdk (coded by MarcosPividori) I am wondering if it'd be possible to include the original size in bytes of the input file in the output header? The header is 16 bytes and there are some containing no data.

Untitled-1.png

As you know I'm still fairly new to coding and such so I don't know if this would be considered hackish or bad practice? If so that's totally cool and hopefully I can figure out some other way :-p

Edit: Ok I updated the converter to do what I wanted, so maybe I can just give it out as an unofficial modded version for use with making theme sound packs for OPL?
 
Last edited:
Unfortunately at this point the only thing holding back a pull request is hdl server unloading and keeping your current theme & sfx if it hasn't been saved to the cfg.

It's a problem caused by per theme sfx and code wise it looks like it should work but it just freezes if you haven't saved cfg after changing themes and loading hdl svr.

I've spent the past week playing with it to no avail.

thmLoad gets the theme path, stores it on the stack, checks for a SFX folder in current theme, if found enables the condition to read custom sfx. Extern to sound.c

Hdl svr loads, audio lib quits... at this point we should still have the theme path and the condition enabled, Hdl SVR unloads and reinit audio lib and sfx. Works fine if current theme is saved to cfg, else stall.

I really don't see the cause :-(

EDIT: The issue is present in current ifcaro builds it is not sound related. If you change theme don't save config and load hdl server then unload the console freezes......no wonder I couldn't find the problem in the sfx code.
 
Last edited:
EDIT: The issue is present in current ifcaro builds it is not sound related. If you change theme don't save config and load hdl server then unload the console freezes......no wonder I couldn't find the problem in the sfx code.
As a temporal fix (for informative purposes mostly), can be added a check before entering hdl ?, something like this:

If current theme setings are different than saved theme settings display a warning text: "Your theme settings has not been saved, the theme will return to the saved settings the next time you enter OPL, do you want to proceed ?"

And the classic "YES/NO" at bottom of the warning text
 
Pull request is up, all the final little problems have been dealt with.

Just wanna say a quick thanks to everyone again.
dekkit, jolek, NewFile, RivalK93, sandungas, svotib, sp193, TnA, Tupkaveli, VeditaBR.

Everyone at psx-place, all the mods and admins. Thanks guys.

I'm gonna take a week or so to just play some games and hopefully I'll be back with a BGM test (for anyone that missed it a couple pages back sp193 was kind enough to write some audio streaming code so its just gotta be integrated into OPL)

All the best.
 
Merge-Test-Build (sfx and boot sound are enabled by default in the test build for sake of ease they are off by default in PR): http://frd.li/91ced1b1e263d82802cb41a4fb29610b
(copied from Krah's Pull request to the ifcaro-repo) ;)


Btw.: Sorry, I haven't had much time to test it so thoroughly these days. I will make some more tests... I should have saved the config, which seemingly was the cause of OPL freezing. :-|

I can make a video about the sound/SFX-loudness, tho'.
 
Last edited:
Status
Not open for further replies.

Similar threads

Back
Top