vdr-plugin-softhddevice-drm-gles 1.6.2
cSoftHdAudio Class Reference

Audio Interface. More...

#include <audio.h>

Public Member Functions

 cSoftHdAudio (cSoftHdDevice *)
 Create a new audio context.
 
void LazyInit (void)
 Initialize audio output module (alsa)
 
void Exit (void)
 Cleanup audio output module (alsa)
 
int Setup (AVCodecContext *, int, int, int)
 Alsa setup wrapper.
 
void SetPaused (bool)
 Set audio playback pause state.
 
bool IsPaused (void)
 
void Filter (AVFrame *, AVCodecContext *)
 Send audio frame to filter and enqueue it.
 
void EnqueueSpdif (uint16_t *, int, AVFrame *)
 Enqueue prepared spdif bursts in audio output queue.
 
bool IsBufferFull (void)
 
void FlushBuffers (void)
 Flush audio buffers.
 
int GetUsedBytes (void)
 Get used bytes in audio ringbuffer.
 
int64_t GetHardwareOutputPtsMs (void)
 Get the hardware output PTS in milliseconds.
 
int64_t GetHardwareOutputDelayMs (void)
 Get the hardware delay in milliseconds.
 
int64_t GetHardwareOutputPtsTimebaseUnits (void)
 Get the hardware output PTS in timebase units.
 
int GetPassthrough (void) const
 
bool HasInputPts (void)
 
int64_t GetInputPtsMs (void)
 
int64_t GetOutputPtsMs (void)
 Get the output PTS of the ringbuffer.
 
int GetAvResyncBorderMs (void)
 
void SetEq (int[18], int)
 Set equalizer bands.
 
void SetVolume (int)
 Set mixer volume (0-1000)
 
void SetDownmix (int downMix)
 
void SetSoftvol (bool softVolume)
 
void SetNormalize (bool, int)
 Set normalize volume parameters.
 
void SetCompression (bool, int)
 Set volume compression parameters.
 
void SetStereoDescent (int)
 Set stereo loudness descent.
 
void SetPassthroughMask (int)
 Set audio passthrough mask.
 
void SetAutoAES (bool appendAes)
 
void SetTimebase (AVRational *timebase)
 
void DropSamplesOlderThanPtsMs (int64_t)
 Drop samples older than the given PTS.
 
void ClockDriftCompensation (void)
 Calculate clock drift compensation.
 
void ResetHwDelayBaseline (void)
 Reset the hw delay baseline.
 
void SetHwDelayBaseline (void)
 Set the hw delay baseline.
 
void Stop (void)
 Stop the thread.
 

Protected Member Functions

virtual void Action (void)
 Audio thread loop, started with Start().
 

Private Member Functions

void Enqueue (uint16_t *, int, AVFrame *)
 Send audio data to ringbuffer.
 
void EnqueueFrame (AVFrame *)
 Place samples in audio output queue.
 
bool SendAudio (int)
 Write regular audio data from the ringbuffer to the hardware.
 
bool SendPause (void)
 Write pause to passthrough device.
 
void BuildPauseBurst (void)
 Build a pause spdif burst with the size of the last recognized normal spdif audio.
 
void Normalize (uint16_t *, int)
 Normalize audio samples.
 
void Compress (uint16_t *, int)
 Compress audio samples.
 
void SoftAmplify (int16_t *, int)
 Amplify the samples in software.
 
int InitFilter (AVCodecContext *)
 Init audio filters.
 
AVFrameFilterGetFrame (void)
 Get frame from filter sink.
 
int CheckForFilterReady (AVCodecContext *)
 Check if the filter has changed and is ready, init the filter if needed.
 
int AlsaSetup (int channels, int sample_rate, int passthrough)
 Setup alsa audio for requested format.
 
charOpenAlsaDevice (const char *, int)
 Opens an alsa device.
 
charFindAlsaDevice (const char *, const char *, int)
 Find alsa device giving some search hints.
 
void AlsaInitPCMDevice (void)
 Search for an alsa pcm device and open it.
 
void AlsaInitMixer (void)
 Initialize alsa mixer.
 
