FreeBSD kernel sound device code
vchan.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define VCHAN_SYNC_REQUIRED(c)
 
#define VCHAN_DEFAULT_FORMAT   SND_FORMAT(AFMT_S16_LE, 2, 0)
 
#define VCHAN_DEFAULT_RATE   48000
 
#define VCHAN_PLAY   0
 
#define VCHAN_REC   1
 
#define VCHAN_SYSCTL_DATA(x, y)
 
#define VCHAN_SYSCTL_DATA_SIZE   sizeof(void *)
 
#define VCHAN_SYSCTL_UNIT(x)   ((int)(((intptr_t)(x) >> 2) & 0xfff) - 1)
 
#define VCHAN_SYSCTL_DIR(x)   ((int)((intptr_t)(x) & 0x3) - 1)
 

Functions

int vchan_create (struct pcm_channel *, int)
 
int vchan_destroy (struct pcm_channel *)
 
int vchan_sync (struct pcm_channel *)
 
void vchan_initsys (device_t)
 

Macro Definition Documentation

◆ VCHAN_DEFAULT_FORMAT

#define VCHAN_DEFAULT_FORMAT   SND_FORMAT(AFMT_S16_LE, 2, 0)

Definition at line 55 of file vchan.h.

◆ VCHAN_DEFAULT_RATE

#define VCHAN_DEFAULT_RATE   48000

Definition at line 56 of file vchan.h.

◆ VCHAN_PLAY

#define VCHAN_PLAY   0

Definition at line 58 of file vchan.h.

◆ VCHAN_REC

#define VCHAN_REC   1

Definition at line 59 of file vchan.h.

◆ VCHAN_SYNC_REQUIRED

#define VCHAN_SYNC_REQUIRED (   c)
Value:
(((c)->flags & CHN_F_VIRTUAL) && (((c)->flags & CHN_F_DIRTY) || \
sndbuf_getfmt((c)->bufhard) != (c)->parentchannel->format || \
sndbuf_getspd((c)->bufhard) != (c)->parentchannel->speed))
unsigned int sndbuf_getspd(struct snd_dbuf *b)
Definition: buffer.c:373
#define CHN_F_DIRTY
Definition: channel.h:365
#define CHN_F_VIRTUAL
Definition: channel.h:376
struct pcm_channel * c
Definition: channel_if.m:106

Definition at line 45 of file vchan.h.

◆ VCHAN_SYSCTL_DATA

#define VCHAN_SYSCTL_DATA (   x,
 
)
Value:
((void *)((intptr_t)(((((x) + 1) & 0xfff) << 2) | \
(((VCHAN_##y) + 1) & 0x3))))

Definition at line 64 of file vchan.h.

◆ VCHAN_SYSCTL_DATA_SIZE

#define VCHAN_SYSCTL_DATA_SIZE   sizeof(void *)

Definition at line 68 of file vchan.h.

◆ VCHAN_SYSCTL_DIR

#define VCHAN_SYSCTL_DIR (   x)    ((int)((intptr_t)(x) & 0x3) - 1)

Definition at line 70 of file vchan.h.

◆ VCHAN_SYSCTL_UNIT

#define VCHAN_SYSCTL_UNIT (   x)    ((int)(((intptr_t)(x) >> 2) & 0xfff) - 1)

Definition at line 69 of file vchan.h.

Function Documentation

◆ vchan_create()

◆ vchan_destroy()

int vchan_destroy ( struct pcm_channel c)

◆ vchan_initsys()

void vchan_initsys ( device_t  dev)

Definition at line 940 of file vchan.c.

References dev, snddev_info::play_sysctl_tree, snddev_info::rec_sysctl_ctx, snddev_info::rec_sysctl_tree, sysctl_dev_pcm_vchanformat(), sysctl_dev_pcm_vchanmode(), sysctl_dev_pcm_vchanrate(), sysctl_dev_pcm_vchans(), VCHAN_SYSCTL_DATA, and VCHAN_SYSCTL_DATA_SIZE.

Referenced by pcm_sysinit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vchan_sync()