Mythbuntu 16.04 Backend 29.1 CPU usage constantly about 18-30% [solved]

For discussion related to MythTV which doesn't belong in another forum.

Moderator: Forum Moderators

Post Reply
Doppel-D
Newcomer
Posts: 14
Joined: Fri Jul 13, 2018 4:24 pm
Germany

Mythbuntu 16.04 Backend 29.1 CPU usage constantly about 18-30% [solved]

Post by Doppel-D » Wed Aug 08, 2018 3:34 pm

and peaks to 70% without any job / recording / playing running. Checked with top. It is an AMD E-450 1,6Ghz dual core. Only mass storage is a 240GB SSD.

Anyone has some values to compare?
Last edited by Doppel-D on Tue Sep 11, 2018 10:45 pm, edited 4 times in total.

User avatar
heyted
Junior
Posts: 54
Joined: Sun Jun 08, 2014 2:14 am
Location: South Florida
Contact:
United States of America

Re: Mythbuntu 16.04 Backend 29.1 CPU usage constantly about 18-30%

Post by heyted » Thu Aug 09, 2018 1:15 am

Does it have Radeon graphics? Have you tried using VDPAU? https://www.mythtv.org/wiki/VDPAU

Edit: The above information is for a frontend or combined system.
Last edited by heyted on Thu Aug 30, 2018 12:36 am, edited 1 time in total.

Doppel-D
Newcomer
Posts: 14
Joined: Fri Jul 13, 2018 4:24 pm
Germany

Re: Mythbuntu 16.04 Backend 29.1 CPU usage constantly about 18-30%

Post by Doppel-D » Thu Aug 09, 2018 2:19 pm

Hey Ted,
thank you for you input! The Laptop came from a junk yard with broken TFT. It has Radeon graphic and surely a problem with it because some VRAMs are defective (crashed every time when I tried Windows + driver and dmesg on linux is giving me a

radeon 0000:01:00.0: Fatal error during GPU init
[ 4.219249] [drm] radeon: finishing device.
[ 4.219252] [TTM] Memory type 2 has not been initialized
radeon: probe of 0000:01:00.0 failed with error -12

So this is how it ends as a mythtv server ;- )

Are you sure VDPAU is used at all on a pure backend? Perhaps you assumend a combined front/backend on one machine?

I once already had it running as server but a bad cloning attempt with clonzilla destroyed the installation. On this first installation this "high" CPU usage didn't occur or I didn't realized it.

The second, current installation was with a database import and that's where the problems started, at least in my perception. Perhaps only coincidence.
regards

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

Re: Mythbuntu 16.04 Backend 29.1 CPU usage constantly about 18-30%

Post by bill6502 » Thu Aug 09, 2018 5:10 pm

I'd give htop --user mythtv a shot (assuming the backend is running as
user mythtv.) Then type H to see all threads, H is a toggle.

If that displays an offending PID, then: ps --user mythtv -L | sort --key=3
and see if the output helps. You'll see that some of the CMDs are duplicated,
and that mythbackend itself is probably there twice (and not of much help.)
You're looking for the PID discovered in htop.

Maybe that will give you enough information to look in the backend log for
something. You may need to increase the loglevel and or debug level based
on the output of the ps. mythbackend -v help.

mythbackend --setverbose eit:debug,system:debug (just as an example.)

Doppel-D
Newcomer
Posts: 14
Joined: Fri Jul 13, 2018 4:24 pm
Germany

Re: Mythbuntu 16.04 Backend 29.1 CPU usage constantly about 18-30%

Post by Doppel-D » Thu Aug 09, 2018 10:27 pm

Thank you @bill6502! This helped to gather more information. Both consuming threads were DVBRead but without any action e.g. recording taking place (I have two different USB tuner). Will continue examining the logs as you suggested and check my configuration.

Perhaps something got screwed up during the database import.

Thanks again!

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

Re: Mythbuntu 16.04 Backend 29.1 CPU usage constantly about 18-30%

Post by bill6502 » Fri Aug 10, 2018 12:00 am

The string: DVBRead appears exactly once in the source code. Additional logging is available
with -v record:debug. I assume you've already restarted the backend (and or rebooted the host.)

It may be of value to restart the backend with record:debug turned on, so that if the issue is started
at boot time you'll see it.

Type systemctl cat mythtv-backend and make sure there's a line like: EnvironmentFile=-/etc/mythtv/additional.args
in it. If you don't already have that file, then create it and put any additional command line switched there, e.g.

Code: Select all

ADDITIONAL_ARGS="-v record:debug"
The - in front of the filename just tells systemd not to abort if the file doesn't exist.

Don't forget to remove ADDITIONAL_ARGS and restart the BE. Or, just comment it out with a #.

Doppel-D
Newcomer
Posts: 14
Joined: Fri Jul 13, 2018 4:24 pm
Germany

Re: Mythbuntu 16.04 Backend 29.1 CPU usage constantly about 18-30%

Post by Doppel-D » Sat Aug 11, 2018 4:43 pm

Hello bill6502,

thank you for the debugging instructions! I tried every encoder alone to see if there is a different outcome, but they are showing the same behavior. First everything ok and after a while problems begin. It is still possible to watch / record but when idle I got the described increased CPU load and if I go to the backend setup for the cards there is an error, but as described, still operational. BTW harware is
  1. TechnoTrend TT-TVStick CT2-4400v2
  2. TechnoTrend TT-connect CT2-4650 CI V1.1
Perhaps I am lucky and errors are already known (not searched for it yet). I think I will start with a new test installation with stock kernel.

kind regards, Eric

Code: Select all

Aug 11 16:31:22 backmyth mythbackend: mythbackend[1036]: E ProcessRequest mainserver.cpp:4732 (HandleRemoteEncoder) MainServer: HandleRemoteEncoder(cmd GET_STATE) Unknown encoder: 1
Aug 11 16:31:22 backmyth mythbackend: mythbackend[1036]: E ProcessRequest mainserver.cpp:4732 (HandleRemoteEncoder) MainServer: HandleRemoteEncoder(cmd GET_STATE) Unknown encoder: 2
Aug 11 16:35:26 backmyth mythbackend: mythbackend[1057]: E CoreContext scheduler.cpp:187 (VerifyCards) Scheduler: No capture cards are defined in the database.#012#011#011#011Perhaps you should re-read the installation instructions?
Aug 11 17:21:24 backmyth mythbackend: mythbackend[931]: E DVBRead recorders/dtvsignalmonitor.cpp:361 (HandlePMT) DTVSigMon[1](/dev/dvb/adapter0/frontend0): Wrong PMT; pmt->pn(11110) desired(28006)
Aug 11 17:21:24 backmyth mythbackend: mythbackend[931]: E DVBRead recorders/dtvsignalmonitor.cpp:361 (HandlePMT) DTVSigMon[1](/dev/dvb/adapter0/frontend0): Wrong PMT; pmt->pn(28007) desired(28006)
Aug 11 17:21:24 backmyth mythbackend: mythbackend[931]: E DVBRead recorders/dtvsignalmonitor.cpp:361 (HandlePMT) DTVSigMon[1](/dev/dvb/adapter0/frontend0): Wrong PMT; pmt->pn(28008) desired(28006)
Aug 11 17:21:24 backmyth mythbackend: mythbackend[931]: E DVBRead recorders/dtvsignalmonitor.cpp:361 (HandlePMT) DTVSigMon[1](/dev/dvb/adapter0/frontend0): Wrong PMT; pmt->pn(28011) desired(28006)
Aug 11 17:21:24 backmyth mythbackend: mythbackend[931]: E DVBRead recorders/dtvsignalmonitor.cpp:361 (HandlePMT) DTVSigMon[1](/dev/dvb/adapter0/frontend0): Wrong PMT; pmt->pn(28012) desired(28006)
Aug 11 17:21:24 backmyth mythbackend: mythbackend[931]: E DVBRead recorders/dtvsignalmonitor.cpp:361 (HandlePMT) DTVSigMon[1](/dev/dvb/adapter0/frontend0): Wrong PMT; pmt->pn(28013) desired(28006)
Aug 11 17:21:24 backmyth mythbackend: mythbackend[931]: E DVBRead recorders/dtvsignalmonitor.cpp:361 (HandlePMT) DTVSigMon[1](/dev/dvb/adapter0/frontend0): Wrong PMT; pmt->pn(28014) desired(28006)
Aug 11 17:21:24 backmyth mythbackend: mythbackend[931]: E DVBRead recorders/dtvsignalmonitor.cpp:361 (HandlePMT) DTVSigMon[1](/dev/dvb/adapter0/frontend0): Wrong PMT; pmt->pn(28017) desired(28006)
Aug 11 18:03:45 backmyth mythbackend: mythbackend[918]: E SignalMonitor recorders/dvbchannel.cpp:1074 (GetSignalStrength) DVBChan[1](/dev/dvb/adapter0/frontend0): Getting Frontend signal strength failed.#012#011#011#011eno: Operation not supported (95)
Aug 11 18:09:00 backmyth mythbackend: mythbackend[918]: E SignalMonitor recorders/dvbchannel.cpp:1074 (GetSignalStrength) DVBChan[1](/dev/dvb/adapter0/frontend0): Getting Frontend signal strength failed.#012#011#011#011eno: Operation not supported (95)
Aug 11 18:14:15 backmyth mythbackend: mythbackend[918]: E SignalMonitor recorders/dvbchannel.cpp:1074 (GetSignalStrength) DVBChan[1](/dev/dvb/adapter0/frontend0): Getting Frontend signal strength failed.#012#011#011#011eno: Operation not supported (95)
mythtv-setup.log

Code: Select all

Aug 11 17:54:00 backmyth mythtv-setup.real: mythtv-setup[2204]: E ScreenLoad v4l2util.cpp:58 (Open) V4L2(): Could not open '': #012#011#011#011eno: No such file or directory (2)
Aug 11 17:54:00 backmyth mythtv-setup.real: mythtv-setup[2204]: E ScreenLoad cardutil.cpp:504 (ProbeDVBType) Can't open DVB frontend (/dev/dvb/adapter0/frontend0) for /dev/dvb/adapter0/frontend0.
Aug 11 17:54:00 backmyth mythtv-setup.real: mythtv-setup[2204]: W ScreenLoad diseqc.cpp:395 (Load) DiSEqCDevTree: No device tree for cardid 1
Aug 11 17:54:00 backmyth mythtv-setup.real: mythtv-setup[2204]: W ScreenLoad diseqc.cpp:395 (Load) DiSEqCDevTree: No device tree for cardid 1
Aug 11 17:54:00 backmyth mythtv-setup.real: mythtv-setup[2204]: E ScreenLoad cardutil.cpp:1783 (ProbeV4LAudioInputs) ProbeAudioInputs() -> couldn't open device
Aug 11 17:54:00 backmyth mythtv-setup.real: mythtv-setup[2204]: E ScreenLoad v4l2util.cpp:58 (Open) V4L2(): Could not open '/dev/dvb/adapter0/frontend0': #012#011#011#011eno: Device or resource busy (16)
Aug 11 17:54:17 backmyth mythtv-setup.real: mythtv-setup[2204]: I CoreContext mythcontext.cpp:1610 (~MythContext) Waiting for threads to exit.

Doppel-D
Newcomer
Posts: 14
Joined: Fri Jul 13, 2018 4:24 pm
Germany

Re: Mythbuntu 16.04 Backend 29.1 CPU usage constantly about 18-30%

Post by Doppel-D » Sun Aug 12, 2018 9:50 am

There is a problem with the EPG data over EIT. If I disable EIT on both tuners the never ending high CPU utilization stops. Not sure if there is a general problem or only for some channels.

Addendum:
Now I remember the difference to my first installation: This time I included radio stations. Disabled EPG for them and will see if this helps and enabled EPG over EIT only on one tuner.

Update:
Didn't help. As soon as EPG over EIT is enabled at some point tuner cracks with error although some / all EPG date is retrieved. Disabling EPG for the radio stations also seens unnescessary because EPG information is also available for them.

Doppel-D
Newcomer
Posts: 14
Joined: Fri Jul 13, 2018 4:24 pm
Germany

Re: Mythbuntu 16.04 Backend 29.1 CPU usage constantly about 18-30%

Post by Doppel-D » Mon Aug 13, 2018 8:58 am

Deleted video sources / channel list, rescanned only tv and dropped mpeg and some other strange channels which name / classification I can't renember. For now good, EPG data is coming and cpu load is back to normal.

Some errors similar before this fix still occur but they seem irrelevant for the main problem

Code: Select all

Aug 13 10:17:01 backmyth mythbackend: mythbackend[1084]: E DVBRead recorders/dtvsignalmonitor.cpp:361 (HandlePMT) DTVSigMon[1](/dev/dvb/adapter0/frontend0): Wrong PMT; pmt->pn(28487) desired(11100)
Aug 13 10:17:01 backmyth mythbackend: mythbackend[1084]: E DVBRead recorders/dtvsignalmonitor.cpp:361 (HandlePMT) DTVSigMon[1](/dev/dvb/adapter0/frontend0): Wrong PMT; pmt->pn(28721) desired(11100)
Aug 13 10:17:02 backmyth mythbackend: mythbackend[1084]: E DVBRead recorders/dtvsignalmonitor.cpp:361 (HandlePMT) DTVSigMon[1](/dev/dvb/adapter0/frontend0): Wrong PMT; pmt->pn(28722) desired(11100)
Aug 13 10:17:02 backmyth mythbackend: mythbackend[1084]: E DVBRead recorders/dtvsignalmonitor.cpp:361 (HandlePMT) DTVSigMon[1](/dev/dvb/adapter0/frontend0): Wrong PMT; pmt->pn(28724) desired(11100)
Aug 13 10:17:02 backmyth mythbackend: mythbackend[1084]: E DVBRead recorders/dtvsignalmonitor.cpp:361 (HandlePMT) DTVSigMon[1](/dev/dvb/adapter0/frontend0): Wrong PMT; pmt->pn(28725) desired(11100)

MikeB2013
Senior
Posts: 305
Joined: Mon Jul 25, 2016 4:16 pm
Great Britain

Re: Mythbuntu 16.04 Backend 29.1 CPU usage constantly about 18-30% [solved]

Post by MikeB2013 » Mon Aug 13, 2018 9:45 am

The "Wrong PMT" messages can be ignored, I get them all the time, but with no detrimental effect.

I think the logging level for these messages is wrong, it is currently set to VB_GENERAL, LOG_ERR, in my view, it would be better set to VB_CHANNEL, LOG_DEBUG so the messages would only be seen when debugging. I can submit a patch for this if other people think it is worthwhile.

Doppel-D
Newcomer
Posts: 14
Joined: Fri Jul 13, 2018 4:24 pm
Germany

Re: Mythbuntu 16.04 Backend 29.1 CPU usage constantly about 18-30% [solved]

Post by Doppel-D » Mon Aug 13, 2018 4:56 pm

Would be interesting how a developer would comment on that, if it is only a cosmetical issue.

Doppel-D
Newcomer
Posts: 14
Joined: Fri Jul 13, 2018 4:24 pm
Germany

Re: Mythbuntu 16.04 Backend 29.1 CPU usage constantly about 18-30% [unsolved]

Post by Doppel-D » Fri Aug 17, 2018 4:11 pm

After some days of normal operation the system gone havoc again and cpu usage ramped up again to 15-50%. Process mythbackend with subprocess? 2 times DVBRead and of course the already known problem when I enter mythtv-setup and look at TV CARDS...FRONTEND ID "could not retrieve information about card dev/dvb/adapter0/frontend0, SUBTYPE "unknown error"

I have changed nothing in between, only tv watching / recording....and some ubuntu updates and some mythtv related updates. Dang.

...and another thing to switch from DVB-T to cable: rc.local

sleep 10
dvb-fe-tool -d DVBC/ANNEX_A
dvb-fe-tool -a 1 -d DVBC/ANNEX_A

Perhaps start with this and deactivate to outrule any influence.

Doppel-D
Newcomer
Posts: 14
Joined: Fri Jul 13, 2018 4:24 pm
Germany

Re: Mythbuntu 16.04 Backend 29.1 CPU usage constantly about 18-30% [unsolved]

Post by Doppel-D » Fri Aug 17, 2018 4:41 pm

As soon as I manually switch also only one tuner to cable the mess starts, so that's outruled ;- )

Doppel-D
Newcomer
Posts: 14
Joined: Fri Jul 13, 2018 4:24 pm
Germany

Re: Mythbuntu 16.04 Backend 29.1 CPU usage constantly about 18-30% [unsolved]

Post by Doppel-D » Tue Sep 11, 2018 10:43 pm

Strange thing...although I disabled EPG over EIT on booth cards EPG data is coming in, CPU load is low and so it's kind of solved ;- )

...but what is happening and why?

Post Reply