void AlsaSetVolume (int)
 Set alsa mixer volume (0-1000)
 
void AlsaInit (void)
 Initialize the alsa audio output module.
 
void AlsaExit (void)
 Cleanup the alsa audio output module.
 
void FlushAlsaBuffers (void)
 Flush alsa buffers.
 
void DropAlsaBuffers (void)
 Drop alsa buffers.
 
void FlushAlsaBuffersInternal (bool)
 Flush alsa buffers internally.
 
bool CyclicCall (void)
 Cyclic audio playback call.
 
void ProcessEvents (void)
 Process queued events and forward them to event receiver.
 
void HandleError (int)
 Handle an alsa error.
 
int64_t GetOutputPtsMsInternal (void)
 
int64_t PtsToMs (int64_t pts)
 
int64_t MsToPts (int64_t ptsMs)
 
int MsToFrames (int milliseconds)
 
int FramesToMs (int frames)
 
double FramesToMsDouble (int frames)
 

Private Attributes

cSoftHdDevicem_pDevice
 pointer to device
 
cSoftHdConfigm_pConfig
 pointer to config
 
IEventReceiverm_pEventReceiver
 pointer to event receiver
 
cBufferFillLevelLowPassFilter m_fillLevel
 low pass filter for the buffer fill level
 
cPidController m_pidController {3, 0.005, 0, 1000}
 PID controller for clock drift compensation with tuning values coming from educated guesses.
 
std::chrono::steady_clock::time_point m_lastPidInvocation
 last time the PID controller was invoked
 
int m_alsaBufferSizeFrames = 0
 alsa buffer size in frames
 
int m_packetCounter = 0
 packet counter for logging
 
bool m_initialized = false
 class initialized
 
const int m_bytesPerSample = 2
 number of bytes per sample
 
unsigned int m_hwSampleRate = 0
 hardware sample rate in Hz
 
unsigned int m_hwNumChannels = 0
 number of hardware channels
 
AVRationalm_pTimebase
 pointer to AVCodecContext pkts_timebase
 
std::mutex m_mutex
 mutex for thread safety
 
std::mutex m_pauseMutex
 mutex for a safe thread pausing
 
std::vector< Eventm_eventQueue
 event queue for incoming events
 
std::atomic< doublem_pitchPpm = 0
 pitch adjustment in ppm. Positive values are faster
 
int m_pitchAdjustFrameCounter = 0
 counter for pitch adjustment frames
 
int m_downmix
 set stereo downmix
 
int64_t m_inputPts = AV_NOPTS_VALUE
 pts clock (last pts in ringbuffer)
 
std::atomic< boolm_paused = true
 audio is paused
 
bool m_softVolume
 flag to use soft volume
 
int m_passthrough
 passthrough mask
 
const charm_pPCMDevice
 PCM device name.
 
const charm_pPassthroughDevice
 passthrough device name
 
bool m_appendAES
 flag ato utomatic append AES
 
int m_spdifBurstSize = 0
 size of the current spdif burst
 
std::vector< uint16_tm_pauseBurst
 holds the burst data itself
 
snd_pcm_sframes_t m_hwBaseline = 0
 saves the hw delay (pause bursts) once a real audio frame to correctly do the AV-Sync
 
bool m_firstRealAudioReceived = false
 false, as long as no real audio was sent - used to trigger the baseline set
 
bool m_normalize
 flag to use volume normalize
 
const int m_normalizeSamples = 4096
 number of normalize samples
 
int m_normalizeCounter
 normalize sample counter
 
uint32_t m_normalizeAverage [NORMALIZE_MAX_INDEX]
 average of n last normalize sample blocks
 
int m_normalizeIndex
 index into normalize average table
 
int m_normalizeReady
 index normalize counter
 
int m_normalizeFactor
 current normalize factor
 
const int m_normalizeMinFactor = 100
 min. normalize factor
 
int m_normalizeMaxFactor
 max. normalize factor
 
bool m_compression
 flag to use compress volume
 
int m_compressionFactor = 0
 current compression factor
 
int m_compressionMaxFactor
 max. compression factor
 
