Jump to content

Unity engine audio issues when loading assets from HDD


Recommended Posts

In every Unity game I have played so far (including Expeditions: Conquistador and Shadowrun Returns) I experience microstutter and audio crackling when the game loads assets from the Hard Drive in real time.

 

This happens on the campaign map in Expeditions: Conquistador and it happens in LOTS of places in Shadowrun Returns, every time an area is loaded, when my avatar is being generated in the character sheet (for some reason it's not already loaded by design), when opening items in the gameworld and in various parts of dialogue throughout the game.

 

Not everyone is experiencing it but I am, and I have tried 3 sound cards in both games (onboard sound, EMU 0404 and Asus Xonar Essense STX).

 

I am starting to worry I will get the same thing from the rest of the Kickstarter games and if so that's going to be depressing.

 

So I don't know if Obsidian has any access to the source code/sound code for the game, but there seems to be a problem in there that causes the game/audio to pause/stutter during the loading/caching of assets. I could try moving my game(s) to an SSD in the future and that would possibly lessen the issue.

 

If this is an unfixable bug in the source code of Unity 4 then I would like to enquire how levels are loaded for Project Eternity, are all assets loaded and cached upon area transition ?

  • Like 2
Link to comment
Share on other sites

Got a message back from the Shadowrun Returns producer. Apparently the issue is a multi-threaded processing bug with the Unity framework renderer. To fix this issue I have to force single-threaded rendering.

Link to comment
Share on other sites

Thank you for creating a topic on this! I'm experiencing the same issue in Unity Engine games Expeditions: Conquistador and Endless Space, both with my X-Fi Titanium and Realtek onboard sound. It's very much interrupting the seamless feel of a game when sound crackles everytime an asset is loaded...

[edit] I should also mention it's also happening on an SSD-only machine, so it's not only the comparatively slow I/O from an HDD.

 

I could mitigate the issue in Expeditions: Conquistador by playing in windowed mode via ALT+ENTER, but the game switches back to full screen after each load screen.

 

Got a message back from the Shadowrun Returns producer. Apparently the issue is a multi-threaded processing bug with the Unity framework renderer. To fix this issue I have to force single-threaded rendering.

What a great engine and threading model, apparently very state of the art *cough*... :/

 

 

I very seriously hope Obsidian is aware of this and P:E does not fall victim of this annoying and disappointing bug.

Edited by samm

Citizen of a country with a racist, hypocritical majority

Link to comment
Share on other sites

Out of curiosity samm, what CPU do you have ?

FX 8350, which can be considered using a sort of Hyperthreading too (at least by Steam's standards). However, I think I recall getting the same issue with my x6 1090T.

Citizen of a country with a racist, hypocritical majority

Link to comment
Share on other sites

I tried disabling HyperThreading and HPET, didn't do a thing.

 

I'm running Win 7 SP1 64bit

Hitches on both : NVIDIA GTX 560 Ti and AMD HD7970

 

What brand of motherboard do you have? / What southbridge / sata chipsets etc

Link to comment
Share on other sites

Current system, sound problems with Expeditions: Conquistador :

OS: Win 7 SP1 64bit

Sound card: X-Fi Titanium Pro

Graphics card: AMD Radeon HD 7970

Mainboard: Asus Crosshair V Formula Z

Southbridge: AMD SB950

SATA-Chipset: Southbridge, Driver: amd_sata

 

My older system used to run Endless Space with the same sound problems as well:

OS: Win 7 SP1 64bit

Sound card: X-Fi Titanium Pro

Graphics card: ATi Radeon HD 4770

Mainboard: Gigabyte GA-MA790FXT-UD5P

Southbridge: AMD SB750

SATA-Chipset: Southbridge, Driver: amd_sata

 

 

Haven't tried Shadowrun Returns yet, its DRM-free version still waits to be installed until some of the most serious bugs are fixed.

Edited by samm

Citizen of a country with a racist, hypocritical majority

Link to comment
Share on other sites

Me

 

OS: Win 7 64bit SP1

CPU: Intel i7 870 1156

M/B: Gigabyte GA-P55-UD3

Graphics: Asus HD7970 DirectCUII

Sound: Asus Xonar Essense STX

S/B: I think it's a VIA chipset

 

The hitching also happened on my NVIDIA GTX 560Ti but I reckon I'll go install SRR on my server and test it out to check if it's an AMD issue.

Link to comment
Share on other sites

Hm, how can it be an AMD issue if you have the same problems on an system running on Intel + nVidia?

 

[edit]

Regarding your mainboard's southbridge: The Intel P55 chipset basically is the southbridge.

 

 

 

[edit2]

Now that is interesting: http://www.reddit.com/r/KerbalSpaceProgram/comments/1j842u/technical_sound_stuttering_visualized/

Order by date for more thread-like coherence if you're an old-schoold-board-user like me and / or a reddit-noob.

My conclusion: Unity default sound handling is plain unusable, if no special attention is set to these issues, and / or if C# is used in a nonchalant way without treating it more low-level than it somwhat suggests it can be treated (i.e. handle garbage collection carefully, and do not needlessly create and throw away new objects every frame). Some possible solutions (for devs, not us gamers) from that reddit-thingie:

 

 

C++/C# dev here. These look exactly like Garbage Collection pauses. There are ways to properly handle object instatiation and handling, and it has always looked like Squad haven't quite gotten that down just yet.

 

Re-creating objects, especially UI elements, is crazy talk. There's no reason to re-draw everything from scratch all the time, creating objects is one of the most costly things you can do in the realm of programming. The more re-use you can manage, the better off you will be.

I'd imagine this is more with rendering code than any physics code. The physics simulation is likely going to be a pre-compiled system written in an unmanaged language for speed purposes. The rendering spikes can (likely) still be observed when sitting on the pad or up in orbit.

One of the tell-tale signs I've seen is to watch the MET clock. It will flash colors which appear to be the debug system indicating that clock speed has slowed down/is paused while the game code catches up with itself.

 

Some guy has done a frame time analysis based on data from said thread and the following turned out:

 

visualized by frametime/time: http://i.imgur.com/wP2G7D7.png

other frame data from the same Unitiy game visualized by fps/#of frames: http://i.imgur.com/NJltrnJ.png

 

The very slow frames correlate with the sound issues.

Edited by samm
  • Like 1

Citizen of a country with a racist, hypocritical majority

Link to comment
Share on other sites

Nah I meant AMD/ATI as in we both have Radeon HD7970s

 

By the way I have about 1000 of these in my output_log.txt file in the SRR folder

 

 

"(Filename:  Line: 1385)

 

HandleD3DDeviceLost

  HandleD3DDeviceLost: still lost

Skipped rendering frame because GfxDevice is in invalid state (device lost)"

Edited by Sensuki
Link to comment
Share on other sites

  • 2 weeks later...

@Sensuki and @samm

 

I wanted to chime in to tell you both that I don't experience this issue with either EC or SRR. I'm on an i5 2500k and AMD 6900, and the game is installed on a mechanical HDD. Win 7 64, 16 gb ram.

 

Based on the frame trace, is the current hypothesis that periods of low FPS induce the audio hiccups, and those low FPS periods are produced by the Unity 4 engine 'losing' the renderer? For what it's worth, I'm on catalyst 13.2 and using onboard Realtek ALC892 audio, including their sound driver panel, but with all 'features' (i.e. DSP) disabled. I've put over 100 hours combined into EC and SRR, and never had this issue so given the similarity of our systems, I wanted to chime in. I'm on an Asus P8 z68 v-pro (gen1).

 

One thing I wonder about is- how much intel middle ware do you have installed? I.e. the intel chipset driver packages. I usually avoid those like the plague, and find that they introduce all sorts of I/O errors and slow downs on my system. I let windows install the drivers for my chipset (the z68), and avoid the intel bloatware. I've never had a good experience with a single system using that ****.

 

Sensuki, you mentioned having access to a 7XXX ATI card. I'd be curious to know if you have the same audio problems with the 13.2 catalyst drivers, and all DSP effects disabled on your sound card (ideally, let windows manage the sound card and shut down any vendor specific sound panel).

Link to comment
Share on other sites

I have none of the intel bull**** drivers installed.

I haven't tried the 13.2 betas but I've tried 13.4 and the 13.8 beta

 

I also never use any sort of DSP, I use the Hi-Fi setting.

 

I have also done a fresh reinstall of Windows today, and the problem still persists. I believe it is hardware based, tbh. I don't know anyone with an i5 CPU that has the problem.

Edited by Sensuki
Link to comment
Share on other sites

Interesting then that disabling HT for your i7 didn't fix the problem. I wonder what other underlying CPU architecture would cause the sound stuttering.

 

My i5 is an older gen (2500k) than the current i5s. One of the differences is that the older gen has 4 physical cores, no HT. New i5s all have 2 physical, 4 logical (i.e. hyperthreaded). I wonder if people with the current gen i5s have the audio stutter also.

Link to comment
Share on other sites

New i5s all have 2 physical, 4 logical (i.e. hyperthreaded). I wonder if people with the current gen i5s have the audio stutter also.

That's not true, all but one of each Haswell, Ivy Bridge, and Sandy Bridge Desktop i5's don't have hyperthreading, nearly all have 4 cores 4 threads. The three that have 2 cores 4 threads are the "T" 35W TDP low power CPUs.

Edited by AwesomeOcelot
Link to comment
Share on other sites

 

New i5s all have 2 physical, 4 logical (i.e. hyperthreaded). I wonder if people with the current gen i5s have the audio stutter also.

That's not true, all but one of each Haswell, Ivy Bridge, and Sandy Bridge Desktop i5's don't have hyperthreading, nearly all have 4 cores 4 threads. The three that have 2 cores 4 threads are the "T" 35W TDP low power CPUs.

 

Oh ****, you're right. I was on the 'laptops' tab here and didn't even notice it. I'd still like to know if someone with an HT enabled i5 has the same audio problems.

Edited by agris
Link to comment
Share on other sites

Hairbrained Schemes fixed the audio hitching in Shadowrun Returns, the microstutter (where the game 'loses' the renderer) is still there but it no longer affects audio. Still a little annoying but nowhere near AS annoying as before.

Edited by Sensuki
Link to comment
Share on other sites

Now that is good news, because it means Devs can fix some Unity inherent issues :)

As far as SRR is concerned, let me guess - as a customer using the DRM-free version, I would have to download the whole game *again*? ;) Nah, I'll wait until the harddisk-spamming-cache is fixed as well.

Citizen of a country with a racist, hypocritical majority

Link to comment
Share on other sites

@samm if you've setup your system with a ram drive, you can use mklink /J (a junction) to reroute all that cache bull**** onto the drive. Will be faster, and auto clears everytime you reboot your system. Works like a charm, no disk fragmentation, and SRR doesn't know the difference.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...