PiBoSo Official Forum

GP Bikes => General Discussion => Topic started by: LOOPATELI on January 05, 2016, 01:58:15 PM

Title: Engine Sound Stereo Issues
Post by: LOOPATELI on January 05, 2016, 01:58:15 PM
We've talked aboit it here: (MaxHud plugin Post)

http://forum.piboso.com/index.php?topic=79.300

So basically something is wrong with the stereo of the output sound. Here is the video max askes for:
(Use a good sound sistem or headphones)

https://www.youtube.com/v/t7-n6IXEu3o

As you can hear, some sound sources seems to be well stereo panned, and others are way too much panned. For example: transmission sound, wind sound, knee slider sound, and even engine sound in some replay views
Title: Re: Engine Sound Stereo Issues
Post by: HornetMaX on January 05, 2016, 05:40:38 PM
Could you describe exactly (with video timings) what you think is wrong ?
Example: between 0m:00s and 0m:07s on the video, do you think something that is wrong ?

Also, in 1st person view, do you (or the others that have reported the issue):
Title: Re: Engine Sound Stereo Issues
Post by: Vini on January 06, 2016, 01:30:56 AM
that is basically what i meant in the other thread.


the stereo panning is too wide.
Title: Re: Engine Sound Stereo Issues
Post by: HornetMaX on January 06, 2016, 07:29:37 AM
@vin: better to discuss this issue here instead of in the MaxHUD thread. Can you (too) answer the questions above ? I'm under the impression the problem comes simply from the orientation of the head of the rider. If that's the case, I think I know what the problem is.
Title: Re: Engine Sound Stereo Issues
Post by: Stout Johnson on January 06, 2016, 09:12:12 AM
Quote from: HornetMaX on January 06, 2016, 07:29:37 AM
@vin: better to discuss this issue here instead of in the MaxHUD thread. Can you (too) answer the questions above ? I'm under the impression the problem comes simply from the orientation of the head of the rider. If that's the case, I think I know what the problem is.

I haven't had the time to listen to the video above yet (can't do that on my workplace). Will try to get to the matter tonight or tomorrow maybe. But your assumption that it might be connected to head of rider could be true for the onboard issue. I think I remember Loop and Vin are also 1st person riders. I do have a setting of about 50-60 in the corner anticipation (if I remember correctly). Whatever the conclusion is, I bet it is safe to say that the blending between left/right audio is too strict (or maybe in better words: there is not enough blending). I should always be able to hear my engine in both ears (the one closer the the audio source of course hearing it louder).
Title: Re: Engine Sound Stereo Issues
Post by: Hawk on January 06, 2016, 09:19:44 AM
I have GPB on main speakers, and from the video above I can definitely notice that the sound is moving right over to only one corresponding speaker when the riders head moves left and right, same when leaning right over with the knee slider sound.

Hawk.
Title: Re: Engine Sound Stereo Issues
Post by: HornetMaX on January 06, 2016, 09:27:10 AM
The reason why I didn't have the problem in 1st person is that when I switched to 1st person I had freelook activated but my EDtracker off, so the rider was looking straight ahead even when the bike was leaning (in turns).

