x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Audio stops playing randomly

Ok,

So I'm trying to play background music, some SFX and some voice sound for AI. I'm on my custom project and didn't try reproducing the scene on a blank template as I'm half way through my game setup. Reproducing will need a lot of time.

Now, Here are a video links for the problem,

1st Trial video

2nd Trial video

I have 2 sound cues for AI voice sound and bush rattling (sound cues only have few soundwaves and a random node) and 2 soundwaves for music, all of these having default settings except the sound class property is set to relevant class. Here are the settings of the audio files.

alt text alt text alt text

NOTE : I use 2 audio component to switch the background sounds and for SFX and Voice sound, I used dedicated audio components for characters and bush actors

If need any more info for debugging lemme know. I'm I missing something or its jus a bug ?

Please help !! its wasting lot of time ... :(

Product Version: UE 4.14
Tags:
more ▼

asked Dec 11 '16 at 07:30 AM in Using UE4

avatar image

XADIFY
40 9 10 15

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

Hey guys, we recently found the bug in one of our internal projects.

It was introduced when we supported pausing individual sounds in addition to pausing the entire game. The cause of the bug is because sound sources objects are recycled and state needs to be cleared before reuse. Sound sources from a previous life which were paused are causing future sound sources to behave as if they're paused.

The fix is simple, I'm trying to see if I can get approval for a hotfix, but in the meantime, if you need a quick patch, add the following code in AudioDevice.cpp (line 2911) after successfully initializing a sound source.

 if (Source->IsPreparedToInit())
 {
     // Init the source, this may result in failure
     bSuccess = Source->Init(WaveInstance);
         
     // If we succeeded then play and update the source
     if (bSuccess)
     {
         // PATCH BEGIN....
         // Clear pause state
         Source->bIsManuallyPaused = false;
         Source->bIsPausedByGame = false;
         // PATCH END...
 
         // Set the pause before updating it
         Source->SetPauseManually(Source->WaveInstance->bIsPaused);

In 4.15 we have a CommonInit function for sound sources which is called inside Init on all platforms so this will look a little different in 4.15+.

more ▼

answered Dec 12 '16 at 07:16 PM

avatar image

Minus_Kelvin STAFF
917 23 4 31

avatar image XADIFY Dec 13 '16 at 04:02 AM

NOOB QUESTION !! I haven't explore the C++ side much yet.

How do I patch if i'm using launcher version ? do I have to download git version and make changes ? will I be able to upgrade the engine if needed ? will it affect my BP project in anyways ?

I've read documentation but there is no reference for editing launcher version engine.

avatar image Minus_Kelvin STAFF Dec 13 '16 at 06:31 PM

Yes, you'll have to get the source, add the code above, rebuild the engine. It's easy to do, but you need the source. Will work exactly like launcher version once your build.

EDIT: This is a bit old now, but I think the process is pretty much the same. https://www.youtube.com/watch?v=usjlNHPn-jo

EDIT2: Note that I submitted this fix as a patch for 4.14.2 so if you sit tight, might just come down automatically for you.

avatar image XADIFY Dec 17 '16 at 02:44 PM

Hi there !

I tested the engine by editing the source code as mentioned above. I launched my project and as I restarted the game as shown in the video, the background music didn't show up. Also the stat sounds -debug stops working randomly. Only works when used with other debug commands. I used 'stat soundwaves'.

EDIT : The root of problem is definitely related to some kind of pausing and audio component. I noticed one thing that when I hit the AIs, sometimes they don't make sound but after hitting them and if I pause and resume the game, the sound plays immediately. Background music still doesn't work after resuming as above. Another thing is if I spawn the sound actor instead of placing it in level in first place, the everything works fine (at least for now).

I'll be using the GitHub version of the engine and will be updating the code from there. it will be easier for me to make changes to engine code if such bugs appear.

Hope to get fixes soon ... Love u guys !! :D

avatar image Minus_Kelvin STAFF Dec 17 '16 at 09:43 PM

Are you sure you rebuilt the engine with the change and are using the version of your built source? Have you stepped into the source with a breakpoint in AudioDevice.cpp to confirm your build is running with the fix? Sounds like you're not running with the fix and I'm 99% sure the issue is fixed with that change.

avatar image XADIFY Dec 18 '16 at 07:12 AM

alt text

Here you go !! I'm 1000% sure I'm running the patched version :D and have built the code several times.

I haven't updated the engine from launcher but got 4.14.1 from GitHub. if need any more info we could skype if there is time or maybe Email or something to avoid time-zone problems. I'll be gathering more info about it parallel. For now spawning the sound actor works for me but as its a major bug, I would like to help fix it as much as I can.

avatar image Minus_Kelvin STAFF Dec 18 '16 at 07:08 PM

If you're still seeing issues after running with that code, then this is a totally new problem I've not heard about -- I'll have to get my audio QA to help track down a repro from this thread.

avatar image XADIFY Dec 19 '16 at 05:58 AM

Sure, Please let me know if any more info needed as I find this issue very rare.

avatar image eudrea Dec 19 '16 at 05:28 PM

One thing I want to add is that we are not pausing individual sounds anywhere in the game, the sound sources will be paused only if the engine pauses them (this might happen only if when we pause the engine, the sound sources are paused individually or something related to that).

I want to reiterate that this is very important for us as well since we actually postponing a release until the sound issue is fixed and we are stuck with tons of changes in 4.14 which we cannot easily transfer to a lower version.

avatar image Maverick Wolf Dec 21 '16 at 06:15 PM

You may want to check out my sound issue. https://answers.unrealengine.com/questions/539666/concurrency-broken-in-414.html Mine feels more like if alot of spamming sounds have played or are playing that the sounds break. As this not only happens when paused but in the normal game itself. My repro case does include pausing however. But the issue I found is because so many sounds are playing, it tries to play the sound, even giving it a volume of 1.3 (as designed). But isn't actually audible.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Hey all,

I recently entered and verified a bug that seems very related to this issue. You will need to wait until the hotfix is released, but you can view the ticket entered by following the link below.

UE-39650

Let me know if you have further questions.

Thanks,

Andrew Hurley

more ▼

answered Dec 19 '16 at 02:53 PM

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

This happens to us as well after updating to 4.14. https://answers.unrealengine.com/questions/530859/updating-to-414-completely-screws-the-audio.html

One thing we noticed is that the sounds that were stopped after loading a map will start play after we resume the game. We use UGameplayStatics::SetGamePaused to pause/resume the game.

From what we know there is no special case where the sounds get heard, the same sound (we are shooting weapons in an FPS game and one weapon uses the same shooting sound) sometimes plays, sometimes it doesn't. However, it happens to us with a lot of other sounds, no necessarily sounds you shoot fast or with a certain setup.

Let us know if you find out anything else.

more ▼

answered Dec 12 '16 at 06:59 AM

avatar image

eudrea
76 3 8 12

avatar image XADIFY Dec 12 '16 at 07:18 AM

I have to roll back to my previous copy of 4.14 version game where things were fine.

1 thing to note is that in my previous version I used to pause the level when it begins and then used a button to resume the level. The catch here is maybe due to that pause and wait for user input thingy, the engine gets time for executing the functions which are hooked to begin play. When I ran level directly, camera blend didn't work on begin play. had to ad a 0.1 second delay to get it working. Without that pause sometimes the blueprint functions jus won't execute even when hooked and enabled breakpoint. The execution jus stops in between. in my case mostly for camera blend and set sound for audio component.

I used to execute level initialization in HUD and widget UI but thought sometimes engine gets messed up due to all BP so shifted the code to level BP. Things went well for a while then got messed up again !

UE4 isn't that mature for mobile platform compare to unity like not UI particles, no dynamic shadows for ES2 (modulated shadows are inaccurate, cascaded are too heavy) ... but I love this engine. Hope to find solution soon !

avatar image eudrea Dec 12 '16 at 07:47 AM

Sadly, we can't really roll back, we have too many changes now to get back to a lower version. There were issues which stopped us updating in 4.13, we came from 4.12.5 directly to 4.14, however, this sound issue seems not to be too widely spread, otherwise we would see more threads here complaining about it and perhaps Unreal guys saying something about it. There were (I would say 'major') changes to the sounds in 4.14 in relation to older versions (if you look for "New: Added a debug command to solo specific sound waves, sound cues, and sound classes" in https://www.unrealengine.com/blog/unreal-engine-4-14-released ) and one of them it seems relates to the sound running on a separate thread by default in this release (which might mean some kind of synchronizing needs to gets done by default to have the sounds playing normally which might have something to do to why some of the sounds we start when the level loads are not actually playing or they are paused or not starting correctly). Anyway, we haven't had the time to actually test to see exactly what is going on (if we could, might not be able to tell if we don't start debugging the code).

avatar image XADIFY Dec 12 '16 at 07:58 AM

Yeah that's a big pain to upgrade engine specially when using C++. Unless we figure out a way to reproduce it unreal guys can't really do anything. I tried on a blank project and works ok. The sound changes are majorly for lip syncing maybe

BTW the sound debug commands are messy too. the 'stat sounds -debug' actually shows sound attenuation radius but it doesn't most of the time and sometimes it jus disappears. Reentering the command doesn't help.

Hope your problem gets resolved soon. To avoid wasting time I have to reproduce my code again in previous version. Still would try to figure out a solution for this.

avatar image eudrea Dec 12 '16 at 08:08 AM

I'm certain it doesn't happen in 4.12.5. We've been with that version for a while and was fine, certainly appears when we moved up from that version.

I just tested with the sound not running in its own thread, edited BaseEditor.ini

[Audio] MaxChannels=32 CommonAudioPoolSize=0 UnfocusedVolumeMultiplier=0.0 UseAudioThread=false EnableAudioMixer=false

and it does the same, so its not related to that. Not sure if this ini edit actually matter when we run in editor but it seems it has no impact on the error if it does.

avatar image XADIFY Dec 12 '16 at 01:17 PM

I'm not sure about the ini edits but 4.13 and 4.14 were the big updates in terms of physics, audio and rendering. I read somewhere to delete .ini files and restart the project. But it messed up my project entirely :P all my custom collisions and other settings POOF GONE jus like that ! :D

avatar image eudrea Dec 12 '16 at 01:28 PM

The .ini files contain custom collision profiles and all project settings :) Sorry about that.

avatar image XADIFY Dec 12 '16 at 01:56 PM

can u tell me what problems u had with 4.13 ? my previous version of 4.14 is messed up too !! what a PIA ... I updated to 4.13 for physical animation as my game is based on ragdoll and 4.14 for rendering stuff and vulkan support

mayb PM me on forums thread is getting quiet big

avatar image eudrea Dec 12 '16 at 02:00 PM

I'll be short. As far as we've got with the tests, 4.13 had changed the way MoveToLocation functioned (which probably was for the better but our AI code didn't work correctly with it at the time. I'm not 100% that was the only issue with the AI in that version, some of the behaviors we seen might've been from somewhere else) and the main UI wasn't showing. We haven't got as far as testing the sound with that version since there were other bigger issues (not showing the UI was the main problem and we didn't had the time to test it further) so I can't tell if that was an older 4.14 problem or not.

avatar image XADIFY Dec 12 '16 at 02:28 PM

ohhh yeah I remember ... EQS get all actors was bugged out too !! or mayb in 4.12 .... huhhh if such things persist, i'll be forced to opt Unity ! as a solo dev I can't waste time in such things. :(

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question