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

Takashi Sakamoto o-takashi at sakamocchi.jp
Sun Jun 11 08:53:42 CEST 2017


On Jun 9 2017 22:27, Clemens Ladisch wrote:
> 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.

I forgot to add it to staging...

Furthermore, I realized that we should care of software IRQ context for 
OHCI 1394 context. Packets are handled and we need to abort PCM 
substream in this context.


Thanks

Takashi Sakaomto


More information about the Alsa-devel mailing list