Author Topic: Pointless debug warnings  (Read 5822 times)

0 Members and 1 Guest are viewing this topic.

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Pointless debug warnings
It's been a while since I ran a debug build, but it seems to have gotten a few warning additions. There are two I find very puzzling, because it just seems to be blatantly untrue:

Warning: "salvo mode" flag used with turret which has more than one weapon defined for it
subsystem 'gunturret-0' on ship type 'LSF Guardian Angel'.
only single weapon will be used

File: ship.cpp
Line: 6650

This is the subsystem entry for it:

Code: [Select]
$Subsystem:                 gunturret-0, 25, 20
$Alt Subsystem Name:            Heavy Turret
$Default PBanks:                     ( "VX-181 Heavy Pulse" "Type-3 Beehive round" )
$Turret Base RotationSnd:      192
$Turret Base FOV:                   250
$Target Priority:                     ( "cruisers" "corvettes" "capitals" "super caps" "bombers" "fighters" )
$Flags:        ( "check hull" "no subsystem targeting" "target requires fov" "fire on target" "salvo mode" "reset when idle" )
$animation:        triggered
$type:        initial
+relative_angle:        80, 0, 0

It is working exactly as intended in game. It fires the VX-181 in salvo mode at capital ships, since its a huge weapon. And it fires the Type-3 only at small targets, also in salvo mode.
So this warning tells me... what exactly? There is nothing for me to fix here, so the warning is just going to be a pointless nuisance each time I run a debug build that has this ship in it. Having to click 'continue' 6 times for each mission load.


And here's one that is even better!

Warning: Sound 'Neutron.ogg' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel.
File: sound.cpp
Line: 354

1. This warning pops up on every weapon being fired. It makes running a debug build kind of annoying.
2. Its again, nonsense. All of the affected weapon sounds, that have two channels, actually work just fine, and have been working fine all this time. But you know when they don't work fine? When I change the sounds.tbl entry for it to be 0 (no 3D) instead of 1 (3D). Then the sound effect is just straight up inaudible.

So it's another warning that tells you to go fix something that isn't broken in the first place.  :confused:

Debug warnings are super important and I love how much easier they make debugging in general. But these recent additions seem to have been added by someone who just looked at code and made a few assumptions, without actually having tested it ingame.
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline m!m

  • 211
Re: Pointless debug warnings
The second warning makes a lot of sense. It says that the sound has more than one channel (it is probably a stereo sound) which is a configuration that doesn't make sense for 3D sounds. Normally, FSO should just reject playing this sound but it is nice and actually resamples the audio data to a single channel which is why it still works. This warning tells you that you are using a sound file which is not suited for what it's being used for and tells you to take a look at it because it's likely that you made a mistake.

Debug warnings are super important and I love how much easier they make debugging in general. But these recent additions seem to have been added by someone who just looked at code and made a few assumptions, without actually having tested it ingame.
FYI, I tested the new sound code in game. If you look into the logs of a previous version you will see that the 3D sound warning is present there but it's not a Warning dialog so this warning was always present but you didn't notice it because it was just a log message.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Pointless debug warnings
This kind of feels like the previous thread about Data vs data error messages...

Okay look, I get how it 'makes sense', but now look at it from my modder perspective on why this is warning is obnoxious and without any positive net gain:
The sound file as stereo works without issue because as you said, Freespace already deals with it on its own, to make it work. There already was a log message that could be pretty safely ignored because its a trivial issue! To make this warning go away, so I can actually use a debug build without a gazillion warning messages, I'd need to go resave/reconvert possibly over a hundred different sound effects (I dont know how many exactly I've saved with two audio channels over time). Sound effects that work perfectly fine in the engine as they are. For no other purpose than to stop getting pop ups because you randomly decided to 'upgrade' a log message into a warning pop up.

Please just turn it back into a log message. This benefits nobody. And in its current shape, makes using debug for me almost impossible.
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline m!m

  • 211
