Auto-unlock?

Black Hole

May contain traces of nut
This is a revised post to summarise the discussion in, and conclusion of, this topic.

Recordings can get into a state where they cannot be deleted from the Media menu, separate from the Lock/Unlock options provided on the OPT+ menu. Deleting from the OK menu doesn't work, and the OPT+ menu has "Delete" greyed out (ie unavailable). Other OPT+ options for the file are also greyed out.

This situation occurs if playback is not terminated properly, and persists until action is taken to resume and terminate playback or until the next reboot. Known circumstances are:
  • Start another recording playing while one is already playing;
  • Press "TV Portal" while a recording is playing;
  • Press the power button while a recording is playing (this might not result in a reboot: see Things Every... section 18);
  • Whilst playing press Guide and choose a programme to watch live, Humax displays a popup to ask if you want to stop playing but it causes the locked condition
Although this presents little difficulty to a "trained" user, less sophisticated members of the household might easily do these things and then be perplexed by the consequences. For example: it is easy enough to forget that a recording (rather than live TV) is playing.

When I originally posed this topic, it was on the presumption that some kind of property (separate from the Lock flag) was being recorded in the .hmt file, which could be cleared automatically by a Custom Firmware process. This has proved not to be the case, and is in fact a consequence of an inaccessible state variable in the Humax code (which is why the problem resolves when the unit is rebooted).

Therefore, no solution is likely to be forthcoming.

Original post (for reference):

If you don't stop a playback properly (eg just turn off the HDR while in playback), the recording is locked and cannot be deleted until it is unlocked by resuming playback and then stopping it. This is an unwelcome detail when the user is unsophisticated, the recording simply doesn't delete from the media menu without any explanation.

What would it take to make an auto-unlock package, similar to auto-unprotect, which simply patrols for locked recordings and unlocks them?
 
Last edited:
What would it take to make an auto-unlock package, similar to auto-unprotect, which simply patrols for locked recordings and unlocks them?
Do you know what is different about the file that makes it show up as locked? Does hmt output show anything different?
 
Does it actually set the Lock flag in the hmt when this occurs?

If it does the hmt -lock should do the trick

To automate it you would need to clone the auto.hook file from a package that scans each directory and unlock the recordings that are locked
 
Even if hmt does not show anything in its output, save the .hmt file from that state, then play/stop and save the updated .hmt file.
Then we just need a binary comparison and cross reference that against the known bits of the file format.
 
Even if hmt does not show anything in its output, save the .hmt file from that state, then play/stop and save the updated .hmt file.
Then we just need a binary comparison and cross reference that against the known bits of the file format.
Precisely what I have in mind. Give me ten...
 
Code:
HDRFOX3# cd "My Video/"
HDRFOX3# cd [NEWS\]/
HDRFOX3# cp "BBC News at Six_20200612_1758.hmt" "BBC News at Six_20200612_1758.hmtx"
HDRFOX3# hmt "BBC News at Six_20200612_1758" > hmtx.txt
<<< then an interrupted playback occurred... >>>
Code:
HDRFOX3# hmt "BBC News at Six_20200612_1758" > hmty.txt
HDRFOX3# cp "BBC News at Six_20200612_1758.hmt" "BBC News at Six_20200612_1758.hmty"
HDRFOX3# diff hmtx.txt hmty.txt
--- hmtx.txt
+++ hmty.txt
@@ -9,7 +9,7 @@
EPG:The latest national and international news stories from the BBC News team, followed by weather. [S]

Recording Status: Valid (OK)
-Flags: SD,New,Unlimited Copies,
+Flags: SD,Unlimited Copies,
Copy count:0

Scheduled start:1591981200 (Fri Jun 12 18:00:00 2020)
@@ -18,7 +18,7 @@
Recording end:1591982999 (Fri Jun 12 18:29:59 2020)
Duration:1919
Stored duration:1919
-Play resumes at:0 seconds in.
+Play resumes at:1133 seconds in.
Timezone offset:3600

Service ID (SID):4352
Nothing significant there, so far as shows up in the hmt output.

Does it actually set the Lock flag in the hmt when this occurs?
Apparently not. The OPT+ menu has everything but Sort and New Folder greyed out - including Unlock. Maybe we need a different name for the package: auto-what?

Have put the .hmtx and .hmty in the attached zip for inspection.
 

Attachments

  • Downloads.zip
    1.2 KB · Views: 3
x:
1592308189375.png

y:
1592308200607.png

So there's a bit changed at offset 0x28d, 0 -> 8, that's most likely the flag here.
There's also the new 0x6d04 at 0x294.

I'll cross-reference with raydon's file format description
 
Ok, the 0x6d04 at offset 0x294 is:

Code:
0x0294    4 bytes    0x44332211        Played time in seconds (used by resume).

0x28d is the flags byte, with currently documented flags being:

Code:
   bit 2 - locked
   bit 3 - New

So it's the New flag which has been removed here, as confirmed by the hmt output.

Where's that scratch-head emoticon?
 
Does that mean you have accounted for everything that's changed in the .htm? If so, where is the lock mechanism? Why is the OPT+ menu different?
 
Not if it persists through a reboot
I can test that (my test only involved a warm restart), but my recollection is that it does persist after a full power-down...

It doesn't! Controlled shut-down and power cycle cleared the condition.
 
Is it possible to list open file handles and work out which are redundant?
You can run
Code:
lsof -p `pgrep -n humaxtv`
to show all of the files currently open by the Humax application. Linux, being UNIX-like, treats most things as a file so that will include network connections etc. It's possible to filter - the status command does:

Code:
lsof -X -Fns -p `pgrep -n humaxtv`
 
My experience is that if the machine crashes while playing is the humax doesn't offer to resume at (or close to) the resume point but only offers the play from start option which is a PITA since you then have to fast forward to try to find the spot you were at. Resume only seems to work if you cleanly stop the recording.

Pressing Media without stopping the currently playing recording allows the recording to play in the background, selecting another recording stops the current playing file and I am able to confirm it can't then be deleted .
Using lsof I can't find any sign of the programme being in use.
I don't see anything obvious in the hmt command output but didn't take a copy before hand to allow for byte level comparison
| Playing the recording again and pressing stop does allow it to be deleted.
 
Last edited:
Given the hypothesis that media playback goes directly from the disk to the AV subsystem, maybe there's some sort of shared state between the AV subsystem and the settop binary that can be reacquired by the latter after it restarts, but disappears over a power cycle?

The original example provided by BH did have the resume point set in the hmt.
 
didn't take a copy before hand to allow for byte level comparison
Byte comparisons of the hmt files only show expected differnces in the resume time and new flag so whatever is preventing deletion isn't based on file 'in use' status or a flag in the hmt file so it is probably somewhere in memory which makes it a lot harder to find and fix.
 
