toniebox-reverse-engineering / teddycloud

teddyCloud is an open source server replacement for the Boxine Cloud
https://toniebox-reverse-engineering.github.io/docs/tools/teddycloud/
GNU General Public License v2.0
404 stars 31 forks source link

Audio Encoder runs out of memory #139

Closed schoelst closed 5 months ago

schoelst commented 6 months ago

First off, thanks of creating TeddyCloud. This project is AMAZING!

Sadly the Audio Encoder on the website seems to run out of memory sometimes. The following error is then repeated over and over (seems to be stuck in an infinite loop):

ERROR|toniefile.c:0344:toniefile_encode| Not enough space in this block

This problem occurred reproducibly for some CD rips I tried to convert and it seems to correlate with the total length. For some CDs with up to ~40 min of total play time it worked.

I am running teddycloud release 0.35 in a docker container on a computer with 16Gb RAM. I don't think that the RAM is the problem, because I did not observe that it would run short at any point.

How can I get more insights? Is there a way to convert the audio locally for debugging and performance? - I am on MacOS, so only a command line version of TeddyBench would be an option.

schoelst commented 6 months ago

I tested around a little more and the problem seem to be individual songs. For these the encoding process runs into the error above a bunch of times. The error corresponds to the following case the following lines of code: https://github.com/toniebox-reverse-engineering/teddycloud/blob/21f9c08e3daa13dde35991f7f568674f2e98641f/src/toniefile.c#L342-L346

I am happy to help finding a fix, but sadly don't understand the code well enough yet.

Freneato commented 6 months ago

i have the same issue - see in the forum link to revvox forum

SciLor commented 5 months ago

You may try a different bitrate for those files, which is settable with v0.4.1

SciLor commented 5 months ago

As an alternative I have provided a possible fix with commit https://github.com/toniebox-reverse-engineering/teddycloud/commit/9100022d2f98d6a1b16d6b6b7bef6ec041a54b1f the build will be available on the develop tag as soon as it is build.

schoelst commented 5 months ago

Sorry for the late reply, was on vacation and could not check. The issue is solved for me in v0.4.3. Thanks!