Re: Pointless debug warnings
The sound file doesn't work "just fine", it works because FSO recognizes that it can't continue with the current data and then fixes your mistake. The reason this is a Warning is because
  • It's likely that a modder made a mistake and used the wrong sound for something and
  • It degrades performance because resampling the sound takes time and memory
This is the exact reason why warnings exist, to let modders know that something is wrong. The only reason why we are having this discussion is because the message was only a log message and people tend to ignore those. I understand that this is annoying but IMO the Warning should stay. If you want, you can enable the non-interactive mode which will hide the dialog box (but also every other warning). I would like to add a warning category system to FSO at some point where you could disable specific warnings but at the moment that is not available so the non-interactive mode is your only choice.

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Pointless debug warnings
Spoon, as much as I respect and agree with you on many of FSO's usability issues, I am going to disagree on this one. The most I will agree to is introducing a bit of code to make sure that we only warn once for a given sound, but I believe m!m's original decision to make this warning more visible is still correct.

EDIT:

I do realize that converting dozens or hundreds of files by hand is a pain. Luckily, this can be done with as bit of Audacity scripting. Here's a quick guide:

Step 0: Install Audacity
Step 1: Go to File -> "Edit Chains..."
Step 2: Create a new Chain, call it "To Mono" or something
Step 3: Add the following commands:
      * StereoToMono
      * ExportOgg
Step 4: Save the new chain
Step 5: In Audacity's main menu, go to File -> "Apply Chain"
Step 6: Choose "Apply to Files"
Step 7: Point it at the audio files you wish to be mono'ed
Step 8: Let it do its thing. The finished files will be in a directory named "cleaned" (for some reason), copy them wherever you need them.
« Last Edit: March 07, 2017, 04:52:12 pm by The E »
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Pointless debug warnings
WARNING: "Sound 'Charge2.ogg' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel." at sound.cpp:354
WARNING: "Sound 'Light laser2.ogg' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel." at sound.cpp:354
WARNING: "Sound 'MeltdownerBeamHL.ogg' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel." at sound.cpp:354
WARNING: "Sound 'MeltdownerBeam.ogg' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel." at sound.cpp:354
WARNING: "Sound 'Neutron.ogg' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel." at sound.cpp:354
WARNING: "Sound 'Charge.wav' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel." at sound.cpp:354
WARNING: "Sound 'Heavycannon3.ogg' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel." at sound.cpp:354
WARNING: "Sound 'Cannon.wav' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel." at sound.cpp:354
WARNING: "Sound '40mm.wav' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel." at sound.cpp:354
WARNING: "Sound 'CordiPhaserslasher4s.ogg' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel." at sound.cpp:354
WARNING: "Sound 'mediumbeam.wav' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel." at sound.cpp:354
WARNING: "Sound 'VX-181.ogg' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel." at sound.cpp:354
WARNING: "Sound 'Photonpulse.ogg' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel." at sound.cpp:354
WARNING: "Sound 'Nordera.wav' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel." at sound.cpp:354
WARNING: "Sound 'CordiPhaserslasher3s.ogg' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel." at sound.cpp:354
WARNING: "Sound 'Bakaka.ogg' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel." at sound.cpp:354
WARNING: "Sound 'Light laser.wav' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel." at sound.cpp:354
WARNING: "Sound 'rocket.wav' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel." at sound.cpp:354
WARNING: "Sound 'Rocketpodlaunch.ogg' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel." at sound.cpp:354
WARNING: "Sound 'Csavaliant.ogg' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel." at sound.cpp:354
WARNING: "Sound 'DD71.ogg' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel." at sound.cpp:354
WARNING: "Sound 'ZyIonbeam.ogg' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel." at sound.cpp:354
WARNING: "Sound 'Neutronbeam.ogg' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel." at sound.cpp:354
WARNING: "Sound 'shard.wav' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel." at sound.cpp:354
WARNING: "Sound 'MV_Warp_1.ogg' has more than one channel but is used as a 3D sound! 3D sounds may only have one channel." at sound.cpp:354

