diff --git a/rpcs3/Emu/Audio/AL/OpenALThread.cpp b/rpcs3/Emu/Audio/AL/OpenALThread.cpp index 38e1be699e..14fcd2dc5e 100644 --- a/rpcs3/Emu/Audio/AL/OpenALThread.cpp +++ b/rpcs3/Emu/Audio/AL/OpenALThread.cpp @@ -100,7 +100,7 @@ void OpenALThread::Open(const void* src, int size) for (uint i = 0; i lock(m_cs_main); @@ -2402,7 +2399,7 @@ void RSXThread::Task() m_sem_flush.post_and_wait(); } - std::this_thread::sleep_for (std::chrono::milliseconds(1)); // hack + std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack continue; } @@ -2469,24 +2466,17 @@ void RSXThread::Task() value += (count + 1) * 4; }); } - catch (const std::string& e) { LOG_ERROR(RSX, "Exception: %s", e.c_str()); Emu.Pause(); } - catch (const char* e) { LOG_ERROR(RSX, "Exception: %s", e); Emu.Pause(); } - while (!is_vblank_stopped) - { - std::this_thread::sleep_for (std::chrono::milliseconds(1)); // hack - } - LOG_NOTICE(RSX, "RSX thread ended"); OnExitThread(); diff --git a/rpcs3/Emu/SysCalls/Modules/cellAudio.cpp b/rpcs3/Emu/SysCalls/Modules/cellAudio.cpp index d7e24e4bae..7f84d1ec2f 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellAudio.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellAudio.cpp @@ -54,7 +54,7 @@ s32 cellAudioInit() const bool do_dump = Ini.AudioDumpToFile.GetValue(); AudioDumper m_dump; - if (do_dump && !m_dump.Init(8)) // Init AudioDumper for 8 channels + if (do_dump && !m_dump.Init(2)) // Init AudioDumper for 2 channels { throw "AudioDumper::Init() failed"; } @@ -62,13 +62,13 @@ s32 cellAudioInit() float buf2ch[2 * BUFFER_SIZE]; // intermediate buffer for 2 channels float buf8ch[8 * BUFFER_SIZE]; // intermediate buffer for 8 channels - static const size_t out_buffer_size = 2 * BUFFER_SIZE; + static const size_t out_buffer_size = 8 * BUFFER_SIZE; // output buffer for 8 channels std::unique_ptr out_buffer[BUFFER_NUM]; for (u32 i = 0; i < BUFFER_NUM; i++) { - out_buffer[i].reset(new float[2 * BUFFER_SIZE] {}); + out_buffer[i].reset(new float[out_buffer_size] {}); } squeue_t out_queue; @@ -347,9 +347,16 @@ s32 cellAudioInit() if (!first_mix) { - for (u32 i = 0; i < (sizeof(buf2ch) / sizeof(float)); i++) + // copy output data (2 ch) + //for (u32 i = 0; i < (sizeof(buf2ch) / sizeof(float)); i++) + //{ + // out_buffer[out_pos][i] = buf2ch[i]; + //} + + // copy output data (8 ch) + for (u32 i = 0; i < (sizeof(buf8ch) / sizeof(float)); i++) { - out_buffer[out_pos][i] = buf2ch[i]; + out_buffer[out_pos][i] = buf8ch[i]; } } @@ -399,16 +406,16 @@ s32 cellAudioInit() { if (m_dump.GetCh() == 8) { - if (m_dump.WriteData(&buf8ch, sizeof(buf8ch)) != sizeof(buf8ch)) // write file data + if (m_dump.WriteData(&buf8ch, sizeof(buf8ch)) != sizeof(buf8ch)) // write file data (8 ch) { - throw "AudioDumper::WriteData() failed (2 ch)"; + throw "AudioDumper::WriteData() failed (8 ch)"; } } else if (m_dump.GetCh() == 2) { - if (m_dump.WriteData(&buf2ch, sizeof(buf2ch)) != sizeof(buf2ch)) // write file data + if (m_dump.WriteData(&buf2ch, sizeof(buf2ch)) != sizeof(buf2ch)) // write file data (2 ch) { - throw "AudioDumper::WriteData() failed (8 ch)"; + throw "AudioDumper::WriteData() failed (2 ch)"; } } else diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp index 8ad6d0c650..33059ed1aa 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp @@ -390,7 +390,7 @@ int cellAudioOutGetSoundAvailability(u32 audioOut, u32 type, u32 fs, u32 option) option = 0; - int available = 2; // should be at least 2 + int available = 8; // should be at least 2 switch(fs) { @@ -431,7 +431,7 @@ int cellAudioOutGetSoundAvailability2(u32 audioOut, u32 type, u32 fs, u32 ch, u3 option = 0; - int available = 2; // should be at least 2 + int available = 8; // should be at least 2 switch(fs) { @@ -578,9 +578,9 @@ int cellAudioOutGetDeviceInfo(u32 audioOut, u32 deviceIndex, vm::ptrstate = CELL_AUDIO_OUT_DEVICE_STATE_AVAILABLE; info->latency = 1000; info->availableModes[0].type = CELL_AUDIO_IN_CODING_TYPE_LPCM; - info->availableModes[0].channel = CELL_AUDIO_OUT_CHNUM_2; + info->availableModes[0].channel = CELL_AUDIO_OUT_CHNUM_8; info->availableModes[0].fs = CELL_AUDIO_OUT_FS_48KHZ; - info->availableModes[0].layout = CELL_AUDIO_OUT_SPEAKER_LAYOUT_2CH; + info->availableModes[0].layout = CELL_AUDIO_OUT_SPEAKER_LAYOUT_8CH_LREClrxy; return CELL_AUDIO_OUT_SUCCEEDED; } diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 8696a631d0..9944a5860f 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -354,17 +354,13 @@ void Emulator::Stop() SendDbgCommand(DID_STOP_EMU); m_status = Stopped; - u32 uncounted = 0; - while (true) + while (g_thread_count) { - if (g_thread_count <= uncounted) - { - LOG_NOTICE(HLE, "All threads stopped..."); - break; - } std::this_thread::sleep_for(std::chrono::milliseconds(1)); } + LOG_NOTICE(HLE, "All threads stopped..."); + m_rsx_callback = 0; // TODO: check finalization order