Yeah, I can't see anything in there that might relate to a stuck file handle:
Code:
HDRFOX3# lsof -p `pgrep -n humaxtv`                                                                                 
COMMAND PID USER   FD   TYPE     DEVICE        SIZE     NODE NAME                                                   
humaxtv 310 root  cwd    DIR       31,0         183       90 /                                                       
humaxtv 310 root  rtd    DIR       31,0         183       90 /                                                       
humaxtv 310 root  txt    REG       31,0     6928784     1490 /usr/bin/humaxtv                                       
humaxtv 310 root  mem    REG       31,0       35395      179 /lib/ld-uClibc-0.9.29.so                               
humaxtv 310 root  mem    REG       31,2       11092     3613 /var/lib/humaxtv_backup/mod/libdustbin.so               
humaxtv 310 root  mem    REG       31,2        5824     3614 /var/lib/humaxtv_backup/mod/libfan.so                   
humaxtv 310 root  mem    REG       31,2       24712     3615 /var/lib/humaxtv_backup/mod/libir3.so                   
humaxtv 310 root  mem    REG       31,2       44888     3616 /var/lib/humaxtv_backup/mod/libnugget.so               
humaxtv 310 root  mem    REG       31,0      130232     1290 /usr/lib/libjpeg.so.62.0.0                             
humaxtv 310 root  mem    REG       31,0      515196     1327 /usr/lib/libfreetype.so.6.3.18                         
humaxtv 310 root  mem    REG       31,0      146048     1257 /usr/lib/libpng12.so.0.25.0                             
humaxtv 310 root  mem    REG       31,0       73724     1321 /usr/lib/libz.so.1.2.3                                 
humaxtv 310 root  mem    REG       31,0      292688     1294 /usr/lib/libid3-3.8.so.3.0.0                           
humaxtv 310 root  mem    REG       31,0      880464      183 /lib/libstdc++.so.6.0.9                                 
humaxtv 310 root  mem    REG       31,0      160180     1342 /usr/lib/libexif.so.12.2.0                             
humaxtv 310 root  mem    REG       31,0      137394     1325 /usr/lib/libblkid.so.1.0                               
humaxtv 310 root  mem    REG       31,0       24874     1349 /usr/lib/libcom_err.so.2.1                             
humaxtv 310 root  mem    REG       31,0       71092     1335 /usr/lib/libe2p.so.2.3                                 
humaxtv 310 root  mem    REG       31,0       67305     1333 /usr/lib/libss.so.2.0                                   
humaxtv 310 root  mem    REG       31,0       54281     1254 /usr/lib/libuuid.so.1.2                                 
humaxtv 310 root  mem    REG       31,0      180776     1324 /usr/lib/libext2fs.so.2.4                               
humaxtv 310 root  mem    REG       31,0      268564     1311 /usr/lib/libcurl.so.4.1.1                               
humaxtv 310 root  mem    REG       31,0      382642     1289 /usr/lib/libssl.so.1.0.0                               
humaxtv 310 root  mem    REG       31,0     2099815     1298 /usr/lib/libcrypto.so.1.0.0                             
humaxtv 310 root  mem    REG       31,0       21408     1384 /usr/browser/lib/liboperamalloc.so                     
humaxtv 310 root  mem    REG       31,0    14282058     1394 /usr/browser/lib/libopera.so.3.2                       
humaxtv 310 root  mem    REG       31,0      811801     1391 /usr/browser/lib/libopera_hbbtv.so                     
humaxtv 310 root  mem    REG       31,0     2845074     1390 /usr/browser/lib/libooif.so                             
humaxtv 310 root  mem    REG       31,0       11119     1389 /usr/browser/lib/libplugin_sysinfo.so                   
humaxtv 310 root  mem    REG       31,0        8617     1383 /usr/browser/lib/libplugin_upgrade.so                   
humaxtv 310 root  mem    REG       31,0       12956     1385 /usr/browser/lib/libplugin_systeminfoobject.so         
humaxtv 310 root  mem    REG       31,0        9362     1393 /usr/browser/lib/libplugin_ipconfig.so                 
humaxtv 310 root  mem    REG       31,0       10589     1395 /usr/browser/lib/libplugin_netstate.so                 
humaxtv 310 root  mem    REG       31,0       10546     1392 /usr/browser/lib/libplugin_lanconfigobject.so           
humaxtv 310 root  mem    REG       31,0       10589     1386 /usr/browser/lib/libplugin_wlanconfigobject.so         
humaxtv 310 root  mem    REG       31,0       37127     1388 /usr/browser/lib/libvideobackend.so                     
humaxtv 310 root  mem    REG       31,0     5798296     1330 /usr/lib/libnexus.so                                   
humaxtv 310 root  mem    REG       31,0       19472      168 /lib/librt-0.9.29.so                                   
humaxtv 310 root  mem    REG       31,0      109417      181 /lib/libpthread-0.9.29.so                               
humaxtv 310 root  mem    REG       31,0      837630      158 /lib/libuClibc-0.9.29.so                               
humaxtv 310 root  mem    REG       31,0       84568      152 /lib/libm-0.9.29.so                                     
humaxtv 310 root  mem    REG       31,0       11629      182 /lib/libdl-0.9.29.so                                   
humaxtv 310 root  mem    REG       31,0      305621      163 /lib/libgcc_s.so.1                                     
humaxtv 310 root  mem    CHR        1,1                 1695 /dev/mem                                               
humaxtv 310 root  mem    REG       31,0      520320     1482 /usr/browser/opera_dir/fonts/DejaVuSans.ttf             
humaxtv 310 root  mem    REG       31,0      460692     1480 /usr/browser/opera_dir/fonts/DejaVuSansCondensed.ttf   
humaxtv 310 root  mem    REG       31,0       65588     1481 /usr/browser/opera_dir/fonts/Tiresias.ttf               
humaxtv 310 root    0r   CHR        1,3                 1690 /dev/null                                               
humaxtv 310 root    1w   CHR        1,3                 1690 /dev/null                                               
humaxtv 310 root    2w   CHR        1,3                 1690 /dev/null                                               
humaxtv 310 root    3u  sock        0,4                 1197 can't identify protocol                                 
humaxtv 310 root    4u   CHR       30,0                 1779 /dev/brcm0                                             
humaxtv 310 root    5u   CHR        1,1                 1695 /dev/mem                                               
humaxtv 310 root    6u   CHR        1,1                 1695 /dev/mem                                               
humaxtv 310 root    7r   CHR       4,66                 1657 /dev/ttyS2                                             
humaxtv 310 root    8w   CHR       4,66                 1657 /dev/ttyS2                                             
humaxtv 310 root    9r   CHR      90,12                 1717 /dev/mtd6                                               
humaxtv 310 root   10r   CHR       90,6                 1706 /dev/mtd3                                               
humaxtv 310 root   11u  sock        0,4                 1202 can't identify protocol                                 
humaxtv 310 root   12u  unix 0x87d3a040                 1209 /tmp/..nugget                                           
humaxtv 310 root   13r   REG       0,11          80     1211 /hackir                                                 
humaxtv 310 root   14u   REG       0,12          43      296 /proc/bus/usb/001/001                                   
humaxtv 310 root   15u   REG       0,12          43      306 /proc/bus/usb/002/001                                   
humaxtv 310 root   16u   REG       0,12          43      316 /proc/bus/usb/003/001                                   
humaxtv 310 root   17u   REG       0,12          43      326 /proc/bus/usb/004/001                                   
humaxtv 310 root   18u   REG       31,1       10240    59265 /var/lib/humaxtv/rsv.db                                 
humaxtv 310 root   19r   BLK       8,16                 1747 /dev/sdb                                               
humaxtv 310 root   20u   CHR      241,0                 1786 /dev/hmxsdcon                                           
humaxtv 310 root   21r  FIFO        0,5                 2625 pipe                                                   
humaxtv 310 root   22w  FIFO        0,5                 2625 pipe                                                   
humaxtv 310 root   23w   REG       8,18 16845004800 12985067 /mnt/hd2/Tsr/0.ts                                       
humaxtv 310 root   24w   REG       8,18    49959616 12985068 /mnt/hd2/Tsr/0.nts                                     
humaxtv 310 root   25w   REG       8,18    49959616 12985068 /mnt/hd2/Tsr/0.nts                                     
humaxtv 310 root   26r   REG       31,0      159553     1478 /usr/browser/opera_dir/skin/standard_skin.zip           
humaxtv 310 root   27r   REG       31,0      520320      191 /opt/share/fonts/DejaVuSans.ttf                         
humaxtv 310 root   28r   REG       31,0      520320      191 /opt/share/fonts/DejaVuSans.ttf                         
humaxtv 310 root   29u  IPv4       3740                  TCP *:50001 (LISTEN)                                       
humaxtv 310 root   30u  IPv4       3742                  UDP HDRFOX3:57791                                           
humaxtv 310 root   32u  IPv4       3743                  UDP *:1900                                                 
humaxtv 310 root   33u  IPv4       3746                  TCP *:9000 (LISTEN)                                         
humaxtv 310 root   34u  IPv4       3747                  TCP *:9001 (LISTEN)                                         
humaxtv 310 root   35u   REG       8,18      865280    24625 /mnt/hd2/dms_cds.db                                     
humaxtv 310 root   36r  FIFO        0,5                 3749 pipe                                                   
humaxtv 310 root   37w  FIFO        0,5                 3749 pipe                                                   
humaxtv 310 root   38u  IPv4       3750                  TCP *:9955 (LISTEN)                                         
humaxtv 310 root   40w   REG       8,18      320070 20224551 /mnt/hd2/mod/tmp/nugget.log


The original example provided by BH did have the resume point set in the hmt.
I don't see the relevance. Resume works regardless of a reboot, so it can't rely on a mechanism which doesn't persist.
 
Back
Top