* [PATCH v2 0/1] allow pause and resume during draining
[not found] <CGME20201104030800epcas2p1b74b02554b9174bfafb7ce21accd65f0@epcas2p1.samsung.com>
@ 2020-11-04 3:07 ` Gyeongtaek Lee
0 siblings, 0 replies; only message in thread
From: Gyeongtaek Lee @ 2020-11-04 3:07 UTC (permalink / raw)
To: 'Takashi Iwai', 'Jaroslav Kysela'
Cc: 'Pierre-Louis Bossart', alsa-devel, khw0178.kim, kimty,
lgirdwood, tiwai, 'Vinod Koul', hmseo, s47.kang,
pilsun.jang, tkjung
On Mon, 26 Oct 2020 18:01:33 +0100, Takashi Iwai wrote:
>On Mon, 26 Oct 2020 10:18:38 +0100,
>Gyeongtaek Lee wrote:
>>
>> With a stream with low bitrate, user can't pause or resume the stream
>> near the end of the stream because current ALSA doesn't allow it.
>> If the stream has very low bitrate enough to store whole stream into
>> the buffer, user can't do anything except stop the stream and then
>> restart it from the first because most of applications call draining
>> after sending last frame to the kernel.
>> If pause, resume are allowed during draining, user experience can be
>> enhanced.
>> To prevent malfunction in HW drivers which don't support pause
>> during draining, pause during draining will only work if HW driver
>> enable this feature explicitly by calling
>> snd_compr_use_pause_in_draining().
>>
>> Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
>> Cc: stable@vger.kernel.org
>
>Could you restart the new thread? It's been hanging too deeply and
>hard to read through.
>
>Since it's the revised patch, please give the revision number (v2 or
>such) and show what's different from the previous patches.
>
Ok. I'll send the patch again with [PATCH v2] prefix.
>About the changes:
>
>> +/**
>> + * snd_compr_use_pause_in_draining - Allow pause and resume in draining state
>> + * @substream: compress substream to set
>> + *
>> + * Allow pause and resume in draining state.
>> + * Only HW driver supports this transition can call this API.
>> + */
>> +static inline void snd_compr_use_pause_in_draining(
>> + struct snd_compr_stream *substream)
>> +{
>> + substream->device->use_pause_in_draining = true;
>> +}
>
>How to set the flag is an open question. A natural way would be to
>set it somehow at creating the component object, but currently there
>seems no way to pass any flags.
Could you explain more about what is your concerning?
For me, calling snd_compr_use_pause_in_draining() in open() callback of
snd_compr_ops was good enough.
I've tested it and it worked well on linux 5.4.
>
>
>thanks,
>
>Takashi
>
Gyeongtaek Lee (1):
ALSA: compress: allow pause and resume during draining
include/sound/compress_driver.h | 17 +++++++++++++
sound/core/compress_offload.c | 44 +++++++++++++++++++++++++++------
2 files changed, 53 insertions(+), 8 deletions(-)
base-commit: 3cea11cd5e3b00d91caf0b4730194039b45c5891
--
2.21.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-11-04 3:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20201104030800epcas2p1b74b02554b9174bfafb7ce21accd65f0@epcas2p1.samsung.com>
2020-11-04 3:07 ` [PATCH v2 0/1] allow pause and resume during draining Gyeongtaek Lee
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).