No please, give me more warnings. These are very helpful and I am just dying to spend hours finding and fixing all of these sounds that work just fine ingame, just so I can have a usable debug build.
And this was just one mission.

Mods currently benefitting from this: ???
Mods negatively affected by this: WoD

Quote
I would like to add a warning category system to FSO at some point where you could disable specific warnings but at the moment that is not available so the non-interactive mode is your only choice.
How about you reverse your logic and actually only turn this log mention into a warning when you add this warning category system to FSO?
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 
Re: Pointless debug warnings
It shouldn't be too hard to fix these files in bulk, right? That'd be a pretty good solution...
The good Christian should beware of mathematicians, and all those who make empty prophecies. The danger already exists that the mathematicians have made a covenant with the devil to darken the spirit and to confine man in the bonds of Hell.

  

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Pointless debug warnings
No please, give me more warnings. These are very helpful and I am just dying to spend hours finding and fixing all of these sounds that work just fine ingame, just so I can have a usable debug build.
And this was just one mission.

I do realize that this is annoying. It's intended to be. But if it takes me less than ten minutes to find a batch solution for this issue that I can easily apply to entire directories that takes just seconds to do its thing, then I'm reasonably confident that everyone else can do it too.

So. With all due respect: Do not make this a larger issue than it is.

Also, repost:

I do realize that converting dozens or hundreds of files by hand is a pain. Luckily, this can be done with as bit of Audacity scripting. Here's a quick guide:

Step 0: Install Audacity
Step 1: Go to File -> "Edit Chains..."
Step 2: Create a new Chain, call it "To Mono" or something
Step 3: Add the following commands:
      * StereoToMono
      * ExportOgg
