Lines Matching refs:pcm
181 static int snd_pcm_hw_param_mask(struct snd_pcm_substream *pcm, in snd_pcm_hw_param_mask() argument
190 int err = snd_pcm_hw_refine(pcm, params); in snd_pcm_hw_param_mask()
240 static int snd_pcm_hw_param_min(struct snd_pcm_substream *pcm, in snd_pcm_hw_param_min() argument
249 int err = snd_pcm_hw_refine(pcm, params); in snd_pcm_hw_param_min()
301 static int snd_pcm_hw_param_max(struct snd_pcm_substream *pcm, in snd_pcm_hw_param_max() argument
310 int err = snd_pcm_hw_refine(pcm, params); in snd_pcm_hw_param_max()
375 static int snd_pcm_hw_param_near(struct snd_pcm_substream *pcm, in snd_pcm_hw_param_near() argument
405 min = snd_pcm_hw_param_min(pcm, params, var, min, &mindir); in snd_pcm_hw_param_near()
418 max = snd_pcm_hw_param_max(pcm, params1, var, max, &maxdir); in snd_pcm_hw_param_near()
430 max = snd_pcm_hw_param_max(pcm, params, var, max, &maxdir); in snd_pcm_hw_param_near()
440 v = snd_pcm_hw_param_last(pcm, params, var, dir); in snd_pcm_hw_param_near()
442 v = snd_pcm_hw_param_first(pcm, params, var, dir); in snd_pcm_hw_param_near()
506 static int snd_pcm_hw_param_set(struct snd_pcm_substream *pcm, in snd_pcm_hw_param_set() argument
515 int err = snd_pcm_hw_refine(pcm, params); in snd_pcm_hw_param_set()
899 pcm_dbg(substream->pcm, "No usable accesses\n"); in snd_pcm_oss_change_params_locked()
928 pcm_dbg(substream->pcm, "Cannot find a format!!!\n"); in snd_pcm_oss_change_params_locked()
978 pcm_dbg(substream->pcm, "HW_PARAMS failed: %i\n", err); in snd_pcm_oss_change_params_locked()
988 pcm_dbg(substream->pcm, in snd_pcm_oss_change_params_locked()
996 pcm_dbg(substream->pcm, in snd_pcm_oss_change_params_locked()
1040 pcm_dbg(substream->pcm, "SW_PARAMS failed: %i\n", err); in snd_pcm_oss_change_params_locked()
1156 pcm_dbg(substream->pcm, in snd_pcm_oss_prepare()
1243 pcm_dbg(substream->pcm, in snd_pcm_oss_write3()
1275 pcm_dbg(substream->pcm, in snd_pcm_oss_read3()
1318 pcm_dbg(substream->pcm, in snd_pcm_oss_writev3()
1347 pcm_dbg(substream->pcm, in snd_pcm_oss_readv3()
1624 pcm_dbg(substream->pcm, "sync1: size = %li\n", size); in snd_pcm_oss_sync1()
1650 pcm_err(substream->pcm, in snd_pcm_oss_sync1()
1687 pcm_dbg(substream->pcm, "sync: buffer_used\n"); in snd_pcm_oss_sync()
1698 pcm_dbg(substream->pcm, "sync: period_ptr\n"); in snd_pcm_oss_sync()
2318 pcm_dbg(substream->pcm, in snd_pcm_oss_get_space()
2344 static void snd_pcm_oss_look_for_setup(struct snd_pcm *pcm, int stream, in snd_pcm_oss_look_for_setup() argument
2350 mutex_lock(&pcm->streams[stream].oss.setup_mutex); in snd_pcm_oss_look_for_setup()
2352 for (setup = pcm->streams[stream].oss.setup_list; setup; in snd_pcm_oss_look_for_setup()
2361 mutex_unlock(&pcm->streams[stream].oss.setup_mutex); in snd_pcm_oss_look_for_setup()
2420 struct snd_pcm *pcm, in snd_pcm_oss_open_file() argument
2438 (pcm->info_flags & SNDRV_PCM_INFO_HALF_DUPLEX)) in snd_pcm_oss_open_file()
2445 if (! pcm->streams[idx].substream_count) in snd_pcm_oss_open_file()
2454 err = snd_pcm_open_substream(pcm, idx, file, &substream); in snd_pcm_oss_open_file()
2492 struct snd_pcm *pcm; in snd_pcm_oss_open() local
2502 pcm = snd_lookup_oss_minor_data(iminor(inode), in snd_pcm_oss_open()
2504 if (pcm == NULL) { in snd_pcm_oss_open()
2508 err = snd_card_file_add(pcm->card, file); in snd_pcm_oss_open()
2511 if (!try_module_get(pcm->card->module)) { in snd_pcm_oss_open()
2521 snd_pcm_oss_look_for_setup(pcm, SNDRV_PCM_STREAM_PLAYBACK, in snd_pcm_oss_open()
2524 snd_pcm_oss_look_for_setup(pcm, SNDRV_PCM_STREAM_CAPTURE, in snd_pcm_oss_open()
2532 add_wait_queue(&pcm->open_wait, &wait); in snd_pcm_oss_open()
2533 mutex_lock(&pcm->open_mutex); in snd_pcm_oss_open()
2535 err = snd_pcm_oss_open_file(file, pcm, &pcm_oss_file, in snd_pcm_oss_open()
2547 mutex_unlock(&pcm->open_mutex); in snd_pcm_oss_open()
2549 mutex_lock(&pcm->open_mutex); in snd_pcm_oss_open()
2550 if (pcm->card->shutdown) { in snd_pcm_oss_open()
2559 remove_wait_queue(&pcm->open_wait, &wait); in snd_pcm_oss_open()
2560 mutex_unlock(&pcm->open_mutex); in snd_pcm_oss_open()
2563 snd_card_unref(pcm->card); in snd_pcm_oss_open()
2567 module_put(pcm->card->module); in snd_pcm_oss_open()
2569 snd_card_file_remove(pcm->card, file); in snd_pcm_oss_open()
2571 if (pcm) in snd_pcm_oss_open()
2572 snd_card_unref(pcm->card); in snd_pcm_oss_open()
2578 struct snd_pcm *pcm; in snd_pcm_oss_release() local
2588 pcm = substream->pcm; in snd_pcm_oss_release()
2589 if (!pcm->card->shutdown) in snd_pcm_oss_release()
2591 mutex_lock(&pcm->open_mutex); in snd_pcm_oss_release()
2593 mutex_unlock(&pcm->open_mutex); in snd_pcm_oss_release()
2594 wake_up(&pcm->open_wait); in snd_pcm_oss_release()
2595 module_put(pcm->card->module); in snd_pcm_oss_release()
2596 snd_card_file_remove(pcm->card, file); in snd_pcm_oss_release()
2622 return snd_mixer_oss_ioctl_card(substream->pcm->card, cmd, arg); in snd_pcm_oss_ioctl()
2792 pcm_dbg(substream->pcm, in snd_pcm_oss_read()
2813 pcm_dbg(substream->pcm, "pcm_oss: write %li bytes (wrote %li bytes)\n", in snd_pcm_oss_write()
3075 static void snd_pcm_oss_proc_init(struct snd_pcm *pcm) in snd_pcm_oss_proc_init() argument
3080 struct snd_pcm_str *pstr = &pcm->streams[stream]; in snd_pcm_oss_proc_init()
3083 entry = snd_info_create_card_entry(pcm->card, "oss", pstr->proc_root); in snd_pcm_oss_proc_init()
3099 static void snd_pcm_oss_proc_done(struct snd_pcm *pcm) in snd_pcm_oss_proc_done() argument
3103 struct snd_pcm_str *pstr = &pcm->streams[stream]; in snd_pcm_oss_proc_done()
3110 static inline void snd_pcm_oss_proc_init(struct snd_pcm *pcm) in snd_pcm_oss_proc_init() argument
3113 static inline void snd_pcm_oss_proc_done(struct snd_pcm *pcm) in snd_pcm_oss_proc_done() argument
3136 static void register_oss_dsp(struct snd_pcm *pcm, int index) in register_oss_dsp() argument
3139 pcm->card, index, &snd_pcm_oss_f_reg, in register_oss_dsp()
3140 pcm) < 0) { in register_oss_dsp()
3141 pcm_err(pcm, "unable to register OSS PCM device %i:%i\n", in register_oss_dsp()
3142 pcm->card->number, pcm->device); in register_oss_dsp()
3146 static int snd_pcm_oss_register_minor(struct snd_pcm *pcm) in snd_pcm_oss_register_minor() argument
3148 pcm->oss.reg = 0; in snd_pcm_oss_register_minor()
3149 if (dsp_map[pcm->card->number] == (int)pcm->device) { in snd_pcm_oss_register_minor()
3152 register_oss_dsp(pcm, 0); in snd_pcm_oss_register_minor()
3153 duplex = (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream_count > 0 && in snd_pcm_oss_register_minor()
3154 pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream_count && in snd_pcm_oss_register_minor()
3155 !(pcm->info_flags & SNDRV_PCM_INFO_HALF_DUPLEX)); in snd_pcm_oss_register_minor()
3156 sprintf(name, "%s%s", pcm->name, duplex ? " (DUPLEX)" : ""); in snd_pcm_oss_register_minor()
3159 pcm->card->number, in snd_pcm_oss_register_minor()
3162 pcm->oss.reg++; in snd_pcm_oss_register_minor()
3163 pcm->oss.reg_mask |= 1; in snd_pcm_oss_register_minor()
3165 if (adsp_map[pcm->card->number] == (int)pcm->device) { in snd_pcm_oss_register_minor()
3166 register_oss_dsp(pcm, 1); in snd_pcm_oss_register_minor()
3167 pcm->oss.reg++; in snd_pcm_oss_register_minor()
3168 pcm->oss.reg_mask |= 2; in snd_pcm_oss_register_minor()
3171 if (pcm->oss.reg) in snd_pcm_oss_register_minor()
3172 snd_pcm_oss_proc_init(pcm); in snd_pcm_oss_register_minor()
3177 static int snd_pcm_oss_disconnect_minor(struct snd_pcm *pcm) in snd_pcm_oss_disconnect_minor() argument
3179 if (pcm->oss.reg) { in snd_pcm_oss_disconnect_minor()
3180 if (pcm->oss.reg_mask & 1) { in snd_pcm_oss_disconnect_minor()
3181 pcm->oss.reg_mask &= ~1; in snd_pcm_oss_disconnect_minor()
3183 pcm->card, 0); in snd_pcm_oss_disconnect_minor()
3185 if (pcm->oss.reg_mask & 2) { in snd_pcm_oss_disconnect_minor()
3186 pcm->oss.reg_mask &= ~2; in snd_pcm_oss_disconnect_minor()
3188 pcm->card, 1); in snd_pcm_oss_disconnect_minor()
3190 if (dsp_map[pcm->card->number] == (int)pcm->device) { in snd_pcm_oss_disconnect_minor()
3192 snd_oss_info_unregister(SNDRV_OSS_INFO_DEV_AUDIO, pcm->card->number); in snd_pcm_oss_disconnect_minor()
3195 pcm->oss.reg = 0; in snd_pcm_oss_disconnect_minor()
3200 static int snd_pcm_oss_unregister_minor(struct snd_pcm *pcm) in snd_pcm_oss_unregister_minor() argument
3202 snd_pcm_oss_disconnect_minor(pcm); in snd_pcm_oss_unregister_minor()
3203 snd_pcm_oss_proc_done(pcm); in snd_pcm_oss_unregister_minor()