[APU] Add ALSA apu on Linux

This commit is contained in:
Herman S.
2025-09-27 18:38:27 +09:00
parent 48c13be2d5
commit fade0cd889
9 changed files with 929 additions and 6 deletions

View File

@@ -0,0 +1,43 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2025. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_APU_ALSA_ALSA_AUDIO_SYSTEM_H_
#define XENIA_APU_ALSA_ALSA_AUDIO_SYSTEM_H_
#include "xenia/apu/audio_system.h"
namespace xe {
namespace apu {
namespace alsa {
class ALSAAudioSystem : public AudioSystem {
public:
explicit ALSAAudioSystem(cpu::Processor* processor);
~ALSAAudioSystem() override;
static bool IsAvailable();
static std::unique_ptr<AudioSystem> Create(cpu::Processor* processor);
X_RESULT CreateDriver(size_t index, xe::threading::Semaphore* semaphore,
AudioDriver** out_driver) override;
AudioDriver* CreateDriver(xe::threading::Semaphore* semaphore,
uint32_t frequency, uint32_t channels,
bool need_format_conversion) override;
void DestroyDriver(AudioDriver* driver) override;
protected:
void Initialize() override;
};
} // namespace alsa
} // namespace apu
} // namespace xe
#endif // XENIA_APU_ALSA_ALSA_AUDIO_SYSTEM_H_