27#include <alsa/asoundlib.h>
42 int Setup(
int,
int,
bool,
int);
43 int Write(
const void *,
int);
snd_mixer_elem_t * m_pMixerElem
alsa mixer element
double FramesToMsDouble(int frames)
void SetPassthroughMask(int mask)
bool m_appendAES
flag to automatic append AES
const char * m_pMixerChannel
mixer channel name
snd_pcm_uframes_t m_bufferSizeFrames
alsa buffer size in frames
int GetBufferSizeFrames(void)
size_t FramesToBytes(int frames)
void InitMixer(void)
Initialize the ALSA mixer.
int GetPassthroughMask(void) const
void SetAutoAES(bool appendAes)
bool ShouldAppendAES(void)
int GetHwSampleRate(void)
int m_passthroughMask
passthrough mask
int GetHwNumChannels(void)
bool HandleError(int)
Handle an alsa error.
int64_t FramesToPts(int frames, double timebase)
unsigned int m_hwSampleRate
hardware sample rate in Hz
int m_ratio
internal -> mixer ratio * 1000
const char * m_pPCMDevice
Alsa PCM device name.
int Write(const void *, int)
Write data to the output device.
snd_pcm_t * m_pPCMHandle
alsa pcm handle
bool IsPassthroughActive(void)
void Exit(void)
Cleanup the ALSA audio output module.
char * FindDevice(const char *, const char *)
Find alsa device giving some search hints.
int GetAvailableBufferFrames(bool)
Get the number of frames that could be written to the device.
int GetHwDelayFrames(void)
Return the current hardware audio delay in frames.
int WaitUntilReady(void)
Wait until data can be written or read to/from the device (Timeout is 150ms currently)
const char * m_pMixerDevice
mixer device name (not used)
int Setup(int, int, bool, int)
Setup ALSA audio for requested format.
int BytesToFrames(size_t bytes)
char * OpenDevice(const char *)
Open an ALSA device.
void SetVolume(int)
Set alsa mixer volume (0-1000)
int m_downmix
set stereo downmix
int64_t MsToPts(int64_t ptsMs, double timebase)
void FlushBuffers(bool)
Flush ALSA buffers internally.
int64_t PtsToMs(int64_t pts, double timebase)
void SetDownmix(int downMix)
bool InitDevice(void)
Search for an alsa pcm device and open it.
int MsToFrames(int milliseconds)
std::atomic< bool > m_passthroughActive
set, if passthrough is active
snd_mixer_t * m_pMixer
alsa mixer handle
bool Init(void)
Initialize the ALSA audio output module.
unsigned int m_hwNumChannels
number of hardware channels
bool CheckWrittenFrames(int, int)
Check, if all frames have been written.
int FramesToMs(int frames)
std::vector< std::string > GetChannelLayoutAsArray(void)
Put ALSA channel layout in a dynamic array of strings.