Re: [PATCH v2] ALSA: core: let low-level driver or userspace disable rewinds

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

 



Pierre-Louis Bossart wrote:
> On 6/12/17 1:50 AM, Clemens Ladisch wrote:
>> Subhransu S. Prusty wrote:
>>> Add new hw_params flag to explicitly tell driver that rewinds will never
>>> be used. [...]
>>
>>> +++ b/sound/core/pcm_native.c
>>> @@ -2521,6 +2523,9 @@ static snd_pcm_sframes_t snd_pcm_playback_rewind(struct snd_pcm_substream *subst
>>>      if (frames == 0)
>>>          return 0;
>>>
>>> +    if (runtime->no_rewinds)
>>> +        return 0;
>>
>> Doing a rewind when you've promised not to is an error.  So why doesn't
>> this return an error code?
>
> there were earlier patches where we switched from 0 to an error code
> based on Takashi's feedback. I am not that convinced that applications
> actually interpret signed frames as error codes and might interpret
> negative values literally

When the application has set SND_PCM_HW_PARAMS_NO_REWINDS, calling
snd_pcm_rewind() already is an error to begin with.  There's no point
in trying to make it work, you can just choose how it breaks.


Regards,
Clemens
_______________________________________________
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