Compare commits

...

2 Commits

Author SHA1 Message Date
Elad f6ea921e0d Merge branch 'master' into hot-cake 2026-06-07 19:19:33 +03:00
Elad ba9464c547 cellAudio: Fix _mxr000 event queue hack 2026-06-07 17:57:40 +03:00
+24 -24
View File
@@ -1666,32 +1666,31 @@ error_code AudioSetNotifyEventQueue(ppu_thread& ppu, u64 key, u32 iFlags)
if (key == c_mxr000 || key == 0) if (key == c_mxr000 || key == 0)
{ {
bool has_sur_mixer_thread = false; const bool has_sur_mixer_thread = idm::select<named_thread<ppu_thread>>([&](u32 id, named_thread<ppu_thread>& test_ppu)
for (usz count = 0; !lv2_event_queue::find(c_mxr000) && count < 100; count++)
{ {
if (has_sur_mixer_thread || idm::select<named_thread<ppu_thread>>([&](u32 id, named_thread<ppu_thread>& test_ppu) // Confirm thread existence
if (id == ppu.id)
{ {
// Confirm thread existence return false;
if (id == ppu.id)
{
return false;
}
const auto ptr = test_ppu.ppu_tname.load();
if (!ptr)
{
return false;
}
return *ptr == "_cellsurMixerMain"sv;
}).ret)
{
has_sur_mixer_thread = true;
} }
else
const auto ptr = test_ppu.ppu_tname.load();
if (!ptr)
{ {
return false;
}
return *ptr == "_cellsurMixerMain"sv;
}).ret;
bool was_mxr000_queue_found = false;
for (usz count = 0; has_sur_mixer_thread && count < 100; count++)
{
if (lv2_event_queue::find(c_mxr000))
{
was_mxr000_queue_found = true;
break; break;
} }
@@ -1701,13 +1700,14 @@ error_code AudioSetNotifyEventQueue(ppu_thread& ppu, u64 key, u32 iFlags)
return {}; return {};
} }
cellAudio.error("AudioSetNotifyEventQueue(): Waiting for _mxr000. x%d", count); (count < 3 ? cellAudio.warning : cellAudio.error)("AudioSetNotifyEventQueue(): Waiting for _mxr000. x%d", count);
lv2_sleep(50'000, &ppu); lv2_sleep(50'000, &ppu);
} }
if (has_sur_mixer_thread && lv2_event_queue::find(c_mxr000)) if (key == 0 && was_mxr000_queue_found)
{ {
// Correct key value argument
key = c_mxr000; key = c_mxr000;
} }
} }