[alsa-devel] [PATCH v2] ALSA: firewire-lib: Fix stall of process context at packet error

Clemens Ladisch clemens at ladisch.de
Fri Jun 9 15:27:31 CEST 2017


Takashi Sakamoto wrote:
> ---
>  sound/firewire/amdtp-stream.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c
> index 9678bc75dc5b..de4f6b6dbd47 100644
> --- a/sound/firewire/amdtp-stream.c
> +++ b/sound/firewire/amdtp-stream.c
> @@ -701,7 +701,7 @@ static void out_stream_callback(struct fw_iso_context *context, u32 tstamp,
>  		cycle = increment_cycle_count(cycle, 1);
>  		if (s->handle_packet(s, 0, cycle, i) < 0) {
>  			s->packet_index = -1;
> -			amdtp_stream_pcm_abort(s);
> +			WRITE_ONCE(s->pcm_buffer_pointer, SNDRV_PCM_POS_XRUN);
>  			return;
>  		}
>  	}
> @@ -753,7 +753,7 @@ static void in_stream_callback(struct fw_iso_context *context, u32 tstamp,
>  	/* Queueing error or detecting invalid payload. */
>  	if (i < packets) {
>  		s->packet_index = -1;
> -		amdtp_stream_pcm_abort(s);
> +		WRITE_ONCE(s->pcm_buffer_pointer, SNDRV_PCM_POS_XRUN);
>  		return;
>  	}

SNDRV_PCM_POS_XRUN has type unsigned long and might not fit into an unsigned int.


Regards,
Clemens


More information about the Alsa-devel mailing list