RadioDroid icon indicating copy to clipboard operation
RadioDroid copied to clipboard

[WIP] Pre-Recording: Record and keep always the last ~30 seconds in RAM buffer

Open morckx opened this issue 6 years ago • 5 comments

Resolves #437

morckx avatar Apr 27 '19 22:04 morckx

Seems to work, but needs more testing and some configuration option.

morckx avatar Apr 27 '19 22:04 morckx

Some thoughts:

  1. Yes, option is a must. Also the length of buffer itself should also be an option, it doesn't take a lot of ram and copying memory is cheap.
  2. In many cases we know when song starts/ends so we can reset the buffer when a new song starts.
  3. Do not write to buffer when we are already recording.

werman avatar Apr 27 '19 22:04 werman

f2212c4 - probably does not belong here 36ecd91 - seems good 9afbe15 - could you elaborate what does this change?

werman avatar May 01 '19 10:05 werman

@morckx what's state of this PR? It's really useful feature

avently avatar Sep 14 '19 05:09 avently

@morckx what's state of this PR? It's really useful feature

I think so too, particularly, since recording currently starts with a delay of ExoPlayer's buffer size (~5s).

The only issue that was left in the discussion was to calculate the buffer size in seconds depending on individual streams' bitrates. Personally, I don't think that this is worth the effort as it will be an estimation only anyway and performance-wise it would make more sense to just have a fixed buffer size in bytes. I think I'll just keep it with bytes now and adapt it to the new settings.

When #495 is merged, we can maybe use the bitrate estimation from there to make the buffer size adjustable in secondes rather than kB – in a subsequent PR.

morckx avatar Sep 14 '19 09:09 morckx

in WIP too long, closing please create another PR if you want to work on it.

segler-alex avatar Oct 16 '23 11:10 segler-alex