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

Lagging/Stuterring during playback #10

Open
Lazmarr opened this issue Nov 6, 2017 · 24 comments
Open

Lagging/Stuterring during playback #10

Lazmarr opened this issue Nov 6, 2017 · 24 comments

Comments

@Lazmarr
Copy link

Lazmarr commented Nov 6, 2017

Playback lags and stutters. I have confirmed it is only with the Steam Link.
Tried the same files on the Firestick/Firebox and no issues with playback.
Has anyone got a solution for this?

@solenum
Copy link

solenum commented Nov 8, 2017

Hi,

I've just installed this and have come across the same issues, I get a lot of artifacting and stuff, looks like the bitrate is ass but the media plays fine on other devices.

I'm getting the media from a SMB/samba server running locally, if I play the media on another device/computer (still from the SMB share) it runs perfectly fine.

Specifically, its like parts of the video simply arent updating, often it will go from a light to dark scene and the video will appear a little brighter than it should and then it will update to look correct to some extent.

This is with a large range of media types, with mp4 I get this artifacting, with mkv I seem to get a lot of audio de-sync, its pretty rough.

@whise
Copy link

whise commented Nov 18, 2017

I notice that if you set kodi buffer cache to zero you get much less lag and audio de-sync....

@henkall
Copy link

henkall commented Nov 19, 2017

how did you do that? @whise

@whise
Copy link

whise commented Nov 19, 2017

Install the "maintenance addon" it's available in any number of sites.

@solenum
Copy link

solenum commented Nov 19, 2017

@whise any way to do this without a plugin?

@whise
Copy link

whise commented Nov 19, 2017

Yeah sure if you can access the filesystem.

Here is a guide, but there is plenty more on kodi wiki and google

http://androidpcreview.com/fix-kodi-buffering-problems-heres-how-to-modify-the-kodi-cache/2611/

@savely-krasovsky
Copy link

savely-krasovsky commented Dec 31, 2017

Well, is there some solution? Kodi on Steam Link literally still unusable. All videos lagging and shuttering.

@solenum
Copy link

solenum commented Dec 31, 2017

I never found a solution and gave up on using this until the issues are fixed.

The lagging/stuttering/artifacting was just to much to make viewing videos enjoyable.

@SNWRbxT
Copy link

SNWRbxT commented Jan 2, 2018

Bought one of these on the steam sale.

After failing to find any rs232 points on the board with my limited EE skills I decided to give the native build a chance!

Had the same video and audio playback issues mentioned in this thread.

What I did:

<advancedsettings>
<cache>
<buffermode>1</buffermode>
<memorysize>20971520</memorysize>
<readfactor>20</readfactor>
</cache>
</advancedsettings>

  • The cache settings fixed the video lag, and I would say it is perfect (tested >4GB x264 files over smb). But I was using a USB audio device for 5.1 and was still getting audio sync issues. After disabling this and switching back to audio over HDMI from the steam link settings I had acceptable audio and video for a $5 device.

Also - regarding key based SSH access on the device:

https://blogger.davidmanouchehri.com/2017/12/steam-link-security-truncated-password.html
DES being used for BusyBox, and truncates passwords to have a length of only the first 8 characters.
As a temporary fix (provided by Evan Powers), users can manually force the root account to use SHA512 instead.
passwd -a sha512 root

/etc/ssh/sshd_config:

PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys

after the usual steps you will need to fix the permissions for ssh to be happy:
chmod 755 /home/steam/
chmod 700 /home/steam/.ssh
chmod 600 /home/steam/.ssh/authorized_keys

YMMV

Thanks garbear for taking the time to maintain this build.

garbear pushed a commit that referenced this issue Jun 15, 2018
This was missing in commit 61dfb26

Found by GCC/ASAN:

 ASAN:DEADLYSIGNAL
 =================================================================
 ==3618==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x556a3a027be2 bp 0x7f517d4d2140 sp 0x7f517d4d2120 T41)
 ==3618==The signal is caused by a READ memory access.
 ==3618==Hint: address points to the zero page.
     #0 0x556a3a027be1 in VideoPicture::operator=(VideoPicture const&) (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x22dfbe1)
     #1 0x556a3a026e24 in VideoPicture::SetParams(VideoPicture const&) (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x22dee24)
     #2 0x556a3a061ebe in VAAPI::CVaapiDecodedPicture::operator=(VAAPI::CVaapiDecodedPicture const&) (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x2319ebe)
     #3 0x556a3a061e75 in VAAPI::CVaapiDecodedPicture::CVaapiDecodedPicture(VAAPI::CVaapiDecodedPicture const&) (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x2319e75)
     #4 0x556a3a0514d3 in VAAPI::COutput::Flush() (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x23094d3)
     #5 0x556a3a04eff4 in VAAPI::COutput::StateMachine(int, Actor::Protocol*, Actor::Message*) (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x2306ff4)
     #6 0x556a3a050752 in VAAPI::COutput::Process() (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x2308752)
     #7 0x556a3a82ca0c in CThread::Action() (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x2ae4a0c)
     #8 0x556a3a82c0f8 in CThread::staticThread(void*) (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x2ae40f8)
     #9 0x7f51a8e7f5a9 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x75a9)
     #10 0x7f51a0288cbe in __clone (/lib/x86_64-linux-gnu/libc.so.6+0xf6cbe)
garbear pushed a commit that referenced this issue Jun 15, 2018
Class `CBusyWaiter` derives from `CThread`, and its only instance
lives in the stack frame of `CGUIDialogBusy::Wait()`.

Commit cc8364a triggered an ancient
Kodi crash bug based on a misunderstanding how destructors work in
C++, introduced in commit 64427d4
(coincidentally by the same author).

Anyway, that commit cc8364a changed
how cancellation gets triggered, making it more likely.  And if that
cancellation happens, nobody takes care for stopping the CThread
properly; `~CThread()` calls `StopThread()`, but by then, the
`CBusyWaiter` instance has already been morphed back to its base class
`CThread`.  This however triggers the crash in the still-running
thread.

This class morphing while calling destructors is what makes the whole
`~CThread()` implementation wrong from the bottom: calling
`StopThread()` from the base class destructor can never ever work
properly, because it will crash the thread in any case.  And if no
thread were running anymore, the call would be useless.

All uses of `CThread` without additional calls to `StopThread()` are a
crash bug, but this commit fixes only the instance in class
`CBusyWaiter`, by adding another `StopThread()` call to its
destructor.

This is how the crash looks like:

```
Thread 1 (Thread 0x7ff1d37fe700 (LWP 1394)):
#0  __GI___pthread_mutex_lock (mutex=0x66657270747265d3) at ../nptl/pthread_mutex_lock.c:65
#1  0x0000562afcf3352c in (anonymous namespace)::CRecursiveMutex::lock (this=0x66657270747265d3) at xbmc/threads/platform/RecursiveMutex.h:45
#2  0x0000562afcf34618 in (anonymous namespace)::CountingLockable<XbmcThreads::CRecursiveMutex>::lock (this=0x66657270747265d3) at xbmc/threads/Lockables.h:63
#3  0x0000562afcf34466 in (anonymous namespace)::UniqueLock<CCriticalSection>::UniqueLock (this=0x7ff1d37fdb80, lockable=...) at xbmc/threads/Lockables.h:132
#4  0x0000562afcf3356f in CSingleLock::CSingleLock (this=0x7ff1d37fdb80, cs=...) at xbmc/threads/SingleLock.h:38
#5  0x0000562afd4ee7c7 in (anonymous namespace)::CEventGroup::Set (this=0x6665727074726563, child=0x7ffeca201060) at xbmc/threads/Event.h:127
#6  0x0000562afd4ee2db in CEvent::Set (this=0x7ffeca201060) at xbmc/threads/Event.cpp:70
#7  0x0000562afd4f16ff in CThread::staticThread (data=0x7ffeca200f80) at xbmc/threads/Thread.cpp:133
#8  0x00007ff20bd955aa in start_thread (arg=0x7ff1d37fe700) at pthread_create.c:463
#9  0x00007ff20321acbf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
```

And this is the thread which created the `CBusyWaiter` (at the time of
the crash it had already moved on):

```
Thread 19 (Thread 0x7ff20c191980 (LWP 1353)):
#0  0x00007ff209da1c83 in ?? () from /usr/lib/x86_64-linux-gnu/libsqlite3.so.0
#1  0x00007ff209d9c3c6 in ?? () from /usr/lib/x86_64-linux-gnu/libsqlite3.so.0
#2  0x00007ff209dcc0ab in ?? () from /usr/lib/x86_64-linux-gnu/libsqlite3.so.0
#3  0x00007ff209dd0c9e in ?? () from /usr/lib/x86_64-linux-gnu/libsqlite3.so.0
#4  0x00007ff209dd11fe in ?? () from /usr/lib/x86_64-linux-gnu/libsqlite3.so.0
#5  0x00007ff209dd1526 in sqlite3_prepare_v2 () from /usr/lib/x86_64-linux-gnu/libsqlite3.so.0
#6  0x0000562afd755a56 in (anonymous namespace)::SqliteDataset::query (this=0x562b03898080, query=...) at xbmc/dbwrappers/sqlitedataset.cpp:649
#7  0x0000562afd33a824 in CVideoDatabase::GetScraperForPath (this=0x562b02530f00, strPath=..., settings=..., foundDirectly=@0x7ffeca201b6f: false) at xbmc/video/VideoDatabase.cpp:7297
#8  0x0000562afd33b831 in CVideoDatabase::GetContentForPath (this=0x562b02530f00, strPath=...) at xbmc/video/VideoDatabase.cpp:7426
#9  0x0000562afd27dc6c in CGUIWindowVideoNav::LoadVideoInfo (items=..., database=..., allowReplaceLabels=true) at xbmc/video/windows/GUIWindowVideoNav.cpp:578
#10 0x0000562afd27db95 in CGUIWindowVideoNav::LoadVideoInfo (this=0x562b02530760, items=...) at xbmc/video/windows/GUIWindowVideoNav.cpp:564
#11 0x0000562afd27ce81 in CGUIWindowVideoNav::GetDirectory (this=0x562b02530760, strDirectory=..., items=...) at xbmc/video/windows/GUIWindowVideoNav.cpp:545
#12 0x0000562afd3b4e35 in CGUIMediaWindow::Update (this=0x562b02530760, strDirectory=..., updateFilterPath=true) at xbmc/windows/GUIMediaWindow.cpp:806
#13 0x0000562afd274a96 in CGUIWindowVideoBase::Update (this=0x562b02530760, strDirectory=..., updateFilterPath=true) at xbmc/video/windows/GUIWindowVideoBase.cpp:1247
#14 0x0000562afd27ae04 in CGUIWindowVideoNav::Update (this=0x562b02530760, strDirectory=..., updateFilterPath=true) at xbmc/video/windows/GUIWindowVideoNav.cpp:340
#15 0x0000562afd3b6e91 in CGUIMediaWindow::OnClick (this=0x562b02530760, iItem=2, player=...) at xbmc/windows/GUIMediaWindow.cpp:1072
#16 0x0000562afd270a66 in CGUIWindowVideoBase::OnClick (this=0x562b02530760, iItem=2, player=...) at xbmc/video/windows/GUIWindowVideoBase.cpp:609
#17 0x0000562afd283ec0 in CGUIWindowVideoNav::OnClick (this=0x562b02530760, iItem=2, player=...) at xbmc/video/windows/GUIWindowVideoNav.cpp:1205
#18 0x0000562afd3b7867 in CGUIMediaWindow::OnSelect (this=0x562b02530760, item=2) at xbmc/windows/GUIMediaWindow.cpp:1141
#19 0x0000562afd270c1b in CGUIWindowVideoBase::OnSelect (this=0x562b02530760, iItem=2) at xbmc/video/windows/GUIWindowVideoBase.cpp:627
#20 0x0000562afd3b1978 in CGUIMediaWindow::OnMessage (this=0x562b02530760, message=...) at xbmc/windows/GUIMediaWindow.cpp:319
#21 0x0000562afd26e169 in CGUIWindowVideoBase::OnMessage (this=0x562b02530760, message=...) at xbmc/video/windows/GUIWindowVideoBase.cpp:200
#22 0x0000562afd27a666 in CGUIWindowVideoNav::OnMessage (this=0x562b02530760, message=...) at xbmc/video/windows/GUIWindowVideoNav.cpp:254
#23 0x0000562afd61dbba in CGUIControl::SendWindowMessage (this=0x562b03547780, message=...) at xbmc/guilib/GUIControl.cpp:316
#24 0x0000562afd60ebaa in CGUIBaseContainer::OnClick (this=0x562b03547780, actionID=7) at xbmc/guilib/GUIBaseContainer.cpp:793
#25 0x0000562afd60cce7 in CGUIBaseContainer::OnAction (this=0x562b03547780, action=...) at xbmc/guilib/GUIBaseContainer.cpp:407
#26 0x0000562afd64570b in CGUIFixedListContainer::OnAction (this=0x562b03547780, action=...) at xbmc/guilib/GUIFixedListContainer.cpp:81
#27 0x0000562afd6a69fc in CGUIWindow::OnAction (this=0x562b02530760, action=...) at xbmc/guilib/GUIWindow.cpp:435
#28 0x0000562afd3b0d43 in CGUIMediaWindow::OnAction (this=0x562b02530760, action=...) at xbmc/windows/GUIMediaWindow.cpp:202
#29 0x0000562afd26dcb7 in CGUIWindowVideoBase::OnAction (this=0x562b02530760, action=...) at xbmc/video/windows/GUIWindowVideoBase.cpp:111
#30 0x0000562afd2797a0 in CGUIWindowVideoNav::OnAction (this=0x562b02530760, action=...) at xbmc/video/windows/GUIWindowVideoNav.cpp:105
#31 0x0000562afd6b3c14 in CGUIWindowManager::HandleAction (this=0x562b01d17c60, action=...) at xbmc/guilib/GUIWindowManager.cpp:1100
#32 0x0000562afd6b39ce in CGUIWindowManager::OnAction (this=0x562b01d17c60, action=...) at xbmc/guilib/GUIWindowManager.cpp:1050
#33 0x0000562afd8e1888 in CApplication::OnAction (this=0x562b01a4d5d0, action=...) at xbmc/Application.cpp:1924
#34 0x0000562afd5b729a in CInputManager::ExecuteInputAction (this=0x562b01bb8680, action=...) at xbmc/input/InputManager.cpp:704
#35 0x0000562afd5b6c86 in CInputManager::HandleKey (this=0x562b01bb8680, key=...) at xbmc/input/InputManager.cpp:644
#36 0x0000562afd5b5ed8 in CInputManager::OnKey (this=0x562b01bb8680, key=...) at xbmc/input/InputManager.cpp:483
#37 0x0000562afd5b5be6 in CInputManager::OnEvent (this=0x562b01bb8680, newEvent=...) at xbmc/input/InputManager.cpp:442
#38 0x0000562afd8d8aaf in CApplication::HandlePortEvents (this=0x562b01a4d5d0) at xbmc/Application.cpp:341
#39 0x0000562afd8e4fe6 in CApplication::FrameMove (this=0x562b01a4d5d0, processEvents=true, processGUI=true) at xbmc/Application.cpp:2647
#40 0x0000562afd9add56 in CXBApplicationEx::Run (this=0x562b01a4d5d0, params=...) at xbmc/XBApplicationEx.cpp:107
#41 0x0000562afd528974 in XBMC_Run (renderGUI=true, params=...) at xbmc/platform/xbmc.cpp:88
#42 0x0000562afcef1e72 in main (argc=4, argv=0x7ffeca2096e8) at xbmc/platform/posix/main.cpp:108
```
garbear pushed a commit that referenced this issue Jun 15, 2018
Probably many more attributes need to be protected, but this commit
aims to fix just this crash bug:

