Lines Matching refs:state

15 	int (*process_frames)(struct libasound_state *state,
22 static int wait_for_avail(struct libasound_state *state)
31 err = snd_pcm_hw_params_get_buffer_time(state->hw_params,
38 err = xfer_libasound_wait_event(state, msec_per_buffer, &revents);
46 if (snd_pcm_stream(state->handle) == SND_PCM_STREAM_CAPTURE)
57 static int read_frames(struct libasound_state *state, unsigned int *frame_count,
61 struct rw_closure *closure = state->private_data;
77 handled_frame_count = snd_pcm_readi(state->handle,
81 handled_frame_count = snd_pcm_readn(state->handle,
107 static int r_process_frames_blocking(struct libasound_state *state,
119 avail = snd_pcm_avail(state->handle);
129 err = snd_pcm_sw_params_get_avail_min(state->sw_params,
137 err = snd_pcm_sw_params_get_start_threshold(state->sw_params,
145 err = read_frames(state, frame_count, avail_count, mapper, cntrs);
155 static int r_process_frames_nonblocking(struct libasound_state *state,
166 err = snd_pcm_start(state->handle);
171 if (state->use_waiter) {
172 err = wait_for_avail(state);
178 avail = snd_pcm_avail(state->handle);
191 err = read_frames(state, frame_count, avail_count, mapper, cntrs);
201 static int write_frames(struct libasound_state *state,
206 struct rw_closure *closure = state->private_data;
232 handled_frame_count = snd_pcm_writei(state->handle,
235 handled_frame_count = snd_pcm_writen(state->handle,
251 static int w_process_frames_blocking(struct libasound_state *state,
263 avail = snd_pcm_avail(state->handle);
274 err = snd_pcm_sw_params_get_avail_min(state->sw_params,
285 err = snd_pcm_sw_params_get_start_threshold(state->sw_params,
292 err = snd_pcm_hw_params_get_period_size(state->hw_params,
305 err = write_frames(state, frame_count, avail_count, mapper, cntrs);
315 static int w_process_frames_nonblocking(struct libasound_state *state,
325 if (state->use_waiter) {
326 err = wait_for_avail(state);
332 avail = snd_pcm_avail(state->handle);
345 err = write_frames(state, frame_count, avail_count, mapper, cntrs);
358 static int irq_rw_pre_process(struct libasound_state *state)
360 struct rw_closure *closure = state->private_data;
367 err = snd_pcm_hw_params_get_format(state->hw_params, &format);
374 err = snd_pcm_hw_params_get_channels(state->hw_params,
379 err = snd_pcm_hw_params_get_buffer_size(state->hw_params,
384 err = snd_pcm_hw_params_get_access(state->hw_params, &closure->access);
394 if (snd_pcm_stream(state->handle) == SND_PCM_STREAM_CAPTURE) {
395 if (state->nonblock)
400 if (state->nonblock)
409 static int irq_rw_process_frames(struct libasound_state *state,
414 struct rw_closure *closure = state->private_data;
418 status = snd_pcm_state(state->handle);
423 return closure->process_frames(state, status, frame_count, mapper, cntrs);
426 static void irq_rw_post_process(struct libasound_state *state)
428 struct rw_closure *closure = state->private_data;