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

Go to the source code of this file.

Data Structures

struct  pcm_feederdesc
 
struct  feeder_class
 
struct  pcm_feeder
 

Macros

#define FEEDER_DECLARE(feeder, pdata)
 
#define FEEDRATE_RATEMIN   1
 
#define FEEDRATE_RATEMAX   2016000 /* 48000 * 42 */
 
#define FEEDRATE_MIN   1
 
#define FEEDRATE_MAX   0x7fffff /* sign 24bit ~ 8ghz ! */
 
#define FEEDRATE_ROUNDHZ   25
 
#define FEEDRATE_ROUNDHZ_MIN   0
 
#define FEEDRATE_ROUNDHZ_MAX   500
 

Enumerations

enum  {
  FEEDER_ROOT , FEEDER_FORMAT , FEEDER_MIXER , FEEDER_RATE ,
  FEEDER_EQ , FEEDER_VOLUME , FEEDER_MATRIX , FEEDER_LAST
}
 
enum  { FEEDFORMAT_CHANNELS }
 
enum  { FEEDMIXER_CHANNELS }
 
enum  { FEEDRATE_SRC , FEEDRATE_DST , FEEDRATE_QUALITY , FEEDRATE_CHANNELS }
 
enum  {
  FEEDEQ_CHANNELS , FEEDEQ_RATE , FEEDEQ_TREBLE , FEEDEQ_BASS ,
  FEEDEQ_PREAMP , FEEDEQ_STATE , FEEDEQ_DISABLE , FEEDEQ_ENABLE ,
  FEEDEQ_BYPASS , FEEDEQ_UNKNOWN
}
 
enum  {
  FEEDVOLUME_CLASS , FEEDVOLUME_CHANNELS , FEEDVOLUME_STATE , FEEDVOLUME_ENABLE ,
  FEEDVOLUME_BYPASS
}
 

Functions

void feeder_register (void *p)
 
struct feeder_classfeeder_getclass (struct pcm_feederdesc *desc)
 
u_int32_t snd_fmtscore (u_int32_t fmt)
 
u_int32_t snd_fmtbestbit (u_int32_t fmt, u_int32_t *fmts)
 
u_int32_t snd_fmtbestchannel (u_int32_t fmt, u_int32_t *fmts)
 
u_int32_t snd_fmtbest (u_int32_t fmt, u_int32_t *fmts)
 
int chn_addfeeder (struct pcm_channel *c, struct feeder_class *fc, struct pcm_feederdesc *desc)
 
int chn_removefeeder (struct pcm_channel *c)
 
struct pcm_feederchn_findfeeder (struct pcm_channel *c, u_int32_t type)
 
void feeder_printchain (struct pcm_feeder *head)
 
int feeder_chain (struct pcm_channel *)
 
int feeder_eq_validrate (uint32_t)
 
void feeder_eq_initsys (device_t)
 
int feeder_volume_apply_matrix (struct pcm_feeder *, struct pcmchan_matrix *)
 
int feeder_matrix_default_id (uint32_t)
 
struct pcmchan_matrixfeeder_matrix_default_channel_map (uint32_t)
 
uint32_t feeder_matrix_default_format (uint32_t)
 
int feeder_matrix_format_id (uint32_t)
 
struct pcmchan_matrixfeeder_matrix_format_map (uint32_t)
 
struct pcmchan_matrixfeeder_matrix_id_map (int)
 
int feeder_matrix_setup (struct pcm_feeder *, struct pcmchan_matrix *, struct pcmchan_matrix *)
 
int feeder_matrix_compare (struct pcmchan_matrix *, struct pcmchan_matrix *)
 
int feeder_matrix_oss_get_channel_order (struct pcmchan_matrix *, unsigned long long *)
 
int feeder_matrix_oss_set_channel_order (struct pcmchan_matrix *, unsigned long long *)
 

Variables

int feeder_rate_min
 
int feeder_rate_max
 
int feeder_rate_round
 
int feeder_rate_quality
 

Macro Definition Documentation

◆ FEEDER_DECLARE

#define FEEDER_DECLARE (   feeder,
  pdata 
)
Value:
static struct feeder_class feeder ## _class = { \
.name = #feeder, \
.methods = feeder ## _methods, \
.size = sizeof(struct pcm_feeder), \
.desc = feeder ## _desc, \
.data = pdata, \
}; \
SYSINIT(feeder, SI_SUB_DRIVERS, SI_ORDER_ANY, feeder_register, \
&feeder ## _class)
char * desc
Definition: atiixp.c:174
void feeder_register(void *p)
INTERFACE feeder
Definition: feeder_if.m:33

Definition at line 70 of file feeder.h.

◆ FEEDRATE_MAX

#define FEEDRATE_MAX   0x7fffff /* sign 24bit ~ 8ghz ! */

Definition at line 113 of file feeder.h.

◆ FEEDRATE_MIN

#define FEEDRATE_MIN   1

Definition at line 112 of file feeder.h.

◆ FEEDRATE_RATEMAX

#define FEEDRATE_RATEMAX   2016000 /* 48000 * 42 */

Definition at line 111 of file feeder.h.

◆ FEEDRATE_RATEMIN

#define FEEDRATE_RATEMIN   1

Definition at line 110 of file feeder.h.

◆ FEEDRATE_ROUNDHZ

#define FEEDRATE_ROUNDHZ   25

Definition at line 114 of file feeder.h.

◆ FEEDRATE_ROUNDHZ_MAX

#define FEEDRATE_ROUNDHZ_MAX   500

Definition at line 116 of file feeder.h.

◆ FEEDRATE_ROUNDHZ_MIN

#define FEEDRATE_ROUNDHZ_MIN   0

Definition at line 115 of file feeder.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
FEEDER_ROOT 
FEEDER_FORMAT 
FEEDER_MIXER 
FEEDER_RATE 
FEEDER_EQ 
FEEDER_VOLUME 
FEEDER_MATRIX 
FEEDER_LAST 

Definition at line 81 of file feeder.h.

◆ anonymous enum

anonymous enum
Enumerator
FEEDFORMAT_CHANNELS 

Definition at line 93 of file feeder.h.

◆ anonymous enum

anonymous enum
Enumerator
FEEDMIXER_CHANNELS 

Definition at line 98 of file feeder.h.

◆ anonymous enum

anonymous enum
Enumerator
FEEDRATE_SRC 
FEEDRATE_DST 
FEEDRATE_QUALITY 
FEEDRATE_CHANNELS 

Definition at line 103 of file feeder.h.

◆ anonymous enum

anonymous enum
Enumerator
FEEDEQ_CHANNELS 
FEEDEQ_RATE 
FEEDEQ_TREBLE 
FEEDEQ_BASS 
FEEDEQ_PREAMP 
FEEDEQ_STATE 
FEEDEQ_DISABLE 
FEEDEQ_ENABLE 
FEEDEQ_BYPASS 
FEEDEQ_UNKNOWN 

Definition at line 124 of file feeder.h.

◆ anonymous enum

anonymous enum
Enumerator
FEEDVOLUME_CLASS 
FEEDVOLUME_CHANNELS 
FEEDVOLUME_STATE 
FEEDVOLUME_ENABLE 
FEEDVOLUME_BYPASS 

Definition at line 141 of file feeder.h.

Function Documentation

◆ chn_addfeeder()

int chn_addfeeder ( struct pcm_channel c,
struct feeder_class fc,
struct pcm_feederdesc desc 
)

Definition at line 238 of file feeder.c.

References c, desc, pcm_channel::feeder, feeder_create(), pcm_feeder::parent, and pcm_feeder::source.

Referenced by chn_init(), feeder_build_eq(), feeder_build_format(), feeder_build_matrix(), feeder_build_mixer(), feeder_build_rate(), feeder_build_root(), and feeder_build_volume().

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

◆ chn_findfeeder()

struct pcm_feeder * chn_findfeeder ( struct pcm_channel c,
u_int32_t  type 
)

◆ chn_removefeeder()

int chn_removefeeder ( struct pcm_channel c)

Definition at line 256 of file feeder.c.

References c, pcm_channel::feeder, feeder_destroy(), and pcm_feeder::source.

Referenced by chn_kill(), and feeder_chain().

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

◆ feeder_chain()

int feeder_chain ( struct pcm_channel c)

Definition at line 581 of file feeder_chain.c.

References feeder_chain_state::afmt, AFMT_24BIT, AFMT_32BIT, AFMT_CHANNEL, AFMT_CONVERTIBLE, AFMT_ENCODING, AFMT_EXTCHANNEL, feeder_chain_desc::afmt_ne, AFMT_PASSTHROUGH, pcm_channel::bufhard, pcm_channel::bufsoft, c, pcmchan_caps::caps, pcmchan_matrix::channels, CHN_BITPERFECT, CHN_DIRSTR, CHN_F_HAS_VCHAN, CHN_F_VIRTUAL, chn_getcaps(), CHN_LOCKASSERT, chn_removefeeder(), chn_syncstate(), feeder_chain_desc::current, pcm_channel::dev, pcm_channel::devinfo, pcm_channel::direction, feeder_chain_desc::dummy, feeder_chain_desc::expensive, pcmchan_matrix::ext, FEEDEQ_ECONOMY, FEEDEQ_REQUIRED, FEEDEQ_VALIDRATE, pcm_channel::feeder, FEEDER_BUILD, FEEDER_CHAIN_16, FEEDER_CHAIN_32, FEEDER_CHAIN_DEFAULT, feeder_chain_formats, FEEDER_CHAIN_FULLMULTI, FEEDER_CHAIN_LEAN, feeder_chain_mode, FEEDER_CHAIN_MULTI, feeder_default_matrix(), feeder_matrix_compare(), feeder_matrix_format_map(), pcm_channel::feederflags, FEEDFORMAT_NE_REQUIRED, FEEDFORMAT_REQUIRED, FEEDMATRIX_DOWN, FEEDMATRIX_REQUIRED, FEEDMATRIX_UP, FEEDRATE_DOWN, FEEDRATE_REQUIRED, FEEDRATE_UP, FEEDVOLUME_REQUIRED, pcm_channel::flags, snddev_info::flags, pcmchan_caps::fmtlist, format, pcm_channel::format, pcmchan_matrix::id, pcm_channel::matrix, feeder_chain_state::matrix, pcm_channel::matrix_scratch, pcm_channel::methods, mixer, feeder_chain_desc::mode, feeder_chain_desc::origin, pcm_channel::parentchannel, pcm_channel::parentsnddev, PCMDIR_PLAY, PCMDIR_REC, rate, feeder_chain_state::rate, SD_F_EQ, SD_F_EQ_PC, SD_F_SOFTPCMVOL, SD_F_VPC, SND_CHN_MATRIX_PCMCHANNEL, SND_CHN_MATRIX_UNKNOWN, snd_fmtbest(), snd_fmtvalid(), SND_FORMAT, sndbuf_getspd(), sndbuf_setfmt(), sndbuf_setspd(), pcm_channel::speed, feeder_chain_desc::target, feeder_chain_desc::use_eq, feeder_chain_desc::use_matrix, feeder_chain_desc::use_volume, and VCHAN_PASSTHROUGH.

Referenced by chn_setparam(), and vchan_sync().

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

◆ feeder_eq_initsys()

void feeder_eq_initsys ( device_t  dev)

Definition at line 664 of file feeder_eq.c.

References buf, dev, snddev_info::eqpreamp, feed_eq_scan_preamp_arg(), FEEDEQ_PREAMP_DEFAULT, FEEDEQ_PREAMP_INVALID, FEEDEQ_PREAMP_MAX, FEEDEQ_PREAMP_MIN, sysctl_dev_pcm_eq(), and sysctl_dev_pcm_eq_preamp().

Referenced by pcm_sysinit().

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

◆ feeder_eq_validrate()

int feeder_eq_validrate ( uint32_t  rate)

Definition at line 299 of file feeder_eq.c.

References feed_eq_coeff_rate(), and rate.

Referenced by feed_eq_set().

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

◆ feeder_getclass()

struct feeder_class * feeder_getclass ( struct pcm_feederdesc desc)

Definition at line 224 of file feeder.c.

References cmpdesc(), and desc.

Referenced by chn_init(), feeder_build_eq(), feeder_build_format(), feeder_build_matrix(), feeder_build_mixer(), feeder_build_rate(), feeder_build_root(), and feeder_build_volume().

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

◆ feeder_matrix_compare()

int feeder_matrix_compare ( struct pcmchan_matrix m_in,
struct pcmchan_matrix m_out 
)

◆ feeder_matrix_default_channel_map()

struct pcmchan_matrix * feeder_matrix_default_channel_map ( uint32_t  ch)

◆ feeder_matrix_default_format()

uint32_t feeder_matrix_default_format ( uint32_t  format)

Definition at line 591 of file feeder_matrix.c.

References AFMT_CHANNEL, AFMT_EXTCHANNEL, pcmchan_matrix::channels, pcmchan_matrix::ext, feeder_matrix_default_channel_map(), feeder_matrix_maps, format, m, SND_CHN_MATRIX_BEGIN, SND_CHN_MATRIX_END, and SND_FORMAT.

Referenced by uaudio_chan_fill_info_sub().

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

◆ feeder_matrix_default_id()

int feeder_matrix_default_id ( uint32_t  ch)

◆ feeder_matrix_format_id()

◆ feeder_matrix_format_map()

struct pcmchan_matrix * feeder_matrix_format_map ( uint32_t  format)

◆ feeder_matrix_id_map()

struct pcmchan_matrix * feeder_matrix_id_map ( int  id)

Definition at line 660 of file feeder_matrix.c.

References feeder_matrix_maps, and SND_CHN_MATRIX_END.

Referenced by chn_init().

Here is the caller graph for this function:

◆ feeder_matrix_oss_get_channel_order()

int feeder_matrix_oss_get_channel_order ( struct pcmchan_matrix m,
unsigned long long *  map 
)

Definition at line 742 of file feeder_matrix.c.

References pcmchan_matrix::channels, m, pcmchan_matrix::map, pcmchan_matrix::mask, SND_CHN_OSS_MAX, SND_CHN_OSS_VALIDMASK, SND_CHN_T_MAX, snd_chn_to_oss, and pcmchan_matrix::type.

Referenced by chn_oss_getorder().

Here is the caller graph for this function:

◆ feeder_matrix_oss_set_channel_order()

int feeder_matrix_oss_set_channel_order ( struct pcmchan_matrix m,
unsigned long long *  map 
)

◆ feeder_matrix_setup()

int feeder_matrix_setup ( struct pcm_feeder f,
struct pcmchan_matrix m_in,
struct pcmchan_matrix m_out 
)

Definition at line 542 of file feeder_matrix.c.

References pcm_feeder::data, pcm_feeder::desc, feed_matrix_setup(), FEEDER_MATRIX, and pcm_feederdesc::type.

Referenced by feeder_build_matrix().

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

◆ feeder_printchain()

void feeder_printchain ( struct pcm_feeder head)

Definition at line 442 of file feeder.c.

References pcm_feeder::class, pcm_feeder::desc, pcm_feederdesc::idx, and pcm_feeder::source.

◆ feeder_register()

void feeder_register ( void *  p)

◆ feeder_volume_apply_matrix()

◆ snd_fmtbest()

u_int32_t snd_fmtbest ( u_int32_t  fmt,
u_int32_t *  fmts 
)

Definition at line 408 of file feeder.c.

References AFMT_CHANNEL, fmt, fmts, score_val, snd_fmtbestbit(), snd_fmtbestchannel(), snd_fmtscore(), and snd_fmtvalid().

Referenced by chn_notify(), and feeder_chain().

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

◆ snd_fmtbestbit()

u_int32_t snd_fmtbestbit ( u_int32_t  fmt,
u_int32_t *  fmts 
)

Definition at line 396 of file feeder.c.

References fmt, fmts, and snd_fmtbestfunc().

Referenced by snd_fmtbest().

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

◆ snd_fmtbestchannel()

u_int32_t snd_fmtbestchannel ( u_int32_t  fmt,
u_int32_t *  fmts 
)

Definition at line 402 of file feeder.c.

References fmt, fmts, and snd_fmtbestfunc().

Referenced by snd_fmtbest().

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

◆ snd_fmtscore()

u_int32_t snd_fmtscore ( u_int32_t  fmt)

Definition at line 320 of file feeder.c.

References AFMT_16BIT, AFMT_24BIT, AFMT_32BIT, AFMT_8BIT, AFMT_BIGENDIAN, AFMT_CHANNEL, AFMT_SIGNED, and fmt.

Referenced by snd_fmtbest(), and snd_fmtbestfunc().

Here is the caller graph for this function:

Variable Documentation

◆ feeder_rate_max

◆ feeder_rate_min

◆ feeder_rate_quality

int feeder_rate_quality
extern

Definition at line 159 of file feeder_rate.c.

Referenced by sysctl_hw_snd_feeder_rate_quality(), and z_resampler_init().

◆ feeder_rate_round

int feeder_rate_round
extern