About Store Forum Documentation Contact



Post Reply 
Sound problems + crashes
Author Message
Pherael Offline
Member

Post: #1
Sound problems + crashes
From time to time we got crash related to XAudio (as in image below) - also, we got Sound crashes on MacOS. What could be cause? On windows crashes start when directX 9.0 was abadoned, on Mac we starting test builds only few days ago (on Mac it could be also related to Luajit, as we have some issues with it, but I decided to mention it anyway).


Attached File(s) Image(s)
       
(This post was last modified: 10-15-2019 02:27 PM by Pherael.)
10-15-2019 02:24 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #2
RE: Sound problems + crashes
The callstack is confusing,
SpeedSound does not internally call any of xaudio functions.

I'll do some tests though.
10-17-2019 04:28 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #3
RE: Sound problems + crashes
Please open the project in Visual Studio :
https://github.com/Esenthel/EsenthelEngi...er/Project

and use this code:
Code:
/******************************************************************************/
#include "stdafx.h"
/******************************************************************************/
Sound sound[16];
Str paths[]=
{
   "C:/Mega/Assets/Sounds/Weapon/Energy Weapons/Energy Bursts/energyburst_large.flac",
   "C:/Mega/Assets/Sounds/Weapon/Energy Weapons/Energy Bursts/energyburst_med.flac",
   "C:/Mega/Assets/Sounds/Weapon/Energy Weapons/Energy Bursts/energyburst_small.flac",
};
/******************************************************************************/
void InitPre()
{
   DataPath("../Data");
   App.flag=APP_WORK_IN_BACKGROUND|APP_MAXIMIZABLE|APP_BREAKPOINT_ON_ERROR;
}
/******************************************************************************/
bool Init()
{
   return true;
}
/******************************************************************************/
void Shut()
{
}
/******************************************************************************/
bool Update()
{
   if(Kb.bp(KB_ESC))return false;
   Time.wait(Random(1, 32));
   Str s=Random.elm(paths);
   if(Random.b())Random.elm(sound).play(s);
   else          SoundPlay(s);
   Time.speed(Lerp(0.1f, 2.0f, LerpRS(-D.w(), D.w(), Ms.pos().x)));
   return true;
}
/******************************************************************************/
void Draw()
{
   D.clear(TURQ);
   D.text(0, 0.1f, S+"Speed:"+Time.speed());
//D.text(0, 0, S+"Sounds:"+PlayingSounds()+"/"+SoundMaxConcurrent());
}
/******************************************************************************/

Replace the sound paths at the top, to any sounds you have on your disk, run the app, move mouse left/right to change sound speeds, however all works OK on my computer.

Can you provide a repro case with crashes?
10-17-2019 05:00 AM
Find all posts by this user Quote this message in a reply
Pherael Offline
Member

Post: #4
RE: Sound problems + crashes
I can't reproduce it with code above. But the error seems random, also its happen very rarely. I will try to figure it by myself more, and write if I find something more.
(This post was last modified: 10-17-2019 11:37 AM by Pherael.)
10-17-2019 11:24 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #5
RE: Sound problems + crashes
After I've connected a TV over HDMI cable to my laptop, I've started noticing weird crashes/deadlocks with XAudio (the sound gets transported over HDMI to the TV and TV plays sound from my laptop).
After I've updated XAudio 2.7 (win 7) to 2.9 (win 10) the problems disappeared.
So it looks like 2.7 has some issues, but 2.9 requires Win 10 (7 and 8 are not supported).
There is something like "redistributable version of XAudio 2.9" for win 10, 8, 7 - https://docs.microsoft.com/en-us/windows...tributable
However it requires -always- bundling an extra "XAUDIO2_9REDIST.DLL" with the application, which I don't like.
So I'm thinking to drop support for Win7 since Microsoft is abandoning it anyway in January 2020, and just use XAudio 2.9 for which DLL's are automatically bundled in the OS and nothing is needed.
If you really need Win7 you could force engine to use DirectSound instead of XAudio in the "headers.h"
Does that sound ok?
11-17-2019 06:06 AM
Find all posts by this user Quote this message in a reply
Post Reply