detect audio driver latency issues

This commit is contained in:
13xforever 2019-05-10 22:30:43 +05:00
parent 5e3e81070d
commit 85c7775d12
4 changed files with 21 additions and 0 deletions

View File

@ -175,6 +175,7 @@ namespace CompatBot.EventHandlers.LogParsing
["PS3 firmware is not installed"] = new Regex(@"(?<fw_missing_msg>PS3 firmware is not installed.+)\r?$", DefaultOptions),
["do you have the PS3 firmware installed"] = new Regex(@"(?<fw_missing_something>do you have the PS3 firmware installed.*)\r?$", DefaultOptions),
["Unimplemented syscall"] = new Regex(@"U \d+:\d+:\d+\.\d+ ({(?<fatal_error_context>.+?)} )?.*(?<fatal_error>Unimplemented syscall syscall_\d+ .*)\r?$", DefaultOptions),
["Could not enqueue"] = new Regex(@"cellAudio: Could not enqueue buffer onto audio backend(?<enqueue_buffer_error>.).*\r?$", DefaultOptions),
},
OnNewLineAsync = LimitedPiracyCheckAsync,
OnSectionEnd = MarkAsCompleteAndReset,
@ -199,6 +200,8 @@ namespace CompatBot.EventHandlers.LogParsing
"failed_to_verify",
};
public static readonly string[] CountValueItems = {"enqueue_buffer_error"};
private static async Task PiracyCheckAsync(string line, LogParseState state)
{
if (await PiracyStringProvider.FindTriggerAsync(line).ConfigureAwait(false) is string match)

View File

@ -65,6 +65,7 @@ namespace CompatBot.EventHandlers.LogParsing
var strValue = group.Value.ToUtf8();
Config.Log.Debug($"regex {group.Name} = {group.Value}");
lock(state)
{
if (MultiValueItems.Contains(group.Name))
{
var currentValue = state.WipCollection[group.Name];
@ -74,6 +75,12 @@ namespace CompatBot.EventHandlers.LogParsing
}
else
state.WipCollection[group.Name] = strValue;
if (CountValueItems.Contains(group.Name))
{
state.ValueHitStats.TryGetValue(group.Name, out var hits);
state.ValueHitStats[group.Name] = ++hits;
}
}
}
}

View File

@ -8,6 +8,7 @@ namespace CompatBot.EventHandlers.LogParsing.POCOs
{
public NameValueCollection CompleteCollection = null;
public NameValueCollection WipCollection = new NameValueCollection();
public Dictionary<string, int> ValueHitStats = new Dictionary<string, int>();
public int Id = 0;
public ErrorCode Error = ErrorCode.None;
public string PiracyTrigger;

View File

@ -208,6 +208,16 @@ namespace CompatBot.Utils.ResultFormatters
notes.Add("❌ Shader compilation error on unsupported GPU");
}
if (!string.IsNullOrEmpty(items["enqueue_buffer_error"])
&& state.ValueHitStats.TryGetValue("enqueue_buffer_error", out var enqueueBufferErrorCount)
&& enqueueBufferErrorCount > 100)
{
if (items["os_type"] == "Windows")
notes.Add("⚠ Audio backend issues detected; it could be caused by a bad driver or 3rd party software");
else
notes.Add("⚠ Audio backend issues detected; check for high audio driver/sink latency");
}
var ppuPatches = GetPatches(items["ppu_hash"], items["ppu_hash_patch"]);
var ovlPatches = GetPatches(items["ovl_hash"], items["ovl_hash_patch"]);
var spuPatches = GetPatches(items["spu_hash"], items["spu_hash_patch"]);