XenevaOS
Loading...
Searching...
No Matches
Classes | Macros
sndsrv.h File Reference
#include <stdint.h>
Include dependency graph for sndsrv.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SndRingHdr
 
struct  SndsrvAttach
 
struct  SndsrvStats
 

Macros

#define SNDSRV_RING_MAGIC   0x31565253u /* 'SRV1' */
 
#define SNDSRV_DATA_OFFSET   4096
 
#define SNDSRV_IOC_ATTACH   0x5301 /* arg: SndsrvAttach */
 
#define SNDSRV_IOC_DETACH   0x5302
 
#define SNDSRV_IOC_STATS   0x5303 /* arg: SndsrvStats */
 
#define SNDSRV_OK   0
 
#define SNDSRV_E_PERM   -1
 
#define SNDSRV_E_INVAL   -2
 
#define SNDSRV_E_BUSY   -3
 

Macro Definition Documentation

◆ SNDSRV_DATA_OFFSET

#define SNDSRV_DATA_OFFSET   4096

◆ SNDSRV_E_BUSY

#define SNDSRV_E_BUSY   -3

◆ SNDSRV_E_INVAL

#define SNDSRV_E_INVAL   -2

◆ SNDSRV_E_PERM

#define SNDSRV_E_PERM   -1

◆ SNDSRV_IOC_ATTACH

#define SNDSRV_IOC_ATTACH   0x5301 /* arg: SndsrvAttach */

◆ SNDSRV_IOC_DETACH

#define SNDSRV_IOC_DETACH   0x5302

◆ SNDSRV_IOC_STATS

#define SNDSRV_IOC_STATS   0x5303 /* arg: SndsrvStats */

◆ SNDSRV_OK

#define SNDSRV_OK   0

◆ SNDSRV_RING_MAGIC

#define SNDSRV_RING_MAGIC   0x31565253u /* 'SRV1' */

Shared kernel/user ABI between the kernel sound proxy card and a user-space sound server (Process/sndsrv).

The server allocates one DMA buffer through /dev/hwdev, lays a SndRingHdr at its start and a power-of-two data area at SNDSRV_DATA_OFFSET, then passes the buffer's physical address to /dev/sndsrv (SNDSRV_IOC_ATTACH). The kernel only accepts a buffer that really is one of the caller's own DMA allocations. From then on the kernel sound card "virtio-sound" copies the mixer's PCM into the ring (single producer) and the server drains it into the device (single consumer). head/tail are free-running byte counters.