int m_amplifier
 software volume amplify factor
 
int m_stereoDescent
 volume descent for stereo
 
int m_volume = 0
 current volume (0 .. 1000)
 
int m_useEqualizer
 flag to use equalizer
 
float m_equalizerBand [18]
 equalizer band
 
const charm_pMixerDevice = nullptr
 mixer device name (not used)
 
const charm_pMixerChannel
 mixer channel name
 
int m_filterChanged = 0
 filter has changed
 
int m_filterReady = 0
 filter is ready
 
AVFilterGraphm_pFilterGraph = nullptr
 
AVFilterContextm_pBuffersrcCtx
 
AVFilterContextm_pBuffersinkCtx
 
cSoftHdRingbuffer m_pRingbuffer {RINGBUFFER_SIZE}
 sample ring buffer
 
snd_pcm_tm_pAlsaPCMHandle
 alsa pcm handle
 
snd_mixer_tm_pAlsaMixer = nullptr
 alsa mixer handle
 
snd_mixer_elem_tm_pAlsaMixerElem = nullptr
 alsa mixer element
 
int m_alsaRatio
 internal -> mixer ratio * 1000
 
bool m_alsaUseMmap
 use mmap
 

Static Private Attributes

static constexpr int AUDIO_MIN_BUFFER_FREE = 3072 * 8 * 8
 Minimum free space in audio buffer 8 packets for 8 channels.
 
static constexpr int NORMALIZE_MAX_INDEX = 128
 number of normalize average samples
 
static constexpr int AV_SYNC_BORDER_MS = 5000
 absolute max a/v difference in ms which should trigger a resync
 
static constexpr unsigned RINGBUFFER_SIZE = 3 * 5 * 7 * 8 * 2 * 1000
 default ring buffer size ~2s 8ch 16bit (3 * 5 * 7 * 8)
 

Detailed Description

Audio Interface.

Definition at line 46 of file audio.h.

Member Function Documentation

◆ FramesToMs()

int cSoftHdAudio::FramesToMs ( int  frames)
inlineprivate

◆ FramesToMsDouble()

double cSoftHdAudio::FramesToMsDouble ( int  frames)
inlineprivate

Definition at line 210 of file audio.h.

References m_hwSampleRate.

Referenced by ClockDriftCompensation().

◆ GetAvResyncBorderMs()

int cSoftHdAudio::GetAvResyncBorderMs ( void  )
inline

Definition at line 68 of file audio.h.

References AV_SYNC_BORDER_MS.

Referenced by cVideoRender::DisplayFrame().

◆ GetInputPtsMs()

int64_t cSoftHdAudio::GetInputPtsMs ( void  )
inline

Definition at line 66 of file audio.h.

References m_inputPts, and PtsToMs().

Referenced by cSoftHdDevice::IsBufferingThresholdReached().

◆ GetPassthrough()

int cSoftHdAudio::GetPassthrough ( void  ) const
inline

Definition at line 64 of file audio.h.

References m_passthrough.

◆ HasInputPts()

bool cSoftHdAudio::HasInputPts ( void  )
inline

◆ IsBufferFull()

bool cSoftHdAudio::IsBufferFull ( void  )
inline

◆ IsPaused()

bool cSoftHdAudio::IsPaused ( void  )
inline

Definition at line 54 of file audio.h.

References m_paused.

Referenced by cVideoRender::DisplayFrame().

◆ MsToFrames()

int cSoftHdAudio::MsToFrames ( int  milliseconds)
inlineprivate

Definition at line 208 of file audio.h.

References m_hwSampleRate.

Referenced by AlsaSetup(), and DropSamplesOlderThanPtsMs().

◆ MsToPts()

int64_t cSoftHdAudio::MsToPts ( int64_t  ptsMs)
inlineprivate

Definition at line 207 of file audio.h.

References m_pTimebase.

Referenced by GetHardwareOutputPtsTimebaseUnits().

◆ PtsToMs()

int64_t cSoftHdAudio::PtsToMs ( int64_t  pts)
inlineprivate

Definition at line 206 of file audio.h.

References m_pTimebase.

Referenced by Enqueue(), GetInputPtsMs(), and GetOutputPtsMsInternal().

◆ SetAutoAES()

void cSoftHdAudio::SetAutoAES ( bool  appendAes)
inline

Definition at line 78 of file audio.h.

References m_appendAES.

Referenced by cMenuSetupSoft::Store().

◆ SetDownmix()

void cSoftHdAudio::SetDownmix ( int  downMix)
inline

Definition at line 72 of file audio.h.

References m_downmix.

Referenced by cMenuSetupSoft::Store().

◆ SetSoftvol()

void cSoftHdAudio::SetSoftvol ( bool  softVolume)
inline

Definition at line 73 of file audio.h.

References m_softVolume.

Referenced by cMenuSetupSoft::Store().

◆ SetTimebase()

void cSoftHdAudio::SetTimebase ( AVRational timebase)
inline

Definition at line 79 of file audio.h.

References m_pTimebase.

Referenced by cAudioDecoder::DecodePassthrough().

Member Data Documentation

◆ AUDIO_MIN_BUFFER_FREE

constexpr int cSoftHdAudio::AUDIO_MIN_BUFFER_FREE = 3072 * 8 * 8
staticconstexprprivate

Minimum free space in audio buffer 8 packets for 8 channels.

Definition at line 92 of file audio.h.

Referenced by IsBufferFull().

◆ AV_SYNC_BORDER_MS

constexpr int cSoftHdAudio::AV_SYNC_BORDER_MS = 5000
staticconstexprprivate

absolute max a/v difference in ms which should trigger a resync

Definition at line 94 of file audio.h.

Referenced by Enqueue(), and GetAvResyncBorderMs().

◆ m_alsaBufferSizeFrames

int cSoftHdAudio::m_alsaBufferSizeFrames = 0
private

alsa buffer size in frames

Definition at line 101 of file audio.h.

Referenced by AlsaSetup(), and ClockDriftCompensation().

◆ m_alsaRatio

int cSoftHdAudio::m_alsaRatio
private

internal -> mixer ratio * 1000

Definition at line 187 of file audio.h.

Referenced by AlsaInitMixer(), and AlsaSetVolume().

◆ m_alsaUseMmap

bool cSoftHdAudio::m_alsaUseMmap
private

use mmap

Definition at line 188 of file audio.h.

Referenced by AlsaSetup(), SendAudio(), and SendPause().

◆ m_amplifier

int cSoftHdAudio::m_amplifier
private

software volume amplify factor

Definition at line 156 of file audio.h.

Referenced by SetVolume(), and SoftAmplify().

◆ m_appendAES

bool cSoftHdAudio::m_appendAES
private

flag ato utomatic append AES

Definition at line 125 of file audio.h.

Referenced by OpenAlsaDevice(), and SetAutoAES().

◆ m_bytesPerSample

const int cSoftHdAudio::m_bytesPerSample = 2
private

number of bytes per sample

Definition at line 106 of file audio.h.

Referenced by Compress(), EnqueueFrame(), Normalize(), and SoftAmplify().

◆ m_compression

bool cSoftHdAudio::m_compression
private

flag to use compress volume

Definition at line 150 of file audio.h.

Referenced by EnqueueFrame(), and SetCompression().

◆ m_compressionFactor

int cSoftHdAudio::m_compressionFactor = 0
private

current compression factor

Definition at line 151 of file audio.h.

Referenced by Compress(), FlushAlsaBuffersInternal(), and SetCompression().

◆ m_compressionMaxFactor

int cSoftHdAudio::m_compressionMaxFactor
private

max. compression factor

Definition at line 152 of file audio.h.

Referenced by Compress(), FlushAlsaBuffersInternal(), and SetCompression().

◆ m_downmix

int cSoftHdAudio::m_downmix
private

set stereo downmix

Definition at line 116 of file audio.h.

Referenced by AlsaSetup(), InitFilter(), SetDownmix(), and Setup().

◆ m_equalizerBand

float cSoftHdAudio::m_equalizerBand[18]
private

equalizer band

Definition at line 163 of file audio.h.