```
==2579==ERROR: AddressSanitizer: heap-use-after-free on address 0x611003c48200 at pc 0x555558929511 bp 0x7fffc7fc2710 sp 0x7fffc7fc2708
READ of size 8 at 0x611003c48200 thread T168 (PVRManager)
    #0 0x555558929510 in std::_Sp_counted_ptr<PVR::CPVRTimerType*, (__gnu_cxx::_Lock_policy)2>::_M_dispose() (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x33d5510)
    #1 0x555557165886 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x1c11886)
    #2 0x555557162ff9 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x1c0eff9)
    #3 0x555558913621 in std::__shared_ptr<PVR::CPVRTimerType, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x33bf621)
    #4 0x555558913663 in std::shared_ptr<PVR::CPVRTimerType>::~shared_ptr() (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x33bf663)
    #5 0x555558926430 in void std::_Destroy<std::shared_ptr<PVR::CPVRTimerType> >(std::shared_ptr<PVR::CPVRTimerType>*) (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x33d2430)
    #6 0x555558924b2e in void std::_Destroy_aux<false>::__destroy<std::shared_ptr<PVR::CPVRTimerType>*>(std::shared_ptr<PVR::CPVRTimerType>*, std::shared_ptr<PVR::CPVRTimerType>*) (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x33d0b2e)
    #7 0x5555589201a7 in void std::_Destroy<std::shared_ptr<PVR::CPVRTimerType>*>(std::shared_ptr<PVR::CPVRTimerType>*, std::shared_ptr<PVR::CPVRTimerType>*) (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x33cc1a7)
    #8 0x55555891a094 in void std::_Destroy<std::shared_ptr<PVR::CPVRTimerType>*, std::shared_ptr<PVR::CPVRTimerType> >(std::shared_ptr<PVR::CPVRTimerType>*, std::shared_ptr<PVR::CPVRTimerType>*, std::allocator<std::shared_ptr<PVR::CPVRTimerType> >&) (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x33c6094)
    #9 0x555558916a51 in std::vector<std::shared_ptr<PVR::CPVRTimerType>, std::allocator<std::shared_ptr<PVR::CPVRTimerType> > >::~vector() (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x33c2a51)
    #10 0x555558e3fe5b in PVR::CPVRTimerType::CreateFromAttributes(unsigned int, unsigned int, int) (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x38ebe5b)
    #11 0x555558e0ac61 in PVR::CPVRTimerInfoTag::CPVRTimerInfoTag(bool) (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x38b6c61)
    #12 0x555558e26831 in PVR::CPVRTimers::UpdateEntries(PVR::CPVRTimersContainer const&, std::vector<int, std::allocator<int> > const&) (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x38d2831)
    #13 0x555558e24fa6 in PVR::CPVRTimers::Update() (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x38d0fa6)
    #14 0x555558e24b11 in PVR::CPVRTimers::Load() (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x38d0b11)
    #15 0x555558fd3397 in PVR::CPVRManager::LoadComponents(PVR::CPVRGUIProgressHandler*) (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x3a7f397)
    #16 0x555558fd2362 in PVR::CPVRManager::Process() (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x3a7e362)
    #17 0x555558038fe0 in CThread::Action() (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x2ae4fe0)
    #18 0x5555580386cc in CThread::staticThread(void*) (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x2ae46cc)
    #19 0x7ffff6c0e5a9 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x75a9)
    #20 0x7fffee013cbe in __clone (/lib/x86_64-linux-gnu/libc.so.6+0xf6cbe)

0x611003c48200 is located 0 bytes inside of 216-byte region [0x611003c48200,0x611003c482d8)
freed by thread T166 (JobWorker) here:
    #0 0x7ffff6f01040 in operator delete(void*) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdc040)
    #1 0x555558e4071b in PVR::CPVRTimerType::~CPVRTimerType() (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x38ec71b)
    #2 0x555558929540 in std::_Sp_counted_ptr<PVR::CPVRTimerType*, (__gnu_cxx::_Lock_policy)2>::_M_dispose() (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x33d5540)
    #3 0x555557165886 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x1c11886)
    #4 0x55555738a63a in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::operator=(std::__shared_count<(__gnu_cxx::_Lock_policy)2> const&) (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x1e3663a)
    #5 0x555558926844 in std::__shared_ptr<PVR::CPVRTimerType, (__gnu_cxx::_Lock_policy)2>::operator=(std::__shared_ptr<PVR::CPVRTimerType, (__gnu_cxx::_Lock_policy)2> const&) (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x33d2844)
    #6 0x55555892686e in std::shared_ptr<PVR::CPVRTimerType>::operator=(std::shared_ptr<PVR::CPVRTimerType> const&) (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x33d286e)
    #7 0x5555589268b8 in std::shared_ptr<PVR::CPVRTimerType>* std::__copy_move<false, false, std::random_access_iterator_tag>::__copy_m<std::shared_ptr<PVR::CPVRTimerType> const*, std::shared_ptr<PVR::CPVRTimerType>*>(std::shared_ptr<PVR::CPVRTimerType> const*, std::shared_ptr<PVR::CPVRTimerType> const*, std::shared_ptr<PVR::CPVRTimerType>*) (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x33d28b8)
    #8 0x555558924ed2 in std::shared_ptr<PVR::CPVRTimerType>* std::__copy_move_a<false, std::shared_ptr<PVR::CPVRTimerType> const*, std::shared_ptr<PVR::CPVRTimerType>*>(std::shared_ptr<PVR::CPVRTimerType> const*, std::shared_ptr<PVR::CPVRTimerType> const*, std::shared_ptr<PVR::CPVRTimerType>*) (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x33d0ed2)
    #9 0x55555892094e in __gnu_cxx::__normal_iterator<std::shared_ptr<PVR::CPVRTimerType>*, std::vector<std::shared_ptr<PVR::CPVRTimerType>, std::allocator<std::shared_ptr<PVR::CPVRTimerType> > > > std::__copy_move_a2<false, __gnu_cxx::__normal_iterator<std::shared_ptr<PVR::CPVRTimerType> const*, std::vector<std::shared_ptr<PVR::CPVRTimerType>, std::allocator<std::shared_ptr<PVR::CPVRTimerType> > > >, __gnu_cxx::__normal_iterator<std::shared_ptr<PVR::CPVRTimerType>*, std::vector<std::shared_ptr<PVR::CPVRTimerType>, std::allocator<std::shared_ptr<PVR::CPVRTimerType> > > > >(__gnu_cxx::__normal_iterator<std::shared_ptr<PVR::CPVRTimerType> const*, std::vector<std::shared_ptr<PVR::CPVRTimerType>, std::allocator<std::shared_ptr<PVR::CPVRTimerType> > > >, __gnu_cxx::__normal_iterator<std::shared_ptr<PVR::CPVRTimerType> const*, std::vector<std::shared_ptr<PVR::CPVRTimerType>, std::allocator<std::shared_ptr<PVR::CPVRTimerType> > > >, __gnu_cxx::__normal_iterator<std::shared_ptr<PVR::CPVRTimerType>*, std::vector<std::shared_ptr<PVR::CPVRTimerType>, std::allocator<std::shared_ptr<PVR::CPVRTimerType> > > >) (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x33cc94e)
    #10 0x55555891b4ad in __gnu_cxx::__normal_iterator<std::shared_ptr<PVR::CPVRTimerType>*, std::vector<std::shared_ptr<PVR::CPVRTimerType>, std::allocator<std::shared_ptr<PVR::CPVRTimerType> > > > std::copy<__gnu_cxx::__normal_iterator<std::shared_ptr<PVR::CPVRTimerType> const*, std::vector<std::shared_ptr<PVR::CPVRTimerType>, std::allocator<std::shared_ptr<PVR::CPVRTimerType> > > >, __gnu_cxx::__normal_iterator<std::shared_ptr<PVR::CPVRTimerType>*, std::vector<std::shared_ptr<PVR::CPVRTimerType>, std::allocator<std::shared_ptr<PVR::CPVRTimerType> > > > >(__gnu_cxx::__normal_iterator<std::shared_ptr<PVR::CPVRTimerType> const*, std::vector<std::shared_ptr<PVR::CPVRTimerType>, std::allocator<std::shared_ptr<PVR::CPVRTimerType> > > >, __gnu_cxx::__normal_iterator<std::shared_ptr<PVR::CPVRTimerType> const*, std::vector<std::shared_ptr<PVR::CPVRTimerType>, std::allocator<std::shared_ptr<PVR::CPVRTimerType> > > >, __gnu_cxx::__normal_iterator<std::shared_ptr<PVR::CPVRTimerType>*, std::vector<std::shared_ptr<PVR::CPVRTimerType>, std::allocator<std::shared_ptr<PVR::CPVRTimerType> > > >) (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x33c74ad)
    #11 0x55555891757f in std::vector<std::shared_ptr<PVR::CPVRTimerType>, std::allocator<std::shared_ptr<PVR::CPVRTimerType> > >::operator=(std::vector<std::shared_ptr<PVR::CPVRTimerType>, std::allocator<std::shared_ptr<PVR::CPVRTimerType> > > const&) (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x33c357f)
    #12 0x5555588e314e in PVR::CPVRClient::GetAddonProperties() (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x338f14e)
    #13 0x555558f89eec in PVR::CPVRClients::ConnectionStateChange(PVR::CPVRClient*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, PVR_CONNECTION_STATE, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x3a35eec)
    #14 0x55555904915e in PVR::CPVRClientConnectionJob::DoWork() (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x3af515e)
    #15 0x555557ea8995 in CJobWorker::Process() (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x2954995)
    #16 0x555558038fe0 in CThread::Action() (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x2ae4fe0)
    #17 0x5555580386cc in CThread::staticThread(void*) (/usr/local/stow/kodi-asan/lib/kodi/kodi-x11+0x2ae46cc)
    #18 0x7ffff6c0e5a9 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x75a9)
```
@peterstory
Copy link

@SNWRbxT Thanks, that change fixed my playback problems, too! I was also streaming over SMB.

For reference, I created the file here: /home/apps/kodi/.home/.kodi/userdata/advancedsettings.xml

@ghost
Copy link

ghost commented Jul 12, 2018

@peterstory This fixed the stuttering video after pauses?

@peterstory
Copy link

@AMDSY3D I initially thought it did, but now I'm not so sure. A potentially confounding factor was that my PS3 controller was causing small amount of scrubbing, randomly. It seems that the analog sticks were so sensitive that they were randomly causing the scrubbing, even when I wasn't touching the controller. I fixed that issue by configuring the directional pad to be used for scrubbing, instead of the analog stick.

@garbear
Copy link
Owner

garbear commented Jul 12, 2018

Kodi has a deadzone setting. It's well hidden - visit Settings -> System settings -> Input -> Peripherals.

Kodi v18 contains a special feature (the ability to play ROMs alongside videos) so I'll make the deadzone setting more prominent in our next release.

@forid786
Copy link

forid786 commented Jul 31, 2018

I've personally picked up a Steam Link in the sale, just to run videos and media off my FreeNas box using kodi. I'm pretty sure others have bought the Link to run Kodi as well.

Kodi on the Steam link as a whole seems quite laggy and jumpy at times. Is this mainly caused by the hardware or software? I would've thought that the stream link would be good enough to run kodi.

