Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NVIDIA Jetson CEC Support #1

Open
aliubimov opened this issue Jul 29, 2020 · 0 comments
Open

NVIDIA Jetson CEC Support #1

aliubimov opened this issue Jul 29, 2020 · 0 comments

Comments

@aliubimov
Copy link
Owner

Looks like Jetson have hardware support of HDMI-CEC, according to NVIDIA Forum thread. With some changes to libCEC4 (and may be L4T kernel patch), it is possible to add support to Kodi

aliubimov pushed a commit that referenced this issue Nov 19, 2020
Previously, if the language addon was deleted for any reason, Kodi crashed on startup.

This adds a check that the add-on is actually there.

Here the backtrace about crash before:
```
\#0  CLangInfo::SetLanguage (this=0x55555ad37eb0, language="resource.language.de_de", reloadServices=false) at /home/alwin/Development/Kodi/kodi-Matrix/xbmc/LangInfo.cpp:670
\#1  0x0000555557ad51eb in CApplication::LoadLanguage (this=0x55555ad34c20, reload=false) at /home/alwin/Development/Kodi/kodi-Matrix/xbmc/Application.cpp:4915
\#2  0x0000555557abdbd0 in CApplication::Initialize (this=0x55555ad34c20) at /home/alwin/Development/Kodi/kodi-Matrix/xbmc/Application.cpp:737
\#3  0x0000555557635500 in XBMC_Run (renderGUI=true, params=...) at /home/alwin/Development/Kodi/kodi-Matrix/xbmc/platform/xbmc.cpp:46
\#4  0x0000555556e0b08c in main (argc=1, argv=0x7fffffffdf38) at /home/alwin/Development/Kodi/kodi-Matrix/xbmc/platform/posix/main.cpp:77
```
aliubimov pushed a commit that referenced this issue Nov 19, 2020
Building Kodi with asan+lsan+ubsan breaks with the following error:

=================================================================
==241706==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 69370335 byte(s) in 661 object(s) allocated from:
    #0 0x7fb290a737a7 in operator new[](unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.6+0xab7a7)
    #1 0x563e2bed8b09 in PNGDecoder::LoadFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, DecodedFrames&) (/build/kodi-18.8+dfsg1/kodi_build_x11/build/texturepacker/TexturePacker+0x17cb09)
    #2 0x563e2be71392 in DecoderManager::LoadFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, DecodedFrames&) (/build/kodi-18.8+dfsg1/kodi_build_x11/build/texturepacker/TexturePacker+0x115392)
    #3 0x563e2be7d1bf in createBundle(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double, unsigned int, bool) (/build/kodi-18.8+dfsg1/kodi_build_x11/build/texturepacker/TexturePacker+0x1211bf)
    #4 0x563e2be69990 in main (/build/kodi-18.8+dfsg1/kodi_build_x11/build/texturepacker/TexturePacker+0x10d990)
    #5 0x7fb28fbc7cc9 in __libc_start_main ../csu/libc-start.c:308

SUMMARY: AddressSanitizer: 69370335 byte(s) leaked in 661 allocation(s).

The root cause of the leak is decoder's FreeDecodedFrames never called.

This commit fixes the leak by refactoring the following aspects:

 * Introducing the pointer to decoder object in the decoded frame,
 * Changing IDecoder::FreeDecodedFrames to IDecoder::FreeDecodedFrame
   cleaning single frame at a time
 * Moving iteration over frames to DecoderManager::FreeDecodedFrames
 * Removing unnecessary DecodedFrames.user

Signed-off-by: Vasyl Gello <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant