FreeRDP
rdpsnd_alsa.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winpr/crt.h>
#include <winpr/cmdline.h>
#include <winpr/sysinfo.h>
#include <winpr/collections.h>
#include <alsa/asoundlib.h>
#include <freerdp/types.h>
#include <freerdp/codec/dsp.h>
#include <freerdp/channels/log.h>
#include "rdpsnd_main.h"

Macros

#define SND_PCM_CHECK(_func, _status)
 
#define freerdp_rdpsnd_client_subsystem_entry   FREERDP_API freerdp_rdpsnd_client_subsystem_entry
 

Functions

static int rdpsnd_alsa_set_hw_params (rdpsndAlsaPlugin *alsa)
 
static int rdpsnd_alsa_set_sw_params (rdpsndAlsaPlugin *alsa)
 
static int rdpsnd_alsa_validate_params (rdpsndAlsaPlugin *alsa)
 
static int rdpsnd_alsa_set_params (rdpsndAlsaPlugin *alsa)
 
static BOOL rdpsnd_alsa_set_format (rdpsndDevicePlugin *device, const AUDIO_FORMAT *format, UINT32 latency)
 
static void rdpsnd_alsa_close_mixer (rdpsndAlsaPlugin *alsa)
 
static BOOL rdpsnd_alsa_open_mixer (rdpsndAlsaPlugin *alsa)
 
static void rdpsnd_alsa_pcm_close (rdpsndAlsaPlugin *alsa)
 
static BOOL rdpsnd_alsa_open (rdpsndDevicePlugin *device, const AUDIO_FORMAT *format, UINT32 latency)
 
static void rdpsnd_alsa_close (rdpsndDevicePlugin *device)
 
static void rdpsnd_alsa_free (rdpsndDevicePlugin *device)
 
static BOOL rdpsnd_alsa_format_supported (rdpsndDevicePlugin *device, const AUDIO_FORMAT *format)
 
static UINT32 rdpsnd_alsa_get_volume (rdpsndDevicePlugin *device)
 
static BOOL rdpsnd_alsa_set_volume (rdpsndDevicePlugin *device, UINT32 value)
 
static UINT rdpsnd_alsa_play (rdpsndDevicePlugin *device, const BYTE *data, size_t size)
 
static UINT rdpsnd_alsa_parse_addin_args (rdpsndDevicePlugin *device, const ADDIN_ARGV *args)
 
UINT freerdp_rdpsnd_client_subsystem_entry (PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints)
 

Macro Definition Documentation

◆ freerdp_rdpsnd_client_subsystem_entry

#define freerdp_rdpsnd_client_subsystem_entry   FREERDP_API freerdp_rdpsnd_client_subsystem_entry

◆ SND_PCM_CHECK

#define SND_PCM_CHECK (   _func,
  _status 
)
Value:
if (_status < 0) \
{ \
WLog_ERR(TAG, "%s: %d\n", _func, _status); \
return -1; \
}

Function Documentation

◆ freerdp_rdpsnd_client_subsystem_entry()

UINT freerdp_rdpsnd_client_subsystem_entry ( PFREERDP_RDPSND_DEVICE_ENTRY_POINTS  pEntryPoints)

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:

◆ rdpsnd_alsa_close()

static void rdpsnd_alsa_close ( rdpsndDevicePlugin *  device)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpsnd_alsa_close_mixer()

static void rdpsnd_alsa_close_mixer ( rdpsndAlsaPlugin *  alsa)
static
Here is the caller graph for this function:

◆ rdpsnd_alsa_format_supported()

static BOOL rdpsnd_alsa_format_supported ( rdpsndDevicePlugin *  device,
const AUDIO_FORMAT format 
)
static
Here is the caller graph for this function:

◆ rdpsnd_alsa_free()

static void rdpsnd_alsa_free ( rdpsndDevicePlugin *  device)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpsnd_alsa_get_volume()

static UINT32 rdpsnd_alsa_get_volume ( rdpsndDevicePlugin *  device)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpsnd_alsa_open()

static BOOL rdpsnd_alsa_open ( rdpsndDevicePlugin *  device,
const AUDIO_FORMAT format,
UINT32  latency 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpsnd_alsa_open_mixer()

static BOOL rdpsnd_alsa_open_mixer ( rdpsndAlsaPlugin *  alsa)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpsnd_alsa_parse_addin_args()

static UINT rdpsnd_alsa_parse_addin_args ( rdpsndDevicePlugin *  device,
const ADDIN_ARGV *  args 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpsnd_alsa_pcm_close()

static void rdpsnd_alsa_pcm_close ( rdpsndAlsaPlugin *  alsa)
static
Here is the caller graph for this function:

◆ rdpsnd_alsa_play()

static UINT rdpsnd_alsa_play ( rdpsndDevicePlugin *  device,
const BYTE data,
size_t  size 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpsnd_alsa_set_format()

static BOOL rdpsnd_alsa_set_format ( rdpsndDevicePlugin *  device,
const AUDIO_FORMAT format,
UINT32  latency 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpsnd_alsa_set_hw_params()

static int rdpsnd_alsa_set_hw_params ( rdpsndAlsaPlugin *  alsa)
static

ALSA Parameters

http://www.alsa-project.org/main/index.php/FramesPeriods

buffer_size = period_size * periods period_bytes = period_size * bytes_per_frame bytes_per_frame = channels * bytes_per_sample

A frame is equivalent of one sample being played, irrespective of the number of channels or the number of bits

A period is the number of frames in between each hardware interrupt.

The buffer size always has to be greater than one period size. Commonly this is (2 * period_size), but some hardware can do 8 periods per buffer. It is also possible for the buffer size to not be an integer multiple of the period size.

Here is the caller graph for this function:

◆ rdpsnd_alsa_set_params()

static int rdpsnd_alsa_set_params ( rdpsndAlsaPlugin *  alsa)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpsnd_alsa_set_sw_params()

static int rdpsnd_alsa_set_sw_params ( rdpsndAlsaPlugin *  alsa)
static
Here is the caller graph for this function:

◆ rdpsnd_alsa_set_volume()

static BOOL rdpsnd_alsa_set_volume ( rdpsndDevicePlugin *  device,
UINT32  value 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpsnd_alsa_validate_params()

static int rdpsnd_alsa_validate_params ( rdpsndAlsaPlugin *  alsa)
static
Here is the caller graph for this function:
TAG
#define TAG
Definition: audin_main.h:33