@garbear
Copy link
Owner

garbear commented Jul 31, 2018

The Steam Link is largely constrained by the weak CPU. Kodi's menu system is quite CPU-heavy, very few triangles but a very large amount of skinning conditions to calculate every frame. If you want less menu lag, a light-weigh skin will help (not sure if we have a light-weight one in our repo, usually skinners overload their babies with features).

Because it's accelerated, HD video should be smoother than the menus.

@forid786
Copy link

forid786 commented Jul 31, 2018

I've tried a few light weight themes, the experience has been better. But it's really slow compared to running Kodi on PC or on my Android phone. When streaming from SMB, I've had jumps in videos, artefact and subtitles being too fast or too slow.

I think for the time being, I might go with running Kodi on the PC route and leave the the steam link with what it's good at. Streaming. But it's great to see you working on this native Kodi addon.

@StripedMonkey
Copy link

Trying what SNWRbxT said helped out a ton, to the point where its almost watchable. I refuse to believe that it can't handle HD/1080p, and yet, that is what it seems to struggle with. Are there any performance optimizations that can be done beyond whats already been suggested?

@jonsanta
Copy link

jonsanta commented Apr 14, 2019

Trying what SNWRbxT said helped out a ton, to the point where its almost watchable. I refuse to believe that it can't handle HD/1080p, and yet, that is what it seems to struggle with. Are there any performance optimizations that can be done beyond whats already been suggested?

did really help? I tryed with that file, also with maintenance addon, seems like buffer size cant be changed on the build i was using. wich build did u use?

@StripedMonkey
Copy link

Originally I used Kodi V18 on steam link build 683 but couldn't get it to work so I nuked /home/apps/kodi and installed V17.6. After adding the startup script for NTP (See #28 ) and adding the little blurb SN wrote to /home/apps/kodi/.home/.kodi/userdata/advancedsettings.xml I restarted and got a dramatically higher performance out of Kodi but not great. Every few seconds the video would freeze, it was still unwatchable. After about 10 minutes it seemed to sort itself out, and while I think I might still see some hitches its much better than it was before. Like I said, its still not great performance, especially from a device that should be perfectly suitable for 1080p streaming at a good frame rate.

@shipilovr
Copy link

Does anyone have audio and subs resync problem after pausing or moving back/forward video? If it starts from begining everything is OK. I checked CPU usage by top-command over SSH within this moment and it is 100%. Seems SL can't just work out loading on it...

@StripedMonkey
Copy link

Yup. Pausing causes the issue for me, but Fast forwarding/backwards doesn't always cause it.

@MadManMoon
Copy link

Sorry to awaken an old thread, I'm still seeing this issue. So I'm adding my comment to indicate that and also to show my troubleshooting.

I'm going to try the work arounds that are in this thread, but perhaps this is widespread enough to ensure that they are included in the next release? (that's not an insistent thing, just thinking aloud)

Did I also read somewhere that it's basically pointless to try any files that are not 264, due to the on chip processing? Was that this thread?

Anyway, like I say, I'm going to try to downgrade some day soon, so I'll see if I can just find a way to include the workarounds in the version that I install, rather than install then put any workaround in. 👍

@garbear
Copy link
Owner

garbear commented Jul 24, 2020

Yes it's true that we're limited to h264, it's the only format that the SL hardware-accelerates because it's the only format needed for game streaming.

I completed the port to Kodi v18 Leia, but the performance suffered even more due to increased processing demands of the newer version. As such, I've given up on updating the SL to newer versions.

The v17 release here never saw fixes for all A/V sync issues either. The SL is geared toward real-time streaming where A/V sync isn't an issue (you just want to show everything as fast as possible). You also don't have B-frames in realtime, because going "B"idirectional in time adds latency. I manually enable a B-frame mode for Kodi, but A/V sync then becomes a guessing game that I didn't play very well.

@StripedMonkey
Copy link

Perhaps this isn't the thread to ask it but I'd like to know if anyone has a suggestion for a "practical" use of it/a good alternative to this in order to do from-the-couch movie watching. Specifically for the SL ofc. I want to put it to use in some way.

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