Loading include/sound/pcm.h +8 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ struct snd_pcm_ops { unsigned long offset); int (*mmap)(struct snd_pcm_substream *substream, struct vm_area_struct *vma); int (*ack)(struct snd_pcm_substream *substream); int (*restart)(struct snd_pcm_substream *substream); }; /* Loading Loading @@ -117,6 +118,12 @@ struct snd_pcm_ops { #define SNDRV_PCM_POS_XRUN ((snd_pcm_uframes_t)-1) #define SNDRV_DMA_MODE (0) #define SNDRV_NON_DMA_MODE (1 << 0) #define SNDRV_RENDER_STOPPED (1 << 1) #define SNDRV_RENDER_RUNNING (1 << 2) /* If you change this don't forget to change rates[] table in pcm_native.c */ #define SNDRV_PCM_RATE_5512 (1<<0) /* 5512Hz */ #define SNDRV_PCM_RATE_8000 (1<<1) /* 8000Hz */ Loading Loading @@ -370,6 +377,7 @@ struct snd_pcm_runtime { unsigned int rate_num; unsigned int rate_den; unsigned int no_period_wakeup: 1; unsigned int render_flag; /* -- SW params -- */ int tstamp_mode; /* mmap timestamp is updated */ Loading sound/core/pcm_native.c +11 −0 Original line number Diff line number Diff line Loading @@ -2704,6 +2704,7 @@ static int snd_pcm_sync_ptr(struct snd_pcm_substream *substream, volatile struct snd_pcm_mmap_status *status; volatile struct snd_pcm_mmap_control *control; int err; snd_pcm_uframes_t hw_avail; memset(&sync_ptr, 0, sizeof(sync_ptr)); if (get_user(sync_ptr.flags, (unsigned __user *)&(_sync_ptr->flags))) Loading @@ -2726,6 +2727,16 @@ static int snd_pcm_sync_ptr(struct snd_pcm_substream *substream, control->avail_min = sync_ptr.c.control.avail_min; else sync_ptr.c.control.avail_min = control->avail_min; if (runtime->render_flag & SNDRV_NON_DMA_MODE) { hw_avail = snd_pcm_playback_hw_avail(runtime); if ((hw_avail >= runtime->start_threshold) && (runtime->render_flag & SNDRV_RENDER_STOPPED)) { if (substream->ops->restart) substream->ops->restart(substream); } } sync_ptr.s.status.state = status->state; sync_ptr.s.status.hw_ptr = status->hw_ptr; sync_ptr.s.status.tstamp = status->tstamp; Loading Loading
include/sound/pcm.h +8 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ struct snd_pcm_ops { unsigned long offset); int (*mmap)(struct snd_pcm_substream *substream, struct vm_area_struct *vma); int (*ack)(struct snd_pcm_substream *substream); int (*restart)(struct snd_pcm_substream *substream); }; /* Loading Loading @@ -117,6 +118,12 @@ struct snd_pcm_ops { #define SNDRV_PCM_POS_XRUN ((snd_pcm_uframes_t)-1) #define SNDRV_DMA_MODE (0) #define SNDRV_NON_DMA_MODE (1 << 0) #define SNDRV_RENDER_STOPPED (1 << 1) #define SNDRV_RENDER_RUNNING (1 << 2) /* If you change this don't forget to change rates[] table in pcm_native.c */ #define SNDRV_PCM_RATE_5512 (1<<0) /* 5512Hz */ #define SNDRV_PCM_RATE_8000 (1<<1) /* 8000Hz */ Loading Loading @@ -370,6 +377,7 @@ struct snd_pcm_runtime { unsigned int rate_num; unsigned int rate_den; unsigned int no_period_wakeup: 1; unsigned int render_flag; /* -- SW params -- */ int tstamp_mode; /* mmap timestamp is updated */ Loading
sound/core/pcm_native.c +11 −0 Original line number Diff line number Diff line Loading @@ -2704,6 +2704,7 @@ static int snd_pcm_sync_ptr(struct snd_pcm_substream *substream, volatile struct snd_pcm_mmap_status *status; volatile struct snd_pcm_mmap_control *control; int err; snd_pcm_uframes_t hw_avail; memset(&sync_ptr, 0, sizeof(sync_ptr)); if (get_user(sync_ptr.flags, (unsigned __user *)&(_sync_ptr->flags))) Loading @@ -2726,6 +2727,16 @@ static int snd_pcm_sync_ptr(struct snd_pcm_substream *substream, control->avail_min = sync_ptr.c.control.avail_min; else sync_ptr.c.control.avail_min = control->avail_min; if (runtime->render_flag & SNDRV_NON_DMA_MODE) { hw_avail = snd_pcm_playback_hw_avail(runtime); if ((hw_avail >= runtime->start_threshold) && (runtime->render_flag & SNDRV_RENDER_STOPPED)) { if (substream->ops->restart) substream->ops->restart(substream); } } sync_ptr.s.status.state = status->state; sync_ptr.s.status.hw_ptr = status->hw_ptr; sync_ptr.s.status.tstamp = status->tstamp; Loading