Ejemplo n.º 1
0
static int msm_pcm_playback_copy(struct snd_pcm_substream *substream, int a,
	snd_pcm_uframes_t hwoff, void __user *buf, snd_pcm_uframes_t frames)
{
	int rc = 1;
	int fbytes = 0;

	struct snd_pcm_runtime *runtime = substream->runtime;
	struct msm_audio *prtd = runtime->private_data;

	fbytes = frames_to_bytes(runtime, frames);
	rc = alsa_send_buffer(prtd, buf, fbytes, NULL);
	++copy_count;
	prtd->pcm_buf_pos += fbytes;
	if (copy_count == 1) {
		mutex_lock(&the_locks.lock);
		alsa_audio_configure(prtd);
		mutex_unlock(&the_locks.lock);
	}
	if ((prtd->running) && (msm_vol_ctl.update)) {
		rc = msm_audio_volume_update(PCMPLAYBACK_DECODERID,
				msm_vol_ctl.volume, msm_vol_ctl.pan);
		msm_vol_ctl.update = 0;
	}

	return  rc;
}
Ejemplo n.º 2
0
static int msm_pcm_playback_copy(struct snd_pcm_substream *substream, int a,
	snd_pcm_uframes_t hwoff, void __user *buf, snd_pcm_uframes_t frames)
{
	int rc = 1;
	int fbytes = 0;

	struct snd_pcm_runtime *runtime = substream->runtime;
	struct msm_audio *prtd = runtime->private_data;

	fbytes = frames_to_bytes(runtime, frames);
	rc = alsa_send_buffer(prtd, buf, fbytes, NULL);
	++copy_count;
	if (copy_count == 1) {
		mutex_lock(&the_locks.lock);
		alsa_audio_configure(prtd);
		mutex_unlock(&the_locks.lock);
	}
	return  rc;
}