Code Monkey home page Code Monkey logo

Comments (13)

nickfujita avatar nickfujita commented on August 28, 2024

While investigating support for use in a Google Chromecast Receiver application, I think that this issue might be applicable. When running the library in conjunction with video playback, the application quickly comes to a halt, and soon after crashes the device. Looking more into the issue, I was not able to capture a memory heap snapshot while on device because the device gets locked up before the snapshot is completed. However, when running in a desktop chrome browser, I am seeing an average heap snapshot of 140MB with it's majority allocation seemingly placed on the buffer.

image

While not sure if this is potentially a use case for the changes to cache size, and making it configurable, but thought it might be worth mentioning. If the cache size could be made configurable on initialization, it might be worth investigating, as I believe it's ideal to keep total memory usage on a Chromecast device well below 150MB total (which includes running the video player and handlers which is roughly 95MB on it's own).

from javascriptsubtitlesoctopus.

nickfujita avatar nickfujita commented on August 28, 2024

I also tested this using only asm.js, and the results appear to be roughly the same. Would reducing the default cache size, also result in allowing us to configure a mix cache buffer size? If so, how might this affect rendering performance?

from javascriptsubtitlesoctopus.

Dador avatar Dador commented on August 28, 2024

Reducing cache limit via ass_set_cache_limits (source) should result in lower memory usage.
You could try it by adding call like ass_set_cache_limits(ass_renderer, 0, 64); in build/subtitles-octopus/subtitles-octopus-worker.c:41
(this example will leave cached glyphs limit as default and will set cache limit to 64MB overall)

You can experiment with cache size (and maybe add pull request with setting for it πŸ˜‰).

If so, how might this affect rendering performance?

I'm not sure, maybe it could affect complex karaoke performance or something like this. But I think performance would be same for ordinary substitles.

Also, don't forget to change TOTAL_MEMORY in Makefile. It's 128MB right now. We use ALLOW_MEMORY_GROWTH so it'll work even with very low value but it's better to select something adequate.

from javascriptsubtitlesoctopus.

nickfujita avatar nickfujita commented on August 28, 2024

I am trying to run the library locally to make these updates, but run into the following error upon initial running on the repo as is:

image

I installed emscripten and it's dependencies, also ran source ./emsdk_env.sh in the terminal I was working in before navigating to this repo's folder. Is this expected?

from javascriptsubtitlesoctopus.

Dador avatar Dador commented on August 28, 2024

Try to update submodules.
You can do it using command:

git submodule update --init --recursive

from javascriptsubtitlesoctopus.

nickfujita avatar nickfujita commented on August 28, 2024

Ran the commend to update submodules, but had no affect as I just did a fresh clone with:
git clone --recursive -j8 [email protected]:Dador/JavascriptSubtitlesOctopus.git

Ran make again, and still same message.

from javascriptsubtitlesoctopus.

Dador avatar Dador commented on August 28, 2024

Does files from patches exists? If not, you should look for the reasons of it, because they are indeed in git repo.

from javascriptsubtitlesoctopus.

nickfujita avatar nickfujita commented on August 28, 2024

I've confirmed that the patch files do exist, but it looks like the error is occurring when running the fribidi-fixclang.patch file. It somehow seems that while running this patch file it is not able to properly locate lib/common.h?

I ran this same procedure on another computer to make sure it was not something wrong with my setup, and got the same results. Are you not seeing the same thing on your end when doing a fresh copy of the repo running git clone --recursive -j8 [email protected]:Dador/JavascriptSubtitlesOctopus.git, cd JavascriptSubtitleOctopus, make?

Update: I was able to run make once, apply the fribidi-fixclang.patch manually, remove

git reset --hard && \
patch -p1 < ../fribidi-make.patch && \
patch -p1 < ../fribidi-fixclang.patch && \

from the top level Makefile, and the script gets past the previous section, however now it seems to have the following error:

checking the archiver (/Users/.../emsdk-portable/emscripten/1.37.28/emar) interface... ar
./configure: line 4222: syntax error near unexpected token `2.2'
./configure: line 4222: `LT_PREREQ(2.2)'
ERROR:root:Configure step failed with non-zero return code 2! Command line: ['./configure', 'CFLAGS=-O3', 'NM=llvm-nm', '--prefix=/Users/.../JavascriptSubtitlesOctopus/build/fribidi/dist', '--host=x86-none-linux', '--build=x86_64', '--disable-dependency-tracking', '--disable-debug', '--without-glib', '--disable-pthreads'] at /Users/.../JavascriptSubtitlesOctopus/build/fribidi

Does it matter what version of emscripten is used to compile this project?

from javascriptsubtitlesoctopus.

TFSThiagoBR98 avatar TFSThiagoBR98 commented on August 28, 2024

@nickfujita I think you forgot to install LLVM and clang, use the latest version of Emscripten

from javascriptsubtitlesoctopus.

nickfujita avatar nickfujita commented on August 28, 2024

@TFSThiagoBR98 Thanks for the tip, I check to make sure I have LLVM and clang installed

gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.4.0
Thread model: posix

And updated to the latest version of Emscripten, emscripten-1.37.36.

However I am still back to getting the same error during patching:

make
cd build/fribidi && \
	git reset --hard && \
	patch -p1 < ../0001-Fix-Fribidi-Build.patch && \
	patch -p1 < ../fribidi-fixclang.patch && \
	NOCONFIGURE=1 ./autogen.sh
HEAD is now at 0cecb9e Version 2018.02.1
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/Makefile.am b/Makefile.am
|index 4767d69..3dba0d8 100644
|--- a/Makefile.am
|+++ b/Makefile.am
--------------------------
File to patch: 

After pressing return to skip, it just errors out in the same way:

File to patch: 
Skip this patch? [y] 
Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 18
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/gen.tab/Makefile.am b/gen.tab/Makefile.am
|index d178fc9..a8d4dc5 100644
|--- a/gen.tab/Makefile.am
|+++ b/gen.tab/Makefile.am
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
1 out of 1 hunk ignored
make: *** [build/fribidi/configure] Error 1

from javascriptsubtitlesoctopus.

TFSThiagoBR98 avatar TFSThiagoBR98 commented on August 28, 2024

HEAD is now at 0cecb9e Version 2018.02.1

@nickfujita Did you checkout submodules? This is not Fribidi Git Commit Hash.

  • If Yes, check if a .git file exist in fribidi directory.

from javascriptsubtitlesoctopus.

nickfujita avatar nickfujita commented on August 28, 2024

@TFSThiagoBR98 I cloned down with:
git clone --recursive -j8 [email protected]:Dador/JavascriptSubtitlesOctopus.git

There is a .git file in the bribidi directory, it's contents are:

gitdir: ../../.git/modules/build/fribidi

This top level git directory also exists at that path, has several subdirectories files:
image

With the contents of the HEAD file being:
0efbaa9052320a951823a6e776b30a580e3a2b4e

Is there a setup step that I may have missed?

from javascriptsubtitlesoctopus.

nickfujita avatar nickfujita commented on August 28, 2024

Not sure where to go from here. Would really like to help to contribute to this repo, but the patches appear to not be working correctly. :(

from javascriptsubtitlesoctopus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.