Re: [PATCH v6 2/4] ALSA: compress: Add function to indicate the stream has gone bad

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 22, 2016 at 04:15:24PM +0100, Charles Keepax wrote:
> Currently, the avail IOCTL doesn't pass any error status, which
> means typically on error it simply shows no data available. This
> can lead to situations where user-space is waiting indefinitely
> for data that will never come as the DSP has suffered an
> unrecoverable error.
> 
> Add snd_compr_stop_error which end drivers can call to indicate
> the stream has suffered an unrecoverable error and stop it. The
> avail and poll IOCTLs are then updated to report if the stream is
> in an error state to user-space. Allowing the error to propagate
> out. Processing of the actual snd_compr_stop needs to be deferred
> to a worker thread as the end driver may detect the errors during
> an existing operation callback.
> 
> Signed-off-by: Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
> Acked-by: Vinod Koul <vinod.koul@xxxxxxxxx>
> ---
> @@ -400,10 +418,18 @@ static unsigned int snd_compr_poll(struct file *f, poll_table *wait)
>  		return -EFAULT;
>  
>  	mutex_lock(&stream->device->lock);
> -	if (stream->runtime->state == SNDRV_PCM_STATE_OPEN) {
> +
> +	switch (stream->runtime->state) {
> +	case SNDRV_PCM_STATE_OPEN:
>  		retval = -EBADFD;
>  		goto out;
> +	case SNDRV_PCM_STATE_XRUN:
> +		retval = -EPIPE;
> +		goto out;
> +	default:
> +		break;
>  	}

One more issue to fix up before we can submit these I am afraid.
We can't return negative values from snd_compr_poll, I need to
fix both the original -EBADFD and the -EPIPE that my patch adds
here.

I will do a new rev of the patches shortly, sorry about missing
this until now.

Thanks,
Charles
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux