PDA

View Full Version : GB Quad+ Timeshift crash



divil_a_bit
31-12-16, 17:49
I'm looking for some help modifying the Python source.

I'm using a GB Quad+ and I want try to fix this crash (well not really 'fix' ... more of a workaround):
http://www.world-of-satellite.com/showthread.php?53278-Gigablue-Quad-HD-Plus-Vix-Recordings-amp-Timeshift-crashes

The workaround is to use the 'Jump' feature to jump to the end of the timeshift buffer. I can not reproduce the crash when I just to the end of the Timeshift, rather than pressing Stop on the remote.

So in summary: when in Timeshift mode, when I press 'Stop' on the remote, I want to 'jump' to the end of the buffer.

I'm looking at this source:
https://github.com/OpenViX/enigma2/blob/94f1a0dddba6b443a358bc12e298f30282c70aec/lib/python/Components/Timeshift.py
I've copied it to /usr/lib/python/Components and verified it gets compiled to a pyo on each restart.
I have modified Timeshift.py by adding this code to the __init__ method


def __init__(self):
file = open("/tmp/enigma2.log", "r+")
file.write('hello world')
file.close()

I've verified the file is created and contains 'hello world' so I know my updates to the file are being picked up.
However, I'm not seeing the methods called as expected.
I've added logging to this method also:


def startTimeshift(self):

However, I'm not seeing this code being hit as I expected when I press Pause to start Timeshift.
Same it true for stopTimeshift()

What am I doing wrong? What methods are called when stopping Timeshift on a GB Quad+? Will it be possible to achieve what I want?
Thanks

divil_a_bit
31-12-16, 18:34
Ok - to update on the above. I got it working. and I got a workaround for the crash:


def stopTimeshiftcheckTimeshiftRunningCallback(self, answer):
# print 'stopTimeshiftcheckTimeshiftRunningCallback'
# print ' answer', answer
if answer and int(config.timeshift.startdelay.value) and self.switchToLive and self.isSeekable():
# print 'TEST4'
self.ptsStop = False
self.pts_nextplaying = 0
self.pts_switchtolive = True
self.setSeekState(self.SEEK_STATE_PLAY)
#self.ptsSetNextPlaybackFile("")
self.doSeek(3600 * 24 * 90000)
self.__seekableStatusChanged()
return 0


Commenting out this line has fixed the crash and doesn't seem to affect the functionality
'self.ptsSetNextPlaybackFile("")'

Is this the correct thing to do?

twol
01-01-17, 16:33
Ask Birdman for comments:)

birdman
03-01-17, 11:15
Ask Birdman for comments:)
Well, the change you made prevents a directory pathname, rather than a file pathname, being set for the timeshift buffer.
This situation also occurs at line 253 and 1197 in the same file.
So it might be better to fix all of them....

They are all associated with setting self.pts_switchtolive to True, so I reckon changing the ptsSetNextPlaybackFile() code to be:

def ptsSetNextPlaybackFile(self, nexttsfile):
# print '!!!!! ptsSetNextPlaybackFile'
ts = self.getTimeshift()
if ts is None:
return
# Prepend timeshift dir, unless we are setting nothing ("")
if nexttsfile != "":
nexttsfile = "%s%s" % (config.usage.timeshift_path.value, nexttsfile)
# print ("!!! SET NextPlaybackFile nexttsfile)
ts.setNextPlaybackFile(nexttsfile)will be better, as this will handle all of them by not prepending the timeshift directory name when it is actually trying to not set any file. This code ends up setting m_timeshift_file_next in lib/service/service/dvb.cpp and there are various checks for this being an empty string, all associated with it switching to live TV.

Here's a version of Timeshift.py with this fix applied.

51961

birdman
03-01-17, 20:41
Here's a version of Timeshift.py with this fix applied.Note that this is different to what you did, but I suspect it fits in with what is intended elsewhere in the code.

divil_a_bit
04-01-17, 21:29
Nice one birdman - that fixed the problem.
I had noticed the other 2 code paths with the empty string but I couldn't figure out how to hit them so I didn't bother making a riskier fix I didn't understand.
But just to be clear - I reverted my change and went with your change instead and it has fixed the problem.

Now that that crash is fixed I have zero issues with the GB Quad+.

birdman - can you get this fix committed to openvix repository so others can benefit from the change?

birdman
04-01-17, 22:51
But just to be clear - I reverted my change and went with your change instead and it has fixed the problem.Good. It's possible that this will fix some other issues (that's just an hypothesis).


birdman - can you get this fix committed to openvix repository so others can benefit from the change?Yes. I'll get onto it shortly.

EDIT:

https://github.com/OpenViX/enigma2/pull/81

divil_a_bit
04-01-17, 23:21
Great. Thanks

birdman
05-01-17, 13:55
It will be in 4.2.025, but not 4.2.024 (which should be along in a few days).
So keep a copy of that fixed file to for 4.2.024.

divil_a_bit
05-01-17, 15:53
This really is super news for GB Quad+ users - thank you birdman.

Hannaman
05-01-17, 16:29
Waiting for this patiently thanks birdman.

Joe_90
06-01-17, 14:55
@birdman - tested your Timeshift.py extensively on my GB Quad+ (now in Permanent TimeShift mode)and have not experienced the crash when pressing STOP key. Seems pretty bulletproof at this point, thanks!

birdman
06-01-17, 15:12
Seems pretty bulletproof at this point, thanks!You really need to thank divil_a_bit (http://www.world-of-satellite.com/member.php?u=60776) for tracking down the cause. I just made a few changes based on his discovery.

Joe_90
06-01-17, 15:14
Have done!

stargateuser
29-03-19, 11:13
I have a GB quad HD plus, currently running Teamblue 6.3.0 (2019-02-28), OE-Alliance 4.3 and have had this really bloody annoying jumping and sticking problem. It's so bad that we have had to go to BBC iPlayer and ITV hub as we simply can't watch the recordings without hitting the "1" button to keep jumping back. It was utterly flawless before whatever the problem that causes this was added / removed from the source code. I have suffered this for a year or so. I am almost at the point of putting my DM8000 back as the main box, so I hope this fix works :D

I tried everything including reformatting the HDD, boot loaders, images etc. Nothing fixes it. I could see that for some reason the images were putting the timeshift.xxx into the USB where the picons are stored and I guessed it was this or something to do with this.

I've put the code in now and will see how it works on my box.

Thanks to you guys who can do code - I wish I could! - and you really are binary wizards :thumbsup:

I'll report back after a few days and let you know if it works for me :smiley_yup:

ccs
29-03-19, 12:54
The "fix" has been in ViX for over 2 years, which version have you been trying?

stargateuser
30-03-19, 22:26
That didn't work.

I still get the jumping / sticking on playing recordings back and if I pause live TV then press play it does the same sticking / jumping.

Does anyone have any idea what causes it?
thanks

stargateuser
30-03-19, 22:29
The "fix" has been in ViX for over 2 years, which version have you been trying?

I've tried openvix all, openatv 5.1, openatv 5.2, openatv 6.2, Satdreamgr-6 and currently teamblue 6.1. The time shift going into the usb still happens and this jumping / sticking of playback recording happens on all of them.

abu baniaz
31-03-19, 00:51
Are you saying your mechanical HDD goes missing and your USB device then gets used?

stargateuser
31-03-19, 18:36
No the problem isn't the hard drive going missing. I had 2 problems. One is that sometimes the timeshift ends up on the usb stick, the other is the freezing.

If I watch live tv (timeshift is now hard coded and I can't disable it) it on any channel FTA or encrypted, all is ok on live viewing until I pause it. Once I have paused and then press play the error is cyclical. I can watch for around 3 mins then it just freezes. I can wait and sometimes it restarts playing on it's own sometimes I have to hit the "1, 4 or 7" buttons but "3, 6 or 9" does the same. I do not get smooth playback anymore. It will continue to do this until I stop watching the timeshifted tv.

If I watch a recording I get exactly the same problem. The same cyclical freezing / sticking / jumping.

If I download to my pc and play the recording it plays perfectly, so whatever the fault is it is in the coding. It never used to do this and I used openvix exclusively until about a year ago when I noticed this happening. I have worked away from home overseas for pretty much the last 3 years so used the box mainly for streaming via VLC whilst overseas - it is brilliant for that. My wife told me that it started freezing and sticking. If she paused it, she could no longer play as it would crash the box. I updated to latest OpenVix and that problem went away but then the freezing started and it is now driving me insane.

I know other's have this problem but there is no cure as far as I could find using various forums and search engines. The only solution I can think of is to start going backwards through the 4.x Open Vix's and install to find which one was good. Then hopefully some code wizard will find what changed.

abu baniaz
31-03-19, 18:43
How can timeshift files end up on USB when the default mountpoint is HDD? OpenViX mounts USB devices as HDD if no mechanical HDDs are present. Are you sure your mounts are not moving?

Timeshift starting automatically is disabled by default on OpenViX. User must enable it.

stargateuser
31-03-19, 18:52
Thanks for the reply. The timeshift location isn't really my problem it's the playback once paused live tv and then watching it in timeshift, or watching recordings when it constantly freezes / jumps / jitters. It does not matter which image I use, they all do it. It never used to and now it does. I want to be able to fix that. I have re-initialised my hdd and formatted to Ext4 it makes no difference. It still does the same things

stargateuser
31-03-19, 18:59
OK found the post from fat-tony
https://www.world-of-satellite.com/showthread.php?40305-ViX-HD_experimental << post #3 is EXACTLY the problem I am getting and this was 2014.

twol
31-03-19, 19:00
Thanks for the reply. The timeshift location isn't really my problem it's the playback once paused live tv and then watching it in timeshift, or watching recordings when it constantly freezes / jumps / jitters. It does not matter which image I use, they all do it. It never used to and now it does. I want to be able to fix that. I have re-initialised my hdd and formatted to Ext4 it makes no difference. It still does the same things
You are not answering the question 1) how is the usb formatted? and 2) in MountManager how is it mounted?

abu baniaz
31-03-19, 19:00
Initialising/formatting will not fix a HDD failure/problem. Especially an intermittent one. Seems to me that your HDD has a fault if playback of recordings is affected. Can you try a different HDD?

abu baniaz
31-03-19, 19:03
OK found the post from fat-tony
https://www.world-of-satellite.com/showthread.php?40305-ViX-HD_experimental << post #3 is EXACTLY the problem I am getting and this was 2014.

And in 2017 he said, in this thread.



@birdman - tested your Timeshift.py extensively on my GB Quad+ (now in Permanent TimeShift mode)and have not experienced the crash when pressing STOP key. Seems pretty bulletproof at this point, thanks!


Anyway, hope he responds and confirms the status of play. Are you using the newer bootloader you linked in the thread?

abu baniaz
31-03-19, 19:08
Are you using the newer bootloader you linked in the thread?

There is a newer bootloader here
http://www.openvix.co.uk/index.php/downloads/bootloaders/gigablue-bootloaders/gigablue-hd-quad-plus-bootloaders/

stargateuser
31-03-19, 19:35
Ok thanks for the pointers.

/media/hdd is for the HDD
/dev/sdb/ is for the the USB = usb has swap on it

I do have a spare HDD but won't be able to do it tonight.

How can I check the bootloader version? Can it be done from cli? I did update it about a year ago

ccs
31-03-19, 19:45
You don't need a swap file , it will probably do more harm than good.

abu baniaz
31-03-19, 19:49
How can I check the bootloader version? Can it be done from cli? I did update it about a year ago
Just flash it again.

stargateuser
31-03-19, 20:32
Thanks guys. I'll do that later or tomorrow morning. Can't do it now - she who must be obeyed is watching tv.

Do any of you have a GB Quad HD+ and if so is it problem free and what image? :beer_toast: Thanks

Joe_90
01-04-19, 11:39
@stargateuser - sorry for not jumping into the thread earlier. I hadn't been paying too close attention to it as the thread title doesn't actually indicate your specific issue and was started some years ago, so maybe your problem would have received more close attention if you had started a new thread with a more relevant title :)

Anyway, I use the Quad+ as my main machine and I don't experience any of the issues you are seeing. I have timeshift set to start automatically after 10 seconds and can jump backwards and forwards in the buffer without stuttering or blocking. I would say that perhaps you have a hardware issue (bad blocks or similar) with the disk drive? I'm on ViX 5.2.034 with a drivers date of 2018-04-03. The only problem I have with timeshift is when the timeshift buffer spans several programmes and I use the left and right arrows at the bottom of the remote to jump to the start of the previous programme. Sometimes it takes several attempts to get back to it, more often it will only jump to the start of the current programme and I have to go into the recording menu and select to timeshift record. That issue I think is down to drivers and I doubt if GB are going to release more updates as the box is several years old.

stargateuser
01-04-19, 20:31
@fat-tony, thanks for the reply, I know it was an old post and next time if I get any issues I'll start a new one, so thanks for taking the time to reply.

I once had a DM8000 that was a total PITA and I eventually sold it as spares and repairs, I bought another and it was and still is perfect. No problems ever. So I do know that there are Friday afternoon / Monday morning builds and components, but for whatever reason when I changed to the 5.x OpenVix's this problem happened. I tried all the openvix 5.0 - 5.2, openatv, satdreamgr 6, Teamblue 6.3. All had lovely gui's but they all had the same problems as stated.

I might install the same build you have again and see how that goes but as of now I'm watching a recording done with Teamblue 6.3 and it is playing back smoothly, timeshift is enabled to start after 5 seconds and no problems. I have now installed OpenVix 4.2.030, drivers 20170118 and kernel 4.01. I know my hdd is ok.

It is weird, I'm glad that I saved a lot of the archive builds :thumbsup: