XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions | Variables
sndcore.c File Reference
#include <Sound/sound.h>
#include <Mm/kmalloc.h>
#include <Fs/vfs.h>
#include <Cred/cred.h>
#include <Cred/group.h>
#include <aucon.h>
#include <_null.h>
#include <Drivers/uart.h>
#include <Mm/vmmngr.h>
#include <Mm/pmmngr.h>
Include dependency graph for sndcore.c:

Classes

struct  _sound_card_list
 

Macros

#define AURORA_MAX_SOUND_CARDS   256
 
#define SOUND_REGISTER_SNDPLR   100
 
#define SOUND_START_OUTPUT   102
 
#define SOUND_STOP_OUTPUT   103
 
#define SOUND_START_INPUT   104
 
#define SOUND_STOP_INPUT   105
 
#define SOUND_SET_VOLUME   106
 
#define SOUND_GET_VOLUME   107
 
#define SOUND_MUTE_ENABLE   108
 
#define SOUND_MUTE_DISABLE   109
 
#define SOUND_READ_AVAIL   110
 
#define SOUND_UNREGISTER_SNDPLR   111
 
#define SOUND_REGISTER_CARD   112
 
#define SOUND_GET_CARD_LIST   113
 
#define SOUND_GET_CARD_TOTALNUM   114
 
#define SND_BUFF_SZ   PAGE_SIZE
 

Typedefs

typedef struct _sound_card_list aurora_snd_card_list
 

Functions

void AuSoundAddDSP (AuDSP *dsp)
 AuSoundAddDSP – adds a dsp to the dsp list.
 
void AuRemoveDSP (AuDSP *dsp)
 AuRemoveDSP – removes a dsp from the dsp list.
 
AuDSPAuSoundGetDSP (uint16_t id)
 
int AuSoundIOControl (AuVFSNode *node, int code, void *arg)
 AuSoundIOControl – io control for sound file.
 
size_t AuSoundRead (AuVFSNode *fsys, AuVFSNode *file, uint64_t *buffer, uint32_t length)
 
size_t AuSoundWrite (AuVFSNode *fsys, AuVFSNode *file, uint64_t *buffer, uint32_t length)
 
void AuSoundInitialise ()
 AuSoundInitialize – Initialized the Aurora sound system.
 
void AuSoundRemoveDSP (uint16_t id)
 AuSoundRemoveDSP – remove the dsp from dsp list.
 
int AuSoundRegisterCard (AuSound *snd)
 AuSoundRegisterCard – register a new sound card to sound layer.
 

Variables

AuSound_cards [AURORA_MAX_SOUND_CARDS]
 

Detailed Description

BSD 2-Clause License

Copyright (c) 2022-2026, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Macro Definition Documentation

◆ AURORA_MAX_SOUND_CARDS

#define AURORA_MAX_SOUND_CARDS   256

◆ SND_BUFF_SZ

#define SND_BUFF_SZ   PAGE_SIZE

◆ SOUND_GET_CARD_LIST

#define SOUND_GET_CARD_LIST   113

◆ SOUND_GET_CARD_TOTALNUM

#define SOUND_GET_CARD_TOTALNUM   114

◆ SOUND_GET_VOLUME

#define SOUND_GET_VOLUME   107

◆ SOUND_MUTE_DISABLE

#define SOUND_MUTE_DISABLE   109

◆ SOUND_MUTE_ENABLE

#define SOUND_MUTE_ENABLE   108

◆ SOUND_READ_AVAIL

#define SOUND_READ_AVAIL   110

◆ SOUND_REGISTER_CARD

#define SOUND_REGISTER_CARD   112

◆ SOUND_REGISTER_SNDPLR

#define SOUND_REGISTER_SNDPLR   100

◆ SOUND_SET_VOLUME

#define SOUND_SET_VOLUME   106

◆ SOUND_START_INPUT

#define SOUND_START_INPUT   104

◆ SOUND_START_OUTPUT

#define SOUND_START_OUTPUT   102

◆ SOUND_STOP_INPUT

#define SOUND_STOP_INPUT   105

◆ SOUND_STOP_OUTPUT

#define SOUND_STOP_OUTPUT   103

◆ SOUND_UNREGISTER_SNDPLR

#define SOUND_UNREGISTER_SNDPLR   111

Typedef Documentation

◆ aurora_snd_card_list

TODO: Support for controlling jack pins ADC/DAC add removal support

Function Documentation

◆ AuRemoveDSP()

void AuRemoveDSP ( AuDSP dsp)

AuRemoveDSP – removes a dsp from the dsp list.

Parameters
dsp– dsp to remove

◆ AuSoundAddDSP()

void AuSoundAddDSP ( AuDSP dsp)

AuSoundAddDSP – adds a dsp to the dsp list.

Parameters
dsp– dsp to add

◆ AuSoundGetDSP()

AuDSP * AuSoundGetDSP ( uint16_t  id)

◆ AuSoundInitialise()

void AuSoundInitialise ( )

AuSoundInitialize – Initialized the Aurora sound system.

clear up the card data structure

◆ AuSoundIOControl()

int AuSoundIOControl ( AuVFSNode node,
int  code,
void *  arg 
)

AuSoundIOControl – io control for sound file.

◆ AuSoundRead()

size_t AuSoundRead ( AuVFSNode fsys,
AuVFSNode file,
uint64_t buffer,
uint32_t  length 
)

NOT implemented yet

◆ AuSoundRegisterCard()

int AuSoundRegisterCard ( AuSound snd)

AuSoundRegisterCard – register a new sound card to sound layer.

Parameters
snd– pointer to sound card

◆ AuSoundRemoveDSP()

void AuSoundRemoveDSP ( uint16_t  id)

AuSoundRemoveDSP – remove the dsp from dsp list.

◆ AuSoundWrite()

size_t AuSoundWrite ( AuVFSNode fsys,
AuVFSNode file,
uint64_t buffer,
uint32_t  length 
)

see if dps has card attached to it, also verify if the card is in force write mode

Variable Documentation

◆ _cards