XenevaOS
Loading...
Searching...
No Matches
sound.h
Go to the documentation of this file.
1
33#ifndef __AU_SOUND_H__
34#define __AU_SOUND_H__
35
36#include <stdint.h>
37#include <circbuf.h>
38
39#ifdef ARCH_X64
40#include <Hal/x86_64_sched.h>
41#elif ARCH_ARM64
42#include <Hal/AA64/sched.h>
43#endif
44
45#include <aurora.h>
46
47#ifdef ARCH_X64
48#pragma pack(push,1)
49#endif
50typedef struct __au_dsp__ {
54#ifdef ARCH_X64
55 AuThread *SndThread;
56#elif ARCH_ARM64
57 AA64Thread* SndThread;
58#endif
63 /* name of the card this client chose; kept when the card is removed so the
64 * client reattaches by itself when a card with that name comes back (driver
65 * restart or failover to the in-kernel driver) */
66 char card_name[32];
68
69#ifdef ARCH_X64
70#pragma pack(pop)
71#endif
72
73
74typedef struct _SoundDev_ {
75 char name[32];
76 int(*write) (uint8_t* buffer, size_t length);
77 int(*read) (uint8_t* buffer, size_t length);
78 int(*stop_output)();
79 int(*start_output)();
80 int(*set_vol)(uint8_t vol);
81 int(*control)(void* data, int code);
84
85
89extern void AuSoundInitialise();
90
97
103
109
116
122
126extern int au_sound_last_id;
127
128/*
129* AuSoundStart -- Starts the Sound card
130*/
131extern void AuSoundStart();
132
133/*
134* AuSoundStop -- Stop Sound card
135*/
136extern void AuSoundStop();
137#endif
#define AU_EXTERN
Definition aurora.h:54
#define AU_EXPORT
Definition aurora.h:40
int snd
Definition main.cpp:68
short int int16_t
Definition acefiex.h:159
unsigned char uint8_t
Definition acefiex.h:161
COMPILER_DEPENDENT_UINT64 uint64_t
Definition acefiex.h:165
unsigned short int uint16_t
Definition acefiex.h:162
const struct device * dev
Definition drm_print.h:519
void * data
Definition kthread.h:30
AU_EXTERN AU_EXPORT void AuSoundGetBlock(uint64_t *buffer)
AuSoundGetBlock – the main heart of aurora sound system – called by sound card.
Definition sound.cpp:122
void AuSoundInitialise()
AuSoundInitialize – Initialized the Aurora sound system.
Definition sound.cpp:270
int au_sound_last_id
au_sound_last_id – card index assigned by last AuSoundRegisterCard call
Definition sndcore.c:48
void AuSoundStop()
Definition sound.cpp:216
AU_EXTERN AU_EXPORT void AuSoundRemoveDSP(uint16_t id)
AuSoundRemoveDSP – remove the dsp from dsp list.
Definition sound.cpp:304
struct __au_dsp__ AuDSP
AU_EXTERN AU_EXPORT void AuSoundSetCard(AuSound *dev)
AuSoundSetCard – registers a new sound card.
Definition sound.cpp:198
AU_EXTERN AU_EXPORT int AuSoundRegisterCard(AuSound *snd)
AuSoundRegisterCard – register a new sound card to sound layer.
Definition sndcore.c:370
AU_EXTERN AU_EXPORT int AuSoundUnregisterCard(AuSound *snd)
AuSoundUnregisterCard – remove a sound card (hot-unplug); DSP clients bound to it are detached....
Definition sndcore.c:352
void AuSoundStart()
Definition sound.cpp:207
struct _SoundDev_ AuSound
Definition sound.h:74
int(* read)(uint8_t *buffer, size_t length)
Definition sound.h:77
bool _force_write
Definition sound.h:82
int(* write)(uint8_t *buffer, size_t length)
Definition sound.h:76
int(* control)(void *data, int code)
Definition sound.h:81
int(* set_vol)(uint8_t vol)
Definition sound.h:80
int(* start_output)()
Definition sound.h:79
int(* stop_output)()
Definition sound.h:78
char name[32]
Definition sound.h:75
Definition sound.h:50
struct __au_dsp__ * prev
Definition sound.h:62
uint16_t _dsp_id
Definition sound.h:52
bool available
Definition sound.h:60
char card_name[32]
Definition sound.h:66
struct __au_dsp__ * next
Definition sound.h:61
CircBuffer * buffer
Definition sound.h:51
uint64_t sleep_time
Definition sound.h:59
int16_t _cardID
Definition sound.h:53
Definition x86_64_sched.h:118
Definition circbuf.h:43