mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-09-16 00:05:05 +00:00
93318ef697
- [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- So, upon investigating AC3 not booting when fw 20+ and overlay applet disabled, i found the leads: "LibAppletOff" and "AudioTvOutput". By further decoding instructions i've found a guest assert comparing device volume with hdmi volume. Since we implemented no proper master volume when no streams are created the assert were failing causing guest to panic (why?????????) Anyway. ac3 now works fw20+ and no overlay applet.. Maybe other games too. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4416 Reviewed-by: lizzie <lizzie@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
67 lines
1.8 KiB
C++
67 lines
1.8 KiB
C++
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
#include <string_view>
|
|
#include <vector>
|
|
|
|
#include "audio_core/sink/sink.h"
|
|
#include "audio_core/sink/sink_stream.h"
|
|
|
|
namespace Core {
|
|
class System;
|
|
} // namespace Core
|
|
|
|
namespace AudioCore::Sink {
|
|
class NullSinkStreamImpl final : public SinkStream {
|
|
public:
|
|
explicit NullSinkStreamImpl(Core::System& system_, StreamType type_)
|
|
: SinkStream{system_, type_} {}
|
|
~NullSinkStreamImpl() override {}
|
|
void AppendBuffer(SinkBuffer&, std::span<s16>) override {}
|
|
std::vector<s16> ReleaseBuffer(u64) override {
|
|
return {};
|
|
}
|
|
};
|
|
|
|
/**
|
|
* A no-op sink for when no audio out is wanted.
|
|
*/
|
|
class NullSink final : public Sink {
|
|
public:
|
|
explicit NullSink(std::string_view) {}
|
|
~NullSink() override = default;
|
|
|
|
SinkStream* AcquireSinkStream(Core::System& system, u32, const std::string&,
|
|
StreamType type) override {
|
|
if (null_sink == nullptr) {
|
|
null_sink = std::make_unique<NullSinkStreamImpl>(system, type);
|
|
null_sink->SetDeviceVolume(device_volume);
|
|
}
|
|
return null_sink.get();
|
|
}
|
|
|
|
void CloseStream(SinkStream*) override {}
|
|
void CloseStreams() override {}
|
|
f32 GetDeviceVolume() const override {
|
|
return device_volume;
|
|
}
|
|
void SetDeviceVolume(f32 volume) override {
|
|
device_volume = volume;
|
|
if (null_sink != nullptr) {
|
|
null_sink->SetDeviceVolume(volume);
|
|
}
|
|
}
|
|
void SetSystemVolume(f32 volume) override {}
|
|
|
|
private:
|
|
SinkStreamPtr null_sink{};
|
|
};
|
|
|
|
} // namespace AudioCore::Sink
|