Referenced by InitFilter(), and SetEq().

◆ m_eventQueue

std::vector<Event> cSoftHdAudio::m_eventQueue
private

event queue for incoming events

Definition at line 112 of file audio.h.

Referenced by Enqueue(), HandleError(), and ProcessEvents().

◆ m_fillLevel

cBufferFillLevelLowPassFilter cSoftHdAudio::m_fillLevel
private

low pass filter for the buffer fill level

Definition at line 98 of file audio.h.

Referenced by ClockDriftCompensation(), DropSamplesOlderThanPtsMs(), Enqueue(), FlushBuffers(), and SendAudio().

◆ m_filterChanged

int cSoftHdAudio::m_filterChanged = 0
private

filter has changed

Definition at line 170 of file audio.h.

Referenced by CheckForFilterReady(), Filter(), FlushBuffers(), InitFilter(), and SetEq().

◆ m_filterReady

int cSoftHdAudio::m_filterReady = 0
private

filter is ready

Definition at line 171 of file audio.h.

Referenced by CheckForFilterReady(), and InitFilter().

◆ m_firstRealAudioReceived

bool cSoftHdAudio::m_firstRealAudioReceived = false
private

false, as long as no real audio was sent - used to trigger the baseline set

Definition at line 129 of file audio.h.

Referenced by ResetHwDelayBaseline(), and SetHwDelayBaseline().

◆ m_hwBaseline

snd_pcm_sframes_t cSoftHdAudio::m_hwBaseline = 0
private

saves the hw delay (pause bursts) once a real audio frame to correctly do the AV-Sync

Definition at line 128 of file audio.h.

Referenced by GetHardwareOutputPtsMs(), ResetHwDelayBaseline(), and SetHwDelayBaseline().

◆ m_hwNumChannels

unsigned int cSoftHdAudio::m_hwNumChannels = 0
private

number of hardware channels

Definition at line 108 of file audio.h.

Referenced by AlsaSetup(), InitFilter(), Setup(), and SetVolume().

◆ m_hwSampleRate

unsigned int cSoftHdAudio::m_hwSampleRate = 0
private

hardware sample rate in Hz

Definition at line 107 of file audio.h.

Referenced by AlsaSetup(), FramesToMs(), FramesToMsDouble(), GetHardwareOutputDelayMs(), GetHardwareOutputPtsMs(), InitFilter(), MsToFrames(), and Setup().

◆ m_initialized

bool cSoftHdAudio::m_initialized = false
private

class initialized

Definition at line 105 of file audio.h.

Referenced by Exit(), FlushBuffers(), and LazyInit().

◆ m_inputPts

int64_t cSoftHdAudio::m_inputPts = AV_NOPTS_VALUE
private

pts clock (last pts in ringbuffer)

Definition at line 118 of file audio.h.

Referenced by Enqueue(), FlushBuffers(), GetHardwareOutputDelayMs(), GetHardwareOutputPtsMs(), GetInputPtsMs(), GetOutputPtsMsInternal(), and HasInputPts().

◆ m_lastPidInvocation

std::chrono::steady_clock::time_point cSoftHdAudio::m_lastPidInvocation
private

last time the PID controller was invoked

Definition at line 100 of file audio.h.

Referenced by ClockDriftCompensation().

◆ m_mutex

std::mutex cSoftHdAudio::m_mutex
private

◆ m_normalize

bool cSoftHdAudio::m_normalize
private

flag to use volume normalize

Definition at line 138 of file audio.h.

Referenced by EnqueueFrame(), and SetNormalize().

◆ m_normalizeAverage

uint32_t cSoftHdAudio::m_normalizeAverage[NORMALIZE_MAX_INDEX]
private

average of n last normalize sample blocks

Definition at line 141 of file audio.h.

Referenced by FlushAlsaBuffersInternal(), and Normalize().

◆ m_normalizeCounter

int cSoftHdAudio::m_normalizeCounter
private

normalize sample counter

Definition at line 140 of file audio.h.

Referenced by FlushAlsaBuffersInternal(), and Normalize().

◆ m_normalizeFactor

