RetroArch
Classes | Macros | Functions | Variables
switch_thread_audio.c File Reference
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <stdint.h>
#include <sys/unistd.h>
#include <libtransistor/nx.h>
#include <queues/fifo_queue.h>
#include "../audio_driver.h"
#include "../../verbosity.h"
#include "../../tasks/tasks_internal.h"
#include "switch_audio_compat.h"
Include dependency graph for switch_thread_audio.c:

Classes

struct  switch_thread_audio_t
 

Macros

#define AUDIO_BUFFER_COUNT   2
 

Functions

static void mainLoop (void *data)
 
static voidswitch_thread_audio_init (const char *device, unsigned rate, unsigned latency, unsigned block_frames, unsigned *new_rate)
 
static bool switch_thread_audio_start (void *data, bool is_shutdown)
 
static bool switch_thread_audio_stop (void *data)
 
static void switch_thread_audio_free (void *data)
 
static ssize_t switch_thread_audio_write (void *data, const void *buf, size_t size)
 
static bool switch_thread_audio_alive (void *data)
 
static void switch_thread_audio_set_nonblock_state (void *data, bool state)
 
static bool switch_thread_audio_use_float (void *data)
 
static size_t switch_thread_audio_write_avail (void *data)
 
size_t switch_thread_audio_buffer_size (void *data)
 

Variables

static const size_t thread_stack_size = 1024 * 8
 
static const int thread_preferred_cpu = 2
 
static const int channel_count = 2
 
static const size_t sample_size = sizeof(uint16_t)
 
static const size_t frame_size = channel_count * sample_size
 
audio_driver_t audio_switch_thread
 

Macro Definition Documentation

◆ AUDIO_BUFFER_COUNT

#define AUDIO_BUFFER_COUNT   2

Function Documentation

◆ mainLoop()

static void mainLoop ( void data)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ switch_thread_audio_alive()

static bool switch_thread_audio_alive ( void data)
static

◆ switch_thread_audio_buffer_size()

size_t switch_thread_audio_buffer_size ( void data)

◆ switch_thread_audio_free()

static void switch_thread_audio_free ( void data)
static
Here is the call graph for this function:

◆ switch_thread_audio_init()

static void* switch_thread_audio_init ( const char *  device,
unsigned  rate,
unsigned  latency,
unsigned  block_frames,
unsigned *  new_rate 
)
static
Here is the call graph for this function:

◆ switch_thread_audio_set_nonblock_state()

static void switch_thread_audio_set_nonblock_state ( void data,
bool  state 
)
static

◆ switch_thread_audio_start()

static bool switch_thread_audio_start ( void data,
bool  is_shutdown 
)
static

◆ switch_thread_audio_stop()

static bool switch_thread_audio_stop ( void data)
static

◆ switch_thread_audio_use_float()

static bool switch_thread_audio_use_float ( void data)
static
Here is the call graph for this function:

◆ switch_thread_audio_write()

static ssize_t switch_thread_audio_write ( void data,
const void buf,
size_t  size 
)
static
Here is the call graph for this function:

◆ switch_thread_audio_write_avail()

static size_t switch_thread_audio_write_avail ( void data)
static
Here is the call graph for this function:

Variable Documentation

◆ audio_switch_thread

audio_driver_t audio_switch_thread
Initial value:
= {
"switch_thread",
NULL,
NULL,
}
static bool switch_thread_audio_start(void *data, bool is_shutdown)
Definition: switch_thread_audio.c:281
#define NULL
Pointer to 0.
Definition: gctypes.h:65
static bool switch_thread_audio_stop(void *data)
Definition: switch_thread_audio.c:293
static void * switch_thread_audio_init(const char *device, unsigned rate, unsigned latency, unsigned block_frames, unsigned *new_rate)
Definition: switch_thread_audio.c:143
static void switch_thread_audio_set_nonblock_state(void *data, bool state)
Definition: switch_thread_audio.c:396
static bool switch_thread_audio_use_float(void *data)
Definition: switch_thread_audio.c:404
static bool switch_thread_audio_alive(void *data)
Definition: switch_thread_audio.c:386
static ssize_t switch_thread_audio_write(void *data, const void *buf, size_t size)
Definition: switch_thread_audio.c:341
static void switch_thread_audio_free(void *data)
Definition: switch_thread_audio.c:304
size_t switch_thread_audio_buffer_size(void *data)
Definition: switch_thread_audio.c:422
static size_t switch_thread_audio_write_avail(void *data)
Definition: switch_thread_audio.c:410

◆ channel_count

const int channel_count = 2
static

◆ frame_size

const size_t frame_size = channel_count * sample_size
static

◆ sample_size

const size_t sample_size = sizeof(uint16_t)
static

◆ thread_preferred_cpu

const int thread_preferred_cpu = 2
static

◆ thread_stack_size

const size_t thread_stack_size = 1024 * 8
static