Lines Matching defs:snd
26 #define FILE_PCM_PLAYBACK "/dev/snd/pcmC0D0p"
27 #define FILE_PCM_CAPTURE "/dev/snd/pcmC0D0c"
28 #define FILE_CONTROL "/dev/snd/controlC0"
110 static int playback_default_hw_params(struct gaudio_snd_dev *snd)
112 struct snd_pcm_substream *substream = snd->substream;
122 snd->access = SNDRV_PCM_ACCESS_RW_INTERLEAVED;
123 snd->format = SNDRV_PCM_FORMAT_S16_LE;
124 snd->channels = 2;
125 snd->rate = 48000;
133 snd->access, 0);
135 snd->format, 0);
137 snd->channels, 0);
139 snd->rate, 0);
146 ERROR(snd->card,
153 snd->access = params_access(params);
154 snd->format = params_format(params);
155 snd->channels = params_channels(params);
156 snd->rate = params_rate(params);
160 INFO(snd->card,
162 snd->access, snd->format, snd->channels, snd->rate);
172 struct gaudio_snd_dev *snd = &card->playback;
173 struct snd_pcm_substream *substream = snd->substream;
194 result = snd_pcm_lib_write(snd->substream, buf, frames);
222 struct gaudio_snd_dev *snd;
228 snd = &card->control;
229 snd->filp = filp_open(fn_cntl, O_RDWR, 0);
230 if (IS_ERR(snd->filp)) {
231 int ret = PTR_ERR(snd->filp);
234 snd->filp = NULL;
237 snd->card = card;
240 snd = &card->playback;
241 snd->filp = filp_open(fn_play, O_WRONLY, 0);
242 if (IS_ERR(snd->filp)) {
244 snd->filp = NULL;
246 pcm_file = snd->filp->private_data;
247 snd->substream = pcm_file->substream;
248 snd->card = card;
249 playback_default_hw_params(snd);
252 snd = &card->capture;
253 snd->filp = filp_open(fn_cap, O_RDONLY, 0);
254 if (IS_ERR(snd->filp)) {
256 snd->substream = NULL;
257 snd->card = NULL;
259 pcm_file = snd->filp->private_data;
260 snd->substream = pcm_file->substream;
261 snd->card = card;
272 struct gaudio_snd_dev *snd;
275 snd = &gau->control;
276 if (!IS_ERR(snd->filp))
277 filp_close(snd->filp, current->files);
280 snd = &gau->playback;
281 if (!IS_ERR(snd->filp))
282 filp_close(snd->filp, current->files);
285 snd = &gau->capture;
286 if (!IS_ERR(snd->filp))
287 filp_close(snd->filp, current->files);