Anyway, the first 10 seconds of LOOPA's video are enough (even on a laptop with a 1.5$ headset). Bike standing still:
This is consistent with the sound source position (for the 990, it's roughly in between the two exhausts at the rear).

I've done some search and I think I've found why it is so. It's a bit complicate to explain but I'll try.

The bad news is that (assuming I'm right) it's something intrinsic to openAL.
The good news are that there may be workarounds and, even better, that in more recent versions on openAL implementations there may be a proper solution that should improve significantly the way sounds are spatialized (but I have no idea of the CPU cost increase).

The problem in replays is the same.

Back to digging into this ...
Title: Re: Engine Sound Stereo Issues
Post by: LOOPATELI on January 06, 2016, 10:59:22 AM
I don't use freeload, just corner anticipation and controls assigned to move the head left and right.

No doubt about there is a problem when you look left and right, let's move.

When I exit pits and started zig-zagging:
If i don't move the head, engine sound is correct, it is a bit panned just in the way it goes.
Transmission sound is all the way panned to the other side of where I am leaning.(I lean right, transmission heard only on the left)
Same happens whit knee slider sound. I lean right and I hear it all the way in the other side. Which is ever more weird than transmission; yes maybe the sound is nearer to the other ear but your body is in between you don't suppose to hear it in that way.
Also the same with that kind of wind/admission sound when you go a bit faster.

The problem does not happen only when you are full leaning at 60deg, it's also soon drastic even with the smallest leaning.

at 1:10 at the video (with "Free" camera) also it's to drastic, and when I crashed a little bit later, all the sound goes to the left and looks like collision sound is a kind of mono(not only the source, but how I heard it).


Don't know, I have to say that I am a little bit special with the sounds, in my opinion they are more immersive than graphics (obviously graphics are too), and i just feel that they are wrong, they don't mix together creating a good experience.

Obviously I don't know what is the solution, a bit of everything i guess, but there is something wrong and weird there.
Title: Re: Engine Sound Stereo Issues
Post by: HornetMaX on January 06, 2016, 11:13:47 AM
Quote from: LOOPATELI on January 06, 2016, 10:59:22 AM
No doubt about there is a problem when you look left and right, let's move.
No, let's *not* move. We should clarify first the issue when one looks left/right, because the other issues could come from this (simpler) one.

Quote from: LOOPATELI on January 06, 2016, 10:59:22 AM
When I exit pits and started zig-zagging:
If i don't move the head, engine sound is correct, it is a bit panned just in the way it goes.
Transmission sound is all the way panned to the other side of where I am leaning.(I lean right, transmission heard only on the left)
Same happens whit knee slider sound. I lean right and I hear it all the way in the other side. Which is ever more weird than transmission; yes maybe the sound is nearer to the other ear but your body is in between you don't suppose to hear it in that way.
Try to reproduce the same situations, but with freelook ON (set it to headtrack for example), so that the rider head will always look forward, even when turning / leaning. Normally you should no longer have the problem.

Note: it's not a solution or a workaround, it's just to confirm the issue comes from the virtual rider head rotating left/right due to corner anticipation. So that would mean that all boils down to the 1st problem: bike standing still, looking left/right "pans" the sound too much (one channel goes completely silent).

And for that, I may know where the problem is.
Title: Re: Engine Sound Stereo Issues
Post by: Stout Johnson on January 06, 2016, 09:12:19 PM
I just gave it a try and I have to say that in onboard rider view (the one where the head hangs off to the side) I did not have total left/right audio panning. It seems to mix quite ok, although I would say that it tends to prefer a certain channel a bit too much (but that might just be my personal feeling). The only situation where I have total panning is in the replay view from the tail cam.

So for me there does not see to be an obvious problem.
Title: Re: Engine Sound Stereo Issues
Post by: HornetMaX on January 06, 2016, 09:52:53 PM
@LOOPA, vin97, stout and Hawk: in your GPB dir (where you have the core.exe file) there's a small text file named sllog.txt. Could you PM me it's content ?
Title: Re: Engine Sound Stereo Issues
Post by: Stout Johnson on January 06, 2016, 10:10:24 PM
Done.
Title: Re: Engine Sound Stereo Issues
Post by: LOOPATELI on January 07, 2016, 12:45:49 AM
Quote from: HornetMaX on January 06, 2016, 09:52:53 PM
@LOOPA, vin97, stout and Hawk: in your GPB dir (where you have the core.exe file) there's a small text file named sllog.txt. Could you PM me it's content ?

I will send it to you tomorrow, I mean, today  :D
Title: Re: Engine Sound Stereo Issues
Post by: Hawk on January 07, 2016, 12:51:24 AM
Quote from: HornetMaX on January 06, 2016, 09:52:53 PM
@LOOPA, vin97, stout and Hawk: in your GPB dir (where you have the core.exe file) there's a small text file named sllog.txt. Could you PM me it's content ?

Done.  ;)

Hawk.
Title: Re: Engine Sound Stereo Issues
Post by: HornetMaX on January 11, 2016, 09:15:31 AM
I've done some testing and noticed a few things:

There was a public openAL implementation maintained by Creative Labs: it stayed public up to v1.1 (the version we have in GPB) and then it turned proprietary so that Creative has reserved some interesting features only to his own sound-cards (like mine). One of the features that really boosts localization is called "CMSS3D Headphones" for my sound-card (or "SBX Surround" in more recent Creative sound-cards like the Z/Zx/ZxR which were also good, more recent ones, the Recon, are bad by the way). I occasionally play CoD4 (FPS) and I can tell you that if I disable that option I am way less able to localize opponents via sound (when the option goes off accidentally, I can tell in 1-2min). The way it works in CoD4 (not openAL) is a bit weird: you setup your speaker configuration in Windows as 5.1 (even if you're using headphones), so that CoD4 sends a 5.1 sound out to the sound card. The the sound-card CMSS stuff does its magic to translate this into a stereo sound "with spatial information". It works well, much better than most gimmick 5.1/7.1 headphones. And no, it's not marketing: there's some science behind.

For us (GPB on openAL) it's even better in principle: essentially GPB tells to my sound-card where the sounds and listener are (and how they are moving) and the sound-card can do even better than in the CoD4 case, thanks to something that is called an HRTF (Head-Related Transfer Function, https://en.wikipedia.org/wiki/Head-related_transfer_function (https://en.wikipedia.org/wiki/Head-related_transfer_function), you can read just the intro, it's enough). An HRTF is what makes it possible to have 3d sound with only an headphone, without a 5.1/7.1 system.

I'm pretty convinced that in openAL v1.1 there's no HRTF: this means that a sound is panned left/right (depending on the relative position of sound source and listener) with a very simplified algorithm that in the end gives poor localization. Again, I don't have the issue (or I have it to a much lesser extent) thanks to my sound-card.

To get an idea of what an HRTF does, check this video, in particular the part 0:40 - 1:25 (light bolt spinning around the head, with and without HRTF):

https://www.youtube.com/v/9lprZmOgU-E

By the way, Impulsonic (https://www.impulsonic.com/ (https://www.impulsonic.com/)) sell some sound libraries with interesting capabilities. You can have a look at their site/youtube videos to get a grasp of concepts like environment reverb, occlusion etc.


Back to business now: there may be an easy solution to the problem, thanks to OpenAL Soft (http://openal-soft.org/ (http://openal-soft.org/)), a free, public software implementation of openAL. Don't laugh at the minimalistic web site, the software has many interesting features (including HRTF) and the developer replies very kindly on the openAL maling list.

But before I go down the pain to explain you how to try this, can somebody provide a few GPB replays (not too big, 1-2min max each) in which you have poor sound localization ? E.g. bike behind you, trying to pass you, you behind bikes etc ? Please for each replay point out exactly when (timing) and which replay camera to use. Also, please use only default bikes (125/500/990).

P.S.
If you open sllog.txt (in GPB directory, where you have the core.exe) you see something like this:

Generic Software
Default: Generic Software

Version: 1.1
Renderer: Software
Vendor: Creative Labs Inc.
Extensions: EAX EAX2.0 EAX3.0 EAX4.0 EAX5.0 EAX3.0EMULATED EAX4.0EMULATED AL_EXT_OFFSET AL_EXT_LINEAR_DISTANCE AL_EXT_EXPONENT_DISTANCE

ALC Version 1.1
EFX supported. Max aux sends: 2
Channels: 32


Notice the "Renderer: Software" line: this indicates you're using the default software implementation of openAL. For me it says "Renderer: SB X-Fi Audio [0001]".
Title: Re: Engine Sound Stereo Issues
Post by: Napalm Nick on January 11, 2016, 10:14:18 AM
Great report.

Annoyingly in my latest build Gaming PC I left out the old Audigy card using the onboard motherboard 8 channel connectors instead. While I still have that Creative card, and others, I will be unable to find them for a couple of months now (all packed up somewhere in >200 boxes of stuff)

I use speakers as you know, so the worst of the problem (head direction) is not such a problem as I always hear the sound in both ears no matter what.  Spatial awareness is a problem though. Testing with that card fitted would have been really useful.  >:(

If anyone is producing these videos and needs 'the other rider' I'm happy to help.  No point me producing them as without headphones I can't identify the problems easily.
Title: Re: Engine Sound Stereo Issues
Post by: HornetMaX on January 11, 2016, 10:33:34 AM
I don't know if the Audigy will have hardware openGL, but I'm pretty confident it will give you better sound anyway.

Quote from: Napalm Nick on January 11, 2016, 10:14:18 AM
I use speakers as you know, so the worst of the problem (head direction) is not such a problem as I always hear the sound in both ears no matter what.  Spatial awareness is a problem though. Testing with that card fitted would have been really useful.  >:(
You won't get good spatial awareness with 2.1 speakers. Good spatial awareness = headphones. The reason is that HRTF stuff is mostly made for headphones, because:
Title: Re: Engine Sound Stereo Issues
Post by: Napalm Nick on January 11, 2016, 10:59:02 AM
I see what you are saying mine is a Creative 7.1 in a surround setup with real distances set manually in the software so I would hope it is a little better for handling spatial awareness than a 2.1 system (which is basically an open air set of headphones with good bass). Though in GPBikes mine seems to act in a 5.1 environment, so not sure what is happening there (mobo/game/setup)

Damn really want that card fitted now just to try it.  >:(
Title: Re: Engine Sound Stereo Issues
Post by: HornetMaX on January 11, 2016, 11:18:57 AM
Quote from: Napalm Nick on January 11, 2016, 10:59:02 AM
I see what you are saying mine is a Creative 7.1 in a surround setup with real distances set manually in the software so I would hope it is a little better for handling spatial awareness than a 2.1 system (which is basically an open air set of headphones with good bass). Though in GPBikes mine seems to act in a 5.1 environment, so not sure what is happening there (mobo/game/setup)

It depends: if the card has no dedicated openAL implementation (i.e. if it's using the default software one), then the 7.1 is as useless as anything else.
Slam the card in, install the drivers (good luck) and then check the sllog.txt.

Also, there's a million different Audigy cards, which one do you have ?
Title: Re: Engine Sound Stereo Issues
Post by: Napalm Nick on January 11, 2016, 11:34:35 AM
I am unable to find it to confirm a model, I am not opening 200 big boxes. Sod's Law says it will be in the last one I open (hey maybe I should check the last one first? :P). In two months time (maybe) I can dig them out again hehe. Off the top of my head and after googling about it looks like one of those X-fi family you have.
I have other Audigy, SoundBlaster Live! etc lesser cards. But for now they are all hibernating.