Lines Matching defs:pcm
25 #include <sound/pcm.h>
181 static int snd_pcm_hw_param_mask(struct snd_pcm_substream *pcm,
190 int err = snd_pcm_hw_refine(pcm, params);
230 * @pcm: PCM instance
240 static int snd_pcm_hw_param_min(struct snd_pcm_substream *pcm,
249 int err = snd_pcm_hw_refine(pcm, params);
291 * @pcm: PCM instance
301 static int snd_pcm_hw_param_max(struct snd_pcm_substream *pcm,
310 int err = snd_pcm_hw_refine(pcm, params);
363 * @pcm: PCM instance
375 static int snd_pcm_hw_param_near(struct snd_pcm_substream *pcm,
405 min = snd_pcm_hw_param_min(pcm, params, var, min, &mindir);
416 max = snd_pcm_hw_param_max(pcm, params1, var, max, &maxdir);
425 max = snd_pcm_hw_param_max(pcm, params, var, max, &maxdir);
432 v = snd_pcm_hw_param_last(pcm, params, var, dir);
434 v = snd_pcm_hw_param_first(pcm, params, var, dir);
488 * @pcm: PCM instance
498 static int snd_pcm_hw_param_set(struct snd_pcm_substream *pcm,
507 int err = snd_pcm_hw_refine(pcm, params);
888 pcm_dbg(substream->pcm, "No usable accesses\n");
917 pcm_dbg(substream->pcm, "Cannot find a format!!!\n");
967 pcm_dbg(substream->pcm, "HW_PARAMS failed: %i\n", err);
977 pcm_dbg(substream->pcm,
985 pcm_dbg(substream->pcm,
1029 pcm_dbg(substream->pcm, "SW_PARAMS failed: %i\n", err);
1144 pcm_dbg(substream->pcm,
1231 pcm_dbg(substream->pcm,
1263 pcm_dbg(substream->pcm,
1306 pcm_dbg(substream->pcm,
1335 pcm_dbg(substream->pcm,
1612 pcm_dbg(substream->pcm, "sync1: size = %li\n", size);
1637 pcm_err(substream->pcm,
1674 pcm_dbg(substream->pcm, "sync: buffer_used\n");
1685 pcm_dbg(substream->pcm, "sync: period_ptr\n");
2303 pcm_dbg(substream->pcm,
2329 static void snd_pcm_oss_look_for_setup(struct snd_pcm *pcm, int stream,
2335 guard(mutex)(&pcm->streams[stream].oss.setup_mutex);
2337 for (setup = pcm->streams[stream].oss.setup_list; setup;
2404 struct snd_pcm *pcm,
2422 (pcm->info_flags & SNDRV_PCM_INFO_HALF_DUPLEX))
2429 if (! pcm->streams[idx].substream_count)
2438 err = snd_pcm_open_substream(pcm, idx, file, &substream);
2476 struct snd_pcm *pcm;
2486 pcm = snd_lookup_oss_minor_data(iminor(inode),
2488 if (pcm == NULL) {
2492 err = snd_card_file_add(pcm->card, file);
2495 if (!try_module_get(pcm->card->module)) {
2505 snd_pcm_oss_look_for_setup(pcm, SNDRV_PCM_STREAM_PLAYBACK,
2508 snd_pcm_oss_look_for_setup(pcm, SNDRV_PCM_STREAM_CAPTURE,
2516 add_wait_queue(&pcm->open_wait, &wait);
2517 mutex_lock(&pcm->open_mutex);
2519 err = snd_pcm_oss_open_file(file, pcm, &pcm_oss_file,
2531 mutex_unlock(&pcm->open_mutex);
2533 mutex_lock(&pcm->open_mutex);
2534 if (pcm->card->shutdown) {
2543 remove_wait_queue(&pcm->open_wait, &wait);
2544 mutex_unlock(&pcm->open_mutex);
2547 snd_card_unref(pcm->card);
2551 module_put(pcm->card->module);
2553 snd_card_file_remove(pcm->card, file);
2555 if (pcm)
2556 snd_card_unref(pcm->card);
2562 struct snd_pcm *pcm;
2572 pcm = substream->pcm;
2573 if (!pcm->card->shutdown)
2575 mutex_lock(&pcm->open_mutex);
2577 mutex_unlock(&pcm->open_mutex);
2578 wake_up(&pcm->open_wait);
2579 module_put(pcm->card->module);
2580 snd_card_file_remove(pcm->card, file);
2606 return snd_mixer_oss_ioctl_card(substream->pcm->card, cmd, arg);
2776 pcm_dbg(substream->pcm,
2797 pcm_dbg(substream->pcm, "pcm_oss: write %li bytes (wrote %li bytes)\n",
3054 static void snd_pcm_oss_proc_init(struct snd_pcm *pcm)
3059 struct snd_pcm_str *pstr = &pcm->streams[stream];
3062 entry = snd_info_create_card_entry(pcm->card, "oss", pstr->proc_root);
3078 static void snd_pcm_oss_proc_done(struct snd_pcm *pcm)
3082 struct snd_pcm_str *pstr = &pcm->streams[stream];
3089 static inline void snd_pcm_oss_proc_init(struct snd_pcm *pcm)
3092 static inline void snd_pcm_oss_proc_done(struct snd_pcm *pcm)
3114 static void register_oss_dsp(struct snd_pcm *pcm, int index)
3117 pcm->card, index, &snd_pcm_oss_f_reg,
3118 pcm) < 0) {
3119 pcm_err(pcm, "unable to register OSS PCM device %i:%i\n",
3120 pcm->card->number, pcm->device);
3124 static int snd_pcm_oss_register_minor(struct snd_pcm *pcm)
3126 pcm->oss.reg = 0;
3127 if (dsp_map[pcm->card->number] == (int)pcm->device) {
3130 register_oss_dsp(pcm, 0);
3131 duplex = (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream_count > 0 &&
3132 pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream_count &&
3133 !(pcm->info_flags & SNDRV_PCM_INFO_HALF_DUPLEX));
3134 sprintf(name, "%s%s", pcm->name, duplex ? " (DUPLEX)" : "");
3137 pcm->card->number,
3140 pcm->oss.reg++;
3141 pcm->oss.reg_mask |= 1;
3143 if (adsp_map[pcm->card->number] == (int)pcm->device) {
3144 register_oss_dsp(pcm, 1);
3145 pcm->oss.reg++;
3146 pcm->oss.reg_mask |= 2;
3149 if (pcm->oss.reg)
3150 snd_pcm_oss_proc_init(pcm);
3155 static int snd_pcm_oss_disconnect_minor(struct snd_pcm *pcm)
3157 if (pcm->oss.reg) {
3158 if (pcm->oss.reg_mask & 1) {
3159 pcm->oss.reg_mask &= ~1;
3161 pcm->card, 0);
3163 if (pcm->oss.reg_mask & 2) {
3164 pcm->oss.reg_mask &= ~2;
3166 pcm->card, 1);
3168 if (dsp_map[pcm->card->number] == (int)pcm->device) {
3170 snd_oss_info_unregister(SNDRV_OSS_INFO_DEV_AUDIO, pcm->card->number);
3173 pcm->oss.reg = 0;
3178 static int snd_pcm_oss_unregister_minor(struct snd_pcm *pcm)
3180 snd_pcm_oss_disconnect_minor(pcm);
3181 snd_pcm_oss_proc_done(pcm);