int cSoftHdAudio::m_normalizeFactor
private

current normalize factor

Definition at line 144 of file audio.h.

Referenced by FlushAlsaBuffersInternal(), and Normalize().

◆ m_normalizeIndex

int cSoftHdAudio::m_normalizeIndex
private

index into normalize average table

Definition at line 142 of file audio.h.

Referenced by Normalize().

◆ m_normalizeMaxFactor

int cSoftHdAudio::m_normalizeMaxFactor
private

max. normalize factor

Definition at line 146 of file audio.h.

Referenced by Normalize(), and SetNormalize().

◆ m_normalizeMinFactor

const int cSoftHdAudio::m_normalizeMinFactor = 100
private

min. normalize factor

Definition at line 145 of file audio.h.

Referenced by Normalize().

◆ m_normalizeReady

int cSoftHdAudio::m_normalizeReady
private

index normalize counter

Definition at line 143 of file audio.h.

Referenced by FlushAlsaBuffersInternal(), and Normalize().

◆ m_normalizeSamples

const int cSoftHdAudio::m_normalizeSamples = 4096
private

number of normalize samples

Definition at line 139 of file audio.h.

Referenced by Normalize().

◆ m_packetCounter

int cSoftHdAudio::m_packetCounter = 0
private

packet counter for logging

Definition at line 102 of file audio.h.

Referenced by ClockDriftCompensation().

◆ m_pAlsaMixer

snd_mixer_t* cSoftHdAudio::m_pAlsaMixer = nullptr
private

alsa mixer handle

Definition at line 185 of file audio.h.

Referenced by AlsaExit(), AlsaInitMixer(), and AlsaSetVolume().

◆ m_pAlsaMixerElem

snd_mixer_elem_t* cSoftHdAudio::m_pAlsaMixerElem = nullptr
private

alsa mixer element

Definition at line 186 of file audio.h.

Referenced by AlsaExit(), AlsaInitMixer(), and AlsaSetVolume().

◆ m_pAlsaPCMHandle

◆ m_passthrough

◆ m_pauseBurst

std::vector<uint16_t> cSoftHdAudio::m_pauseBurst
private

holds the burst data itself

Definition at line 127 of file audio.h.

Referenced by BuildPauseBurst(), EnqueueSpdif(), and SendPause().

◆ m_paused

std::atomic<bool> cSoftHdAudio::m_paused = true
private

audio is paused

Definition at line 119 of file audio.h.

Referenced by CyclicCall(), IsPaused(), and SetPaused().

◆ m_pauseMutex

std::mutex cSoftHdAudio::m_pauseMutex
private

mutex for a safe thread pausing

Definition at line 111 of file audio.h.

Referenced by CyclicCall(), EnqueueSpdif(), and SetPaused().

◆ m_pBuffersinkCtx

AVFilterContext* cSoftHdAudio::m_pBuffersinkCtx
private

Definition at line 174 of file audio.h.

Referenced by FilterGetFrame(), and InitFilter().

◆ m_pBuffersrcCtx

AVFilterContext* cSoftHdAudio::m_pBuffersrcCtx
private

Definition at line 173 of file audio.h.

Referenced by Filter(), and InitFilter().

◆ m_pConfig

cSoftHdConfig* cSoftHdAudio::m_pConfig
private

pointer to config

Definition at line 96 of file audio.h.

Referenced by cSoftHdAudio().

◆ m_pDevice

cSoftHdDevice* cSoftHdAudio::m_pDevice
private

pointer to device

Definition at line 95 of file audio.h.

◆ m_pEventReceiver

IEventReceiver* cSoftHdAudio::m_pEventReceiver
private

pointer to event receiver

Definition at line 97 of file audio.h.

Referenced by ProcessEvents().

◆ m_pFilterGraph

AVFilterGraph* cSoftHdAudio::m_pFilterGraph = nullptr
private

Definition at line 172 of file audio.h.

Referenced by CheckForFilterReady(), Exit(), and InitFilter().

◆ m_pidController

cPidController cSoftHdAudio::m_pidController {3, 0.005, 0, 1000}
private