Step 4: Save the new chain
Step 5: In Audacity's main menu, go to File -> "Apply Chain"
Step 6: Choose "Apply to Files"
Step 7: Point it at the audio files you wish to be mono'ed
Step 8: Let it do its thing. The finished files will be in a directory named "cleaned" (for some reason), copy them wherever you need them.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: Pointless debug warnings
FSO is capable of taking care of this, and it sounds like a lot of work for minuscule gains in performance. Stereo to mono conversion isn't gonna bog down a modern PC. This isn't even something most people know how to fix, if they're using second-hand sounds as opposed to making their own, this warning will only serve as a cause of frustration. You first make something a problem that wasn't a problem before (though I don't know how many non-stereo sounds are floating around the community), then ask other modders to install a program just to fix the resulting problem. Not all people know Audacity well enough to come up with the solution like you did, and not all people needing that information will necessarily come across this thread.

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: Pointless debug warnings
It's likely that a modder made a mistake and used the wrong sound for something

I think that's a huge false assumption here. It seems very unlikely that a modder wires in the wrong sound file and somehow does it in such a way that they fail to actually hear the difference when testing it.

Also what is one supposed to do when the same sound file both is and isn't used as a 3D sound? Maybe you fire some ship/weapon/whatever sounds in the interface too or in any other context. The only solution would be to duplicate the sound and make it mono yourself instead of just letting the engine silently handle it, which ends up sounding exactly the same but with twice and files and 1/3 more filesize and more work.

What are the plausible scenarios here?

1. Modder makes a mistake and uses the wrong sound number or mixes up their files. Okay, they maybe notice the mistake due to the warning, but they would have heard their mistake anyway. But then again, the warning might just throw them off and it actually takes them longer to figure out their mistake.

2. Modder uses a stereo sound as a 3D sound. They get a warning, so they mix the sound down to mono because they want the warning to go away. They got rid of the warning but it still sounds exactly the same.

3. Modder uses a stereo sound as a 3D sound, but luckily they are a bit of a sound engineer, so after the warning tips them off about their mistake they are able to go back to their working files for that particular sound and fiddle with the knobs to convert their sound to mono in a graceful manner which preserves its acoustic features so much better than just mixing it down to mono that their trained ear is actually able to just about hear the difference.

Am I missing something here? Is there some actual problem that a modder or player might face which the warning is meant to help modders solve? So far all the reasoning sounds purely puristic, and from the modder's POV analogous to the engine throwing up a warning when you try to use an RGBA texture for something that only requires RGB.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Pointless debug warnings
I do realize that this is annoying. It's intended to be. But if it takes me less than ten minutes to find a batch solution for this issue that I can easily apply to entire directories that takes just seconds to do its thing, then I'm reasonably confident that everyone else can do it too.

So. With all due respect: Do not make this a larger issue than it is.
Yeah okay sorry, I must admit that I get kind of pissy when I'm stressing out about all these stupid warnings about things that weren't issues before but make debug nearly unusable, while trying to fix something else, and the response from m!m basically amounts to "Yeah well, These warnings are here to stay because I says so, your mistake, have fun dealing with it." which is about as helpful as... yeah, not helpful at all. (I realize that was probably not his intend but...)

I do realize that converting dozens or hundreds of files by hand is a pain. Luckily, this can be done with as bit of Audacity scripting. Here's a quick guide:

Step 0: Install Audacity
Step 1: Go to File -> "Edit Chains..."
Step 2: Create a new Chain, call it "To Mono" or something
Step 3: Add the following commands:
      * StereoToMono
      * ExportOgg
Step 4: Save the new chain
Step 5: In Audacity's main menu, go to File -> "Apply Chain"
Step 6: Choose "Apply to Files"
Step 7: Point it at the audio files you wish to be mono'ed
Step 8: Let it do its thing. The finished files will be in a directory named "cleaned" (for some reason), copy them wherever you need them.
This is actually a somewhat useful reply. But do you have any suggestions on how to weed out the stereo files that actually need converting from the ones that don't, in a folder that has 400 files?

Also lets not all ignore that:
Quote
Warning: "salvo mode" flag used with turret which has more than one weapon defined for it
subsystem 'gunturret-0' on ship type 'LSF Guardian Angel'.
only single weapon will be used

File: ship.cpp
Line: 6650
is actually useless and also annoying.
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Pointless debug warnings
This is actually a somewhat useful reply. But do you have any suggestions on how to weed out the stereo files that actually need converting from the ones that don't, in a folder that has 400 files?

Everything in data/sounds should be mono (unless you're doing some fancy mainhall stuff). At the very least, converting everything in there to mono won't hurt anything.

Quote
Also lets not all ignore that:
Quote
Warning: "salvo mode" flag used with turret which has more than one weapon defined for it
subsystem 'gunturret-0' on ship type 'LSF Guardian Angel'.
only single weapon will be used

File: ship.cpp
Line: 6650
is actually useless and also annoying.

This is a more straightforward case, but I would still like to take a moment to figure out why that warning was put in in the first place.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Pointless debug warnings
Given that that line and several of the ones surrounding it are just spewing warnings without applying any corrective measures, they're safe to downgrade to a log print.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: Pointless debug warnings
This is actually a somewhat useful reply. But do you have any suggestions on how to weed out the stereo files that actually need converting from the ones that don't, in a folder that has 400 files?

Everything in data/sounds should be mono (unless you're doing some fancy mainhall stuff). At the very least, converting everything in there to mono won't hurt anything.


You may find that Audacity only processes the stereo files, leaving you with converted mono files in the "cleaned" folder (but none of the files that were mono to begin with), and the original mix of mono and stereo in the parent folder.  If this happens and you only want mono files, I *think* it'd be easiest to just move the files in "cleaned" back to the parent, overwriting the original stereo files, leaving you with only mono files in the source folder, which is what you want.


Also, I find the lack of concern for proper modding practises rather concerning.  You're willing to bleed time and performance every single time your mod loads, to save you time converting stereo > mono??  it's not like FSO can save the converted files, and you're only costing performance once, if I'm understanding correctly, the files must be converted at every load and kept in memory (or worse, converted every time).  :confused:
I dunno, maybe it's just me.

What would be kind of nice, is if FSO, since it converts to mono anyways, dumps the files into a subfolder \mono or something, and processes from there, but that costs disk space, which even now, not everyone has a lot of (especially if they're playing from a smaller SSD).

 

Offline m!m

  • 211
Re: Pointless debug warnings
FSO actually can't save the converted audio because we have no way of encoding that audio again since we removed that feature from our FFmpeg builds to save some space.

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: Pointless debug warnings
So how many times does one need to load mod X before the accumulated increase in loading time would add up to, say, an hour of extra work for the modder? 10000 perhaps, if we're being gracious and assume the increase per load is a whopping 0.3s? How long will it take for the collective playerbase to actually reach 10000 loads? A couple of years maybe, for a mod of average popularity?

If one wants to present "it increases loading time" as reasoning then they should have some benchmark data to back that up, because at the face of it it doesn't make any sense as stereo->mono conversion can safely be assumed to be lightning-fast. For reference, my Audacity does it in about 1/10th of a second per minute of audio data.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Pointless debug warnings
"Hi my name is jr2, I dont actually mod myself but I am very concerned by what I perceive as lack of 'proper modding practice' by a modder who has been modding for a lot of years and has had several big releases on his name. Also I am wrong about how audacity processes files, as it happily converts mono files again."

Top ****ing kek, you are a riot. Kindly piss off.

Given that that line and several of the ones surrounding it are just spewing warnings without applying any corrective measures, they're safe to downgrade to a log print.
  :yes:

So how many times does one need to load mod X before the accumulated increase in loading time would add up to, say, an hour of extra work for the modder?
It took me 2-3 frustrated hours of ****ing around with this nonsense yesterday for... I have no idea what I gained for this expenditure of mental energy. But I can't exactly say I am grateful. I'd love to be presented with some benchmarking power truth that shows me how many frames are saved.




Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline m!m

  • 211
Re: Pointless debug warnings
I still think that the warning offers valuable information to modders and should not be removed. However, I see how it can be frustrating to encounter this warning so how about you enable the non-interactive mode which will hide the dialogs and only print the warnings to the log? I'll try to come up with a category system for the warnings so you can suppress that specific warning but in the meantime you can continue modding without being interrupted by the warning.

EDIT: Category warning pull request: https://github.com/scp-fs2open/fs2open.github.com/pull/1298
« Last Edit: March 08, 2017, 10:21:30 am by m!m »

 

Offline Torchwood

  • 27
  • Mechanical Templar
Re: Pointless debug warnings
That would be the best compromise solution. On the one hand, there is merit to assuring quality in development, regardless of whether you are doing open source or in-house developing. I have been witness to some spectularly bad code in useful, but badly written applications and the resulting maintenance creep always buried them in the long run. On the other hand, devs like Spoon have a lot of ground to cover and only so much time and energy to go around, so triaging the serious issues apart from minor annoyances would go a long way to help them out.

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: Pointless debug warnings
"Hi my name is jr2, I dont actually mod myself but I am very concerned by what I perceive as lack of 'proper modding practice' by a modder who has been modding for a lot of years and has had several big releases on his name. Also I am wrong about how audacity processes files, as it happily converts mono files again."

Top ****ing kek, you are a riot. Kindly piss off.

Given that that line and several of the ones surrounding it are just spewing warnings without applying any corrective measures, they're safe to downgrade to a log print.
  :yes:

So how many times does one need to load mod X before the accumulated increase in loading time would add up to, say, an hour of extra work for the modder?
It took me 2-3 frustrated hours of ****ing around with this nonsense yesterday for... I have no idea what I gained for this expenditure of mental energy. But I can't exactly say I am grateful. I'd love to be presented with some benchmarking power truth that shows me how many frames are saved.

Always a pleasure, Spoon.  Any time.  Smooches!