audio_core/hle: Stub binary requests SaveState and LoadState. (#6684)
* audio_core/hle: Stub binary requests SaveState and LoadState. * audio_core/hle: Fire DSP binary pipe interrupt on request completion instead of tick.
This commit is contained in:
parent
9cb14044ec
commit
700c00f021
8 changed files with 40 additions and 9 deletions
|
@ -85,7 +85,11 @@ std::optional<BinaryMessage> AudioToolboxDecoder::Impl::ProcessRequest(
|
||||||
case DecoderCommand::EncodeDecode: {
|
case DecoderCommand::EncodeDecode: {
|
||||||
return Decode(request);
|
return Decode(request);
|
||||||
}
|
}
|
||||||
case DecoderCommand::Unknown: {
|
case DecoderCommand::Shutdown:
|
||||||
|
case DecoderCommand::SaveState:
|
||||||
|
case DecoderCommand::LoadState: {
|
||||||
|
LOG_WARNING(Audio_DSP, "Got unimplemented binary request: {}",
|
||||||
|
static_cast<u16>(request.header.cmd));
|
||||||
BinaryMessage response = request;
|
BinaryMessage response = request;
|
||||||
response.header.result = ResultStatus::Success;
|
response.header.result = ResultStatus::Success;
|
||||||
return response;
|
return response;
|
||||||
|
|
|
@ -42,7 +42,9 @@ std::optional<BinaryMessage> NullDecoder::ProcessRequest(const BinaryMessage& re
|
||||||
BinaryMessage response{};
|
BinaryMessage response{};
|
||||||
switch (request.header.cmd) {
|
switch (request.header.cmd) {
|
||||||
case DecoderCommand::Init:
|
case DecoderCommand::Init:
|
||||||
case DecoderCommand::Unknown:
|
case DecoderCommand::Shutdown:
|
||||||
|
case DecoderCommand::SaveState:
|
||||||
|
case DecoderCommand::LoadState:
|
||||||
response = request;
|
response = request;
|
||||||
response.header.result = ResultStatus::Success;
|
response.header.result = ResultStatus::Success;
|
||||||
return response;
|
return response;
|
||||||
|
|
|
@ -14,9 +14,16 @@
|
||||||
namespace AudioCore::HLE {
|
namespace AudioCore::HLE {
|
||||||
|
|
||||||
enum class DecoderCommand : u16 {
|
enum class DecoderCommand : u16 {
|
||||||
|
/// Initializes the decoder.
|
||||||
Init = 0,
|
Init = 0,
|
||||||
|
/// Decodes/encodes a data frame.
|
||||||
EncodeDecode = 1,
|
EncodeDecode = 1,
|
||||||
Unknown = 2, // Probably UnInit
|
/// Shuts down the decoder.
|
||||||
|
Shutdown = 2,
|
||||||
|
/// Loads the saved decoder state. Used for DSP wake.
|
||||||
|
LoadState = 3,
|
||||||
|
/// Saves the decoder state. Used for DSP sleep.
|
||||||
|
SaveState = 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class DecoderCodec : u16 {
|
enum class DecoderCodec : u16 {
|
||||||
|
|
|
@ -111,7 +111,11 @@ std::optional<BinaryMessage> FDKDecoder::Impl::ProcessRequest(const BinaryMessag
|
||||||
case DecoderCommand::EncodeDecode: {
|
case DecoderCommand::EncodeDecode: {
|
||||||
return Decode(request);
|
return Decode(request);
|
||||||
}
|
}
|
||||||
case DecoderCommand::Unknown: {
|
case DecoderCommand::Shutdown:
|
||||||
|
case DecoderCommand::SaveState:
|
||||||
|
case DecoderCommand::LoadState: {
|
||||||
|
LOG_WARNING(Audio_DSP, "Got unimplemented binary request: {}",
|
||||||
|
static_cast<u16>(request.header.cmd));
|
||||||
BinaryMessage response = request;
|
BinaryMessage response = request;
|
||||||
response.header.result = ResultStatus::Success;
|
response.header.result = ResultStatus::Success;
|
||||||
return response;
|
return response;
|
||||||
|
|
|
@ -80,7 +80,11 @@ std::optional<BinaryMessage> FFMPEGDecoder::Impl::ProcessRequest(const BinaryMes
|
||||||
case DecoderCommand::EncodeDecode: {
|
case DecoderCommand::EncodeDecode: {
|
||||||
return Decode(request);
|
return Decode(request);
|
||||||
}
|
}
|
||||||
case DecoderCommand::Unknown: {
|
case DecoderCommand::Shutdown:
|
||||||
|
case DecoderCommand::SaveState:
|
||||||
|
case DecoderCommand::LoadState: {
|
||||||
|
LOG_WARNING(Audio_DSP, "Got unimplemented binary request: {}",
|
||||||
|
static_cast<u16>(request.header.cmd));
|
||||||
BinaryMessage response = request;
|
BinaryMessage response = request;
|
||||||
response.header.result = ResultStatus::Success;
|
response.header.result = ResultStatus::Success;
|
||||||
return response;
|
return response;
|
||||||
|
|
|
@ -319,6 +319,10 @@ void DspHle::Impl::PipeWrite(DspPipe pipe_number, std::span<const u8> buffer) {
|
||||||
pipe_data[static_cast<u32>(pipe_number)].resize(sizeof(value));
|
pipe_data[static_cast<u32>(pipe_number)].resize(sizeof(value));
|
||||||
std::memcpy(pipe_data[static_cast<u32>(pipe_number)].data(), &value, sizeof(value));
|
std::memcpy(pipe_data[static_cast<u32>(pipe_number)].data(), &value, sizeof(value));
|
||||||
}
|
}
|
||||||
|
auto dsp = dsp_dsp.lock();
|
||||||
|
if (dsp) {
|
||||||
|
dsp->SignalInterrupt(InterruptType::Pipe, DspPipe::Binary);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -461,8 +465,6 @@ void DspHle::Impl::AudioTickCallback(s64 cycles_late) {
|
||||||
// TODO(merry): Signal all the other interrupts as appropriate.
|
// TODO(merry): Signal all the other interrupts as appropriate.
|
||||||
if (auto service = dsp_dsp.lock()) {
|
if (auto service = dsp_dsp.lock()) {
|
||||||
service->SignalInterrupt(InterruptType::Pipe, DspPipe::Audio);
|
service->SignalInterrupt(InterruptType::Pipe, DspPipe::Audio);
|
||||||
// HACK(merry): Added to prevent regressions. Will remove soon.
|
|
||||||
service->SignalInterrupt(InterruptType::Pipe, DspPipe::Binary);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,11 @@ std::optional<BinaryMessage> MediaNDKDecoder::Impl::ProcessRequest(const BinaryM
|
||||||
case DecoderCommand::EncodeDecode: {
|
case DecoderCommand::EncodeDecode: {
|
||||||
return Decode(request);
|
return Decode(request);
|
||||||
}
|
}
|
||||||
case DecoderCommand::Unknown: {
|
case DecoderCommand::Shutdown:
|
||||||
|
case DecoderCommand::SaveState:
|
||||||
|
case DecoderCommand::LoadState: {
|
||||||
|
LOG_WARNING(Audio_DSP, "Got unimplemented binary request: {}",
|
||||||
|
static_cast<u16>(request.header.cmd));
|
||||||
BinaryMessage response = request;
|
BinaryMessage response = request;
|
||||||
response.header.result = ResultStatus::Success;
|
response.header.result = ResultStatus::Success;
|
||||||
return response;
|
return response;
|
||||||
|
|
|
@ -115,7 +115,11 @@ std::optional<BinaryMessage> WMFDecoder::Impl::ProcessRequest(const BinaryMessag
|
||||||
case DecoderCommand::EncodeDecode: {
|
case DecoderCommand::EncodeDecode: {
|
||||||
return Decode(request);
|
return Decode(request);
|
||||||
}
|
}
|
||||||
case DecoderCommand::Unknown: {
|
case DecoderCommand::Shutdown:
|
||||||
|
case DecoderCommand::SaveState:
|
||||||
|
case DecoderCommand::LoadState: {
|
||||||
|
LOG_WARNING(Audio_DSP, "Got unimplemented binary request: {}",
|
||||||
|
static_cast<u16>(request.header.cmd));
|
||||||
BinaryMessage response = request;
|
BinaryMessage response = request;
|
||||||
response.header.result = ResultStatus::Success;
|
response.header.result = ResultStatus::Success;
|
||||||
return response;
|
return response;
|
||||||
|
|
Loading…
Reference in a new issue