PID controller for clock drift compensation with tuning values coming from educated guesses.

Definition at line 99 of file audio.h.

Referenced by ClockDriftCompensation(), DropSamplesOlderThanPtsMs(), and FlushBuffers().

◆ m_pitchAdjustFrameCounter

int cSoftHdAudio::m_pitchAdjustFrameCounter = 0
private

counter for pitch adjustment frames

Definition at line 114 of file audio.h.

Referenced by Enqueue().

◆ m_pitchPpm

std::atomic<double> cSoftHdAudio::m_pitchPpm = 0
private

pitch adjustment in ppm. Positive values are faster

Definition at line 113 of file audio.h.

Referenced by ClockDriftCompensation(), Enqueue(), and SetPassthroughMask().

◆ m_pMixerChannel

const char* cSoftHdAudio::m_pMixerChannel
private

mixer channel name

Definition at line 167 of file audio.h.

Referenced by AlsaInitMixer().

◆ m_pMixerDevice

const char* cSoftHdAudio::m_pMixerDevice = nullptr
private

mixer device name (not used)

Definition at line 166 of file audio.h.

Referenced by AlsaInitMixer().

◆ m_pPassthroughDevice

const char* cSoftHdAudio::m_pPassthroughDevice
private

passthrough device name

Definition at line 124 of file audio.h.

Referenced by AlsaInitPCMDevice().

◆ m_pPCMDevice

const char* cSoftHdAudio::m_pPCMDevice
private

PCM device name.

Definition at line 123 of file audio.h.

Referenced by AlsaInitPCMDevice().

◆ m_pRingbuffer

cSoftHdRingbuffer cSoftHdAudio::m_pRingbuffer {RINGBUFFER_SIZE}
private

sample ring buffer

Definition at line 181 of file audio.h.

Referenced by DropSamplesOlderThanPtsMs(), Enqueue(), FlushBuffers(), GetOutputPtsMsInternal(), GetUsedBytes(), IsBufferFull(), and SendAudio().

◆ m_pTimebase

AVRational* cSoftHdAudio::m_pTimebase
private

pointer to AVCodecContext pkts_timebase

Definition at line 109 of file audio.h.

Referenced by InitFilter(), MsToPts(), PtsToMs(), SetTimebase(), and Setup().

◆ m_softVolume

bool cSoftHdAudio::m_softVolume
private

flag to use soft volume

Definition at line 121 of file audio.h.

Referenced by SendAudio(), SetSoftvol(), and SetVolume().

◆ m_spdifBurstSize

int cSoftHdAudio::m_spdifBurstSize = 0
private

size of the current spdif burst

Definition at line 126 of file audio.h.

Referenced by BuildPauseBurst(), CyclicCall(), EnqueueSpdif(), and SendPause().

◆ m_stereoDescent

int cSoftHdAudio::m_stereoDescent
private

volume descent for stereo

Definition at line 157 of file audio.h.

Referenced by SetStereoDescent(), and SetVolume().

◆ m_useEqualizer

int cSoftHdAudio::m_useEqualizer
private

flag to use equalizer

Definition at line 162 of file audio.h.

Referenced by InitFilter(), and SetEq().

◆ m_volume

int cSoftHdAudio::m_volume = 0
private

current volume (0 .. 1000)

Definition at line 158 of file audio.h.

Referenced by SendAudio(), SetStereoDescent(), SetVolume(), and SoftAmplify().

◆ NORMALIZE_MAX_INDEX

constexpr int cSoftHdAudio::NORMALIZE_MAX_INDEX = 128
staticconstexprprivate

number of normalize average samples

Definition at line 93 of file audio.h.

Referenced by FlushAlsaBuffersInternal(), and Normalize().

◆ RINGBUFFER_SIZE

constexpr unsigned cSoftHdAudio::RINGBUFFER_SIZE = 3 * 5 * 7 * 8 * 2 * 1000
staticconstexprprivate

default ring buffer size ~2s 8ch 16bit (3 * 5 * 7 * 8)

Definition at line 180 of file audio.h.


The documentation for this class was generated from the following files: