espressif / esp-adf

Espressif Audio Development Framework
Other
1.54k stars 678 forks source link

Http_Stream resume behavior should restart at last read, not from beginning. (AUD-5571) #1239

Open rwrozelle opened 2 months ago

rwrozelle commented 2 months ago

Is your feature request related to a problem? Please describe. Pausing and Resuming a pipeline causes the url being read to restart from beginning.

Describe the solution you'd like Expected behavior would be for it to resume at same location the pause occurred, understand that this may need a "timeout" where if it waits that long, it closes the http connection and behavior reverts to what is happening now.

Describe alternatives you've considered I have not.

Please give as many details as you can. Include suggestions for useful APIs or interfaces if relevant. I've setup an audio pipeline http_stream_reader -> esp_encoder -> i2s_stream_writer. If I pause the pipeline and resume the pipeline, it starts over.

jason-mao commented 2 months ago

@rwrozelle The pipeline pause will close the element, resume is restart, refer to https://github.com/espressif/esp-adf/blob/218cf614e32c8f4ca8d62159f06f90176944cf92/components/audio_pipeline/audio_element.c#L311. I suggest you call the element_pause to pause i2s_stream_writer element only, do not use the pipeline_pause.

rwrozelle commented 2 months ago

Thank you!

On Tue, Jul 30, 2024 at 7:31 AM maojianxin @.***> wrote:

@rwrozelle https://github.com/rwrozelle The pipeline pause will close the element, resume is restart, refer to https://github.com/espressif/esp-adf/blob/218cf614e32c8f4ca8d62159f06f90176944cf92/components/audio_pipeline/audio_element.c#L311. I suggest you call the element_pause to pause i2s_stream_writer element only, do not use the pipeline_pause.

— Reply to this email directly, view it on GitHub https://github.com/espressif/esp-adf/issues/1239#issuecomment-2258130056, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACD2PE2GVQOTGTBPJM6VJFLZO52QBAVCNFSM6AAAAABLPBNKFSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJYGEZTAMBVGY . You are receiving this because you were mentioned.Message ID: @.***>