How to keep KODI playing file / resume if stops (playback watcher?)
#1
Ive build simple IPTV-like solution based on RPi and Kodi.
Works great but from time to time played file or steam stops or just hangs

Is there any way force Kodi to play file/stream again in case of any issues?
Eg kind of deamon watching if file is being played and if not requesting it to be played again in the never ending loop ?

To keep fresh copy of KODI Ive added to crontab command to reboot KODI each night, than with Partymode autostart addon Kodi is playing stream/file from the scratch
This helped to keep playing longer time untouched but still freezes / stops happen

Can you please guide me how to develop such "playback watcher" ?

Ive some basic Pyhon / JSON / programming knowledge so with little help I should be able to manage that myself..

Many thanks in advance !
Reply
#2
Solution I was able to develop so far (Python script) :

py:
hasVideo = xbmc.Player().isPlayingVideo()
if not hasVideo:
    xbmc.Player().play(FILE_NAME)   

Im runing this script via Cron every minute.
(coudnt find way to shorten this time)

Let me know if you find better way...
Reply
#3
Better if you find out why your Pi is stopping playing.

To receive meaningful assistance you will need to provide a full debug log.

The instructions are here... debug log (wiki)

If you are using the Basic Method, then ensure the following is applied...
1.Enable debugging in Settings>System Settings>Logging,
2.Restart Kodi
3.Replicate the problem.

If you are using the Advanced Method ensure you have correctly created and applied the advancedsettings.xml file.

In both instances, you should see the word DEBUG throughout the log.

Note: Full logs only. No partial or redacted logs
Do NOT post your logs directly into the forum. Always use a paste site like pastebin.com. Post the link to your pasted log in the forum
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#4
This might not be issue with Kodi
It might be even because stream has stopped for short time (eg 1 second) - so logs might not help much
Reply
#5
Below error log.
Any idea what might cause that / how to fix ?


Code:
22:27:26.893 T:4100562944 NOTICE: VideoPlayer: Opening: udp://238.0.0.1:2000/
22:27:26.893 T:4100562944 WARNING: CDVDMessageQueue(player):Tongueut MSGQ_NOT_INITIALIZED
22:27:26.894 T:3644846944 NOTICE: Creating InputStream
22:27:26.894 T:3644846944 NOTICE: Creating Demuxer
22:27:26.896 T:3644846944 ERROR: OpenDemuxStream - Error creating demuxer
22:27:26.896 T:3644846944 NOTICE: CVideoPlayer::OnExit()
22:27:26.909 T:4100562944 NOTICE: CVideoPlayer::CloseFile()
22:27:26.909 T:4100562944 NOTICE: VideoPlayer: waiting for threads to exit
22:27:26.909 T:4100562944 NOTICE: VideoPlayer: finished waiting
22:27:26.909 T:4100562944 NOTICE: CVideoPlayer::CloseFile()
22:27:26.909 T:4100562944 NOTICE: VideoPlayer: waiting for threads to exit
22:27:26.909 T:4100562944 NOTICE: VideoPlayer: finished waiting
22:27:51.976 T:4100562944 NOTICE: VideoPlayer: Opening: udp://238.0.0.1:2000/
22:27:51.976 T:4100562944 WARNING: CDVDMessageQueue(player):Tongueut MSGQ_NOT_INITIALIZED
22:27:51.976 T:3809473376 NOTICE: Creating InputStream
22:27:51.977 T:3809473376 NOTICE: Creating Demuxer
22:27:59.109 T:3809473376 NOTICE: Opening stream: 0 source: 256
22:27:59.109 T:3809473376 NOTICE: Creating video codec with codec id: 28
22:27:59.110 T:3809473376 ERROR: AML: no rw on /sys/class/ppmgr/ppmgr_3d_mode
22:27:59.125 T:3809473376 NOTICE: Creating video thread
22:27:59.125 T:3809473376 NOTICE: Opening stream: 1 source: 256
22:27:59.125 T:3933201248 NOTICE: running thread: video_thread
22:27:59.125 T:3809473376 NOTICE: Finding audio codec for: 86018
22:27:59.127 T:3809473376 NOTICE: Creating audio thread
22:27:59.128 T:3612341088 NOTICE: running thread: CVideoPlayerAudio:Tonguerocess()
22:27:59.139 T:3612341088 NOTICE: Creating audio stream (codec id: 86018, channels: 2, sample rate: 44100, no pass-through)
22:27:59.150 T:3933201248 NOTICE: CAMLCodec::OpenDecoder - using V4L2 pts format: 64Bit
22:27:59.626 T:3595563872 ERROR: GetDirectory - Error getting
22:27:59.635 T:4100562944 NOTICE: Display resolution ADJUST : 1920x1080 @ 50.00 - Full Screen (23) (weight: 0.000)
22:27:59.636 T:4100562944 NOTICE: VideoPlayer: OnLostDisplay received
22:28:00.097 T:3933201248 WARNING: CRenderManager::WaitForBuffer - timeout waiting for buffer
22:28:01.639 T:4100562944 NOTICE: VideoPlayer: OnResetDisplay received
22:28:02.216 T:3612341088 ERROR: CDVDAudio::AddPacketsRenderer - timeout adding data to renderer
22:28:33.935 T:3644846944 WARNING: Create - unsupported protocol(udp) in udp://238.0.0.1:2000/
22:28:33.935 T:3644846944 ERROR: Exists - Error checking for udp://238.0.0.1:2000/
22:29:25.695 T:3644846944 WARNING: Create - unsupported protocol(udp) in udp://238.0.0.1:2000/
22:29:25.695 T:3644846944 ERROR: Exists - Error checking for udp://238.0.0.1:2000/
22:30:31.753 T:3644846944 WARNING: Create - unsupported protocol(udp) in udp://238.0.0.1:2000/
22:30:31.753 T:3644846944 ERROR: Exists - Error checking for udp://238.0.0.1:2000/
22:31:37.768 T:3644846944 WARNING: Create - unsupported protocol(udp) in udp://238.0.0.1:2000/
22:31:37.768 T:3644846944 ERROR: Exists - Error checking for udp://238.0.0.1:2000/
22:32:44.072 T:3644846944 WARNING: Create - unsupported protocol(udp) in udp://238.0.0.1:2000/
22:32:44.072 T:3644846944 ERROR: Exists - Error checking for udp://238.0.0.1:2000/
Reply
#6
Please don't post partial log. Enable debug and use a paste site. Are you sure you are running on a Pi?
Code:
22:27:59.110 T:3809473376 ERROR: AML: no rw on /sys/class/ppmgr/ppmgr_3d_mode
Looks like an AMLogic specific version.
Reply
#7
Agh - Apologies - You are right!
(I have both RPIs and AMLs boxes)

I'll try to extract full debug log later and re-publish.

BTW Ive noticed similar lines to below on other AMLs machines I have in my network, but stream is still being played...
So such ERROR doesnt mean steam frozen Sad

 
Code:
22:32:44.072 T:3644846944 WARNING: Create - unsupported protocol(udp) in udp://238.0.0.1:2000/
22:32:44.072 T:3644846944 ERROR: Exists - Error checking for udp://238.0.0.1:2000/
Reply

Logout Mark Read Team Forum Stats Members Help
How to keep KODI playing file / resume if stops (playback watcher?)0