Commercial Detection fails wit exit 140 on 1080i recordings

Post Reply
Schulp
Newcomer
Posts: 4
Joined: Sun Jan 06, 2019 5:32 pm
United States of America

Commercial Detection fails wit exit 140 on 1080i recordings

Post by Schulp » Sun Jan 06, 2019 7:10 pm

Got mythtv-light 29 working just fine on a RasPi 3 B+ with backend and frontend on same Pi or remote FE. (One at a time with local FE idle. Haven't tried both simultaneously yet).
System has a single ATSC tuner.

It runs mythcommflag after recording is finished and does its job fine if recording is from one of the SD channels (that old stuff)

But it fails with return code 140 on the HD channels.

- tried shutting down the local frontend
- increased swap size to 2048kB

still does the same.

I wonder is commercial detection on 1080i just beyond what a 3 B+ should be doing or is there something else I could try to troubleshoot?

PS: Initially I had some trouble running backend as mythtv user, only worked as root, but I got that fixed. I assume if there are some leftover permission problems they would apply to both HD and SD recordings.

User avatar
bill6502
Developer
Posts: 1161
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Commercial Detection fails wit exit 140 on 1080i recordings

Post by bill6502 » Mon Jan 07, 2019 5:19 am

Hi,

mythbackend --serverbose system will give you a bit more information. I'm
guessing that the error code you're seeing is in the mythbackend.log (as
opposed to mythcommflag.log.)

The 140 is defined (in the MythTV project) as:

Code: Select all

GENERIC_EXIT_KILLED             140 ///< Process killed or stopped
The full command line will appear in mythbackend.log and you can use it
to run mythcommflag ... from the command line to see if it fails when
nothing else is running.

Schulp
Newcomer
Posts: 4
Joined: Sun Jan 06, 2019 5:32 pm
United States of America

Re: Commercial Detection fails wit exit 140 on 1080i recordings

Post by Schulp » Mon Jan 07, 2019 11:09 pm

Thanks, with your info I got the command line as

/usr/bin/mythcommflag -j 106 --noprogress --verbose general,jobqueue --logpath /home/mythtv/ --loglevel debug --quiet

so I ran this manually (without the quiet), first with the backend still running then without

in both cases it dies with seg fault:
....
2019-01-07 16:25:35.509915 I AFD: Opened codec 0xb657b0, id(MPEG2VIDEO) type(Video)
2019-01-07 16:25:35.582877 I JobQueue: ChangeJobStatus(106, Running, 'Building Logo Detection Buffer')
2019-01-07 16:25:35.583864 I JobQueue: ChangeJobComment(106, 'Building Logo Detection Buffer')
2019-01-07 16:25:35.632053 I JobQueue: ChangeJobStatus(106, Running, 'Searching for Logo')
2019-01-07 16:25:35.633129 I JobQueue: ChangeJobComment(106, 'Searching for Logo')
2019-01-07 16:25:35.634054 I Finding Logo
Handling Segmentation fault
Segmentation fault

and ....
2019-01-07 16:26:37.492360 I JobQueue: ChangeJobStatus(106, Running, 'Building Logo Detection Buffer')
2019-01-07 16:26:37.493098 I JobQueue: ChangeJobComment(106, 'Building Logo Detection Buffer')
2019-01-07 16:26:37.513887 I MythCoreContext::ConnectCommandSocket(): Connecting to backend server: 192.168.8.122:6543 (try 1 of 1)
2019-01-07 16:26:37.515209 E MythSocket(68c1c808:-1): Failed to connect to (127.0.0.1:6543) Connection refused
2019-01-07 16:26:37.515806 E Connection to master server timed out.
Either the server is down or the master server settings
in mythtv-settings does not contain the proper IP address

2019-01-07 16:26:37.517458 I JobQueue: ChangeJobStatus(106, Running, 'Searching for Logo')
2019-01-07 16:26:37.518464 I JobQueue: ChangeJobComment(106, 'Searching for Logo')
2019-01-07 16:26:37.519245 I Finding Logo
Handling Segmentation fault
Segmentation fault


to free some more memory I reduced memory split to 16MB (had it on 256MB for playing HD)
After this I get often different, but still memory related errors:

*** Error in `/usr/bin/mythcommflag': malloc(): memory corruption (fast): 0x01ed28a8 ***
or
*** Error in `/usr/bin/mythcommflag': corrupted size vs. prev_size: 0x00e0ca50 ***
or
*** Error in `/usr/bin/mythcommflag': double free or corruption (!prev): 0x00fe24d8 ***


One thing I noticed after changing the memory split was that there was a failure with Open Max init. So I'm wondering does mythcommflag read the frontend config to determine which codec to use for looking at the content (logo detection, black frame)?

Thanks

User avatar
pgbennett
Developer
Posts: 282
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: Commercial Detection fails wit exit 140 on 1080i recordings

Post by pgbennett » Tue Jan 08, 2019 12:02 am

No it does not use OpenMAX for decoding during commercial flagging.
I do not recommend running a backend on raspberry pi, commercial flagging is likely way past its capabilities.

Schulp
Newcomer
Posts: 4
Joined: Sun Jan 06, 2019 5:32 pm
United States of America

Re: Commercial Detection fails wit exit 140 on 1080i recordings

Post by Schulp » Tue Jan 08, 2019 4:08 am

pgbennett wrote:
Tue Jan 08, 2019 12:02 am
No it does not use OpenMAX for decoding during commercial flagging.
I do not recommend running a backend on raspberry pi, commercial flagging is likely way past its capabilities.
yeah, that's what I suspected as mentioned before. It's just such a nice quiet and low power solution, but in the long run I might want to add another tuner and by then I'd prefer to move the storage drive off the USB by then I certainly need to move to some other platform for the backend. For the time being not having commercial flagging on 1080 is bearable since most HD I record is from public TV. and flagging works on SD.

Surprisingly transcoding to H.264 works for SD as well for HD which I would have thought needs more resources. Probably it's just a big chunk of memory that mythcommflag would need but doesn't get (even on the 3 B+).

Schulp
Newcomer
Posts: 4
Joined: Sun Jan 06, 2019 5:32 pm
United States of America

Re: Commercial Detection fails wit exit 140 on 1080i recordings

Post by Schulp » Tue Jan 08, 2019 4:24 am

Just a note on the side: mythbackend --setverbose

doesn't seem to work on the current release. The backend log shows this

2019-01-07 15:30:15.504391 E [1020/1211] ProcessRequest mainserver.cpp:7092 (HandleSetVerbose) - MainServer: Invalid SET_VERBOSE string: 'SET_VERBOSE '

so I actually used:
mythbackend --loglevel debug -v jobqueue --logpath /media/mythtv/Video/log --user mythtv -d

to get more detailed logging about the jobs launched.

Post Reply