Installation on Debian 9.5 "Stretch"

For discussion of topics specific to MythTV on linux
luker
Newcomer
Posts: 10
Joined: Sun May 27, 2018 1:13 pm
Germany

Installation on Debian 9.5 "Stretch"

Post by luker »

Hi forum,

in an attempt to install MythTV 29 on Debian 9.5 "Stretch", I came across https://www.mythtv.org/wiki/Installing_MythTV_on_Debian , which refers to https://www.mythtv.org/wiki/Build_from_ ... ut_Ansible to resolve dependencies.

At the moment, I'm trying to get the compile-time-dependencies right.
apt responds with this:

Code: Select all

Paketlisten werden gelesen...
Abhängigkeitsbaum wird aufgebaut....
Statusinformationen werden eingelesen....
Paket libmysqlclient-dev ist nicht verfügbar, wird aber von einem anderen Paket
referenziert. Das kann heißen, dass das Paket fehlt, dass es abgelöst
wurde oder nur aus einer anderen Quelle verfügbar ist.

E: Für Paket "libmysqlclient-dev" existiert kein Installationskanidat.
E: Paket libcec4-dev kann nicht gefunden werden.
That's all in German but boils down to two missing packages
1)libmysqlclient-dev and
2)libcec4-dev.

(1) apt doesn't complain about the other packages related to mysql. Is this one in a special repo?
Here's my sources.list file

Code: Select all

deb cdrom:[Debian GNU/Linux 9.4.0 _Stretch_ - Official amd64 xfce-CD Binary-1 20180310-11:21]/ stretch main

deb http://ftp.de.debian.org/debian/stretch main non-free contrib
deb-src http://ftp.de.debian.org/debian/stretch main non-free contrib

deb http://security.debian.org/debian-security stretch/updates main contrib non-free
deb-src http://security.debian.org/debian-security stretch/updates main contrib non-free

# stretch-updates, previously known as 'volatile'
deb http://ftp.de.debian.org/debian/ stretch-updates main contrib non-free
deb-src http://ftp.de.debian.org/debian/ stretch-updates main contrib non-free
(2) maybe the one that was correct for 0.27?
Last edited by Steve Goodey on Mon May 28, 2018 2:53 pm, edited 1 time in total.
Reason: URLs corrected.
User avatar
pgbennett
Developer
Posts: 503
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: Installation on Debian 9.5 "Stretch"

Post by pgbennett »

I think they should be just libcec-dev and default-libmysqlclient-dev.

However I think that libmysqlclient-dev is not required and that unless you plan on using cec, which requires special equipment or a raspberry pi, you can build without cec.
luker
Newcomer
Posts: 10
Joined: Sun May 27, 2018 1:13 pm
Germany

Re: Installation on Debian 9.5 "Stretch"

Post by luker »

They are deliberately changed to those packages

libmysqlclient-dev is used for MythTV versions 0.28 and 29.0 instead of default-libmysqlclient-dev, which is used for older MythTV versions.
libcec4-dev is used for debian stretch instead of libcec-dev, which is used for older debian versions.

I presume that there is some reason for those packages being changed from an earlier version or for a given distribution. Does someone know why or, even better, where to get the requested packages?
User avatar
pgbennett
Developer
Posts: 503
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: Installation on Debian 9.5 "Stretch"

Post by pgbennett »

The contents of libcec-dev are now what used to be called libcec4-dev. If you install libcec-dev then look at file /usr/include/libcec/version.h you can see the version is listed as version 4. (at least that is what I see with Ubuntu 18.04).

For libmysqlclient-dev, on Ubuntu libmysqlclient-dev has all the files and default-libmysqlclient-dev is a dummy package with only 2 files, a changelog and a copyright, and a dependency on libmysqlclient-dev, so that libmysqlclient-dev is installed. I think the message ere is that these two are really the same and you can use either. (at least on Ubuntu 18.04)
luker
Newcomer
Posts: 10
Joined: Sun May 27, 2018 1:13 pm
Germany

Re: Installation on Debian 9.5 "Stretch"

Post by luker »

I can confirm now that with libcec-dev instead of libcec4-dev and with default-libmysqlclient-dev instead of libmysqlclient-dev, compilation succeeds without errors.

1) Maybe changing https://www.mythtv.org/wiki/Build_from_ ... ut_Ansible to reflect this would be a good idea.
I cannot log in to the page's discussion. Is that a different account from the mythtv one that is needed? At mediawiki maybe?

MythTV is also installed and integrated in the start menu.
MariaDB is installed.
User mythtv gets created for the OS and is known to MariaDB as well.

But mythbackend is unable to start. Access for user mythtv is denied. So I'm off to execute the SQL script in /usr/share/mythtv/sql/mc.sql.
The user there is called mythtv@localhost. I saw other guides that refer to mythtv@%. I'm planning to add another mythtv frontend later.

2) Do I need to access the database from a remote frontend or do I access the backend from remote and the backend in turn connects to the database with its localhost mythtv user?
MikeB2013
Senior
Posts: 519
Joined: Mon Jul 25, 2016 4:16 pm
Great Britain

Re: Installation on Debian 9.5 "Stretch"

Post by MikeB2013 »

Just in case you are not aware, mythtv-setup does not currently setup membership of mythtv group (it should but there is a bug, which has been reported). To fix run in a terminal session using either sudo (if you set sudo up on your Debian Stretch installation) or switch to root using su:
"sudo adduser $USER mythtv"
and then logout or reboot.

You can then use,in a terminal session, systemctl commands to stop/start mythtv-backend
sudo systemctl stop mythtv-backend
mythtv-setup
First time you run mythtv-setup login to database will fail (it uses a default password of mythtv, but the installation created an 8 character alpha-numeric password in /etc/mythtv/config.xml, use the 8 characters between >< in Password line).
luker
Newcomer
Posts: 10
Joined: Sun May 27, 2018 1:13 pm
Germany

Re: Installation on Debian 9.5 "Stretch"

Post by luker »

Thank you. The membership group issue had somehow already dawned on me and is fixed.

Now, with knowledge of the correct password, mythtv-setup even connects to the database.

Next challenge: after some setting up the parameters in mythtv-setup, I came across the channel scan. It doesn't work: "Error parsing parameters" (quoted from memory).
I tried using /[forgotten]/dvb/adapter0 instead of /[forgotten]/dvb/adapter0/frontend0, but that only leads to "Cannot open capture card".
[Edit]
Watching TV works in VLC with above mentioned dvb/adapter0.
[/Edit]

Is there something that can easily go wrong here?
Last edited by luker on Thu May 31, 2018 10:52 am, edited 1 time in total.
MikeB2013
Senior
Posts: 519
Joined: Mon Jul 25, 2016 4:16 pm
Great Britain

Re: Installation on Debian 9.5 "Stretch"

Post by MikeB2013 »

Without knowing what type of tuner card you have, I can only guess.
"Cannot open capture card" can be caused by mythtv-backend service still running when using mythtv-setup or the /dev/dvb/adapter<n> has not been created properly on bootup of the machine (usually due to missing firmware in /lib/firmware/)

The following are all done in a terminal session.

You can check if mythbackend is running by
ps -A | grep my

example output

Code: Select all

  807 ?        00:17:07 mysqld
 1374 ?        02:53:05 mythbackend
 6147 pts/0    00:03:39 mythfrontend
If mythbackend is shown you need to stop it (mythtv-setup requires exclusive access to capture cards)
sudo systemctl stop mythtv-backend

You can check what adapters have been setup by (note sudo is needed for dmesg in Debian Stretch)
sudo dmesg | grep frontend

example output (I have 6 adapters on my system)

Code: Select all

[    3.266332] cx23885: cx23885_dvb_register() allocating 1 frontend(s)
[    3.283585] cx23885 0000:05:00.0: DVB: registering adapter 0 frontend 0 (Silicon Labs Si2168)...
[    3.283872] cx23885: cx23885_dvb_register() allocating 1 frontend(s)
[    3.296863] cx23885 0000:05:00.0: DVB: registering adapter 1 frontend 0 (Silicon Labs Si2168)...
[    3.640220] cx23885: cx23885_dvb_register() allocating 1 frontend(s)
[    3.649427] cx23885 0000:06:00.0: DVB: registering adapter 2 frontend 0 (Silicon Labs Si2168)...
[    3.649715] cx23885: cx23885_dvb_register() allocating 1 frontend(s)
[    3.656262] cx23885 0000:06:00.0: DVB: registering adapter 3 frontend 0 (Silicon Labs Si2168)...
[    6.280834] cx23885: cx23885_dvb_register() allocating 1 frontend(s)
[    6.285450] i2c i2c-11: cx24117: Attaching frontend 0
[    6.285454] cx23885 0000:09:00.0: DVB: registering adapter 4 frontend 0 (Conexant CX24117/CX24132)...
[    6.285797] cx23885: cx23885_dvb_register() allocating 1 frontend(s)
[    6.285802] i2c i2c-11: cx24117: Attaching frontend 1
[    6.285804] cx23885 0000:09:00.0: DVB: registering adapter 5 frontend 0 (Conexant CX24117/CX24132)...
You can also use
ls /dev/dvb/*

example output

Code: Select all

/dev/dvb/adapter0:
demux0  dvr0  frontend0  net0

/dev/dvb/adapter1:
demux0  dvr0  frontend0  net0

/dev/dvb/adapter2:
demux0  dvr0  frontend0  net0

/dev/dvb/adapter3:
demux0  dvr0  frontend0  net0

/dev/dvb/adapter4:
demux0  dvr0  frontend0  net0

/dev/dvb/adapter5:
demux0  dvr0  frontend0  net0

Mike
luker
Newcomer
Posts: 10
Joined: Sun May 27, 2018 1:13 pm
Germany

Re: Installation on Debian 9.5 "Stretch"

Post by luker »

I'm sorry that I didn't mention the hardware in question. It's a Pinnacle PCTV Sat (DVB-S, not DVB-S2) card.
Taken from dmesg:

Code: Select all

$ sudo dmesg | grep -i -B 10 -A 10 -e bt878 -e dvb -e frontend -e conexant
[    5.424459] shpchp: Standard Hot Plug PCI Controller Driver version: 0.4
[    5.426279] bttv: Bt8xx card found (0)
[    5.426416] bttv: 0: Bt878 (rev 17) at 0000:00:0b.0, irq: 19, latency: 128, mmio: 0xcfffe000
[    5.427425] bttv: 0: detected: Pinnacle PCTV Sat [card=94], PCI subsystem ID is 11bd:001c
[    5.427427] bttv: 0: using: Pinnacle PCTV Sat [card=94,autodetected]
[    5.427537] bttv: 0: tuner absent
[    5.427573] bttv: 0: Setting PLL: 28636363 => 35468950 (needs up to 100ms)
[    5.464017] bttv: PLL set ok
[    5.464106] bttv: 0: registered device video0
[    5.464157] bttv: 0: registered device vbi0
[    5.464186] bttv: 0: add subdevice "dvb0"
[    5.475777] bt878: AUDIO driver version 0.0.0 loaded
[    5.475810] bt878: Bt878 AUDIO function found (0).
[    5.475970] bt878_probe: card id=[0x1c11bd],[ Pinnacle PCTV Sat ] has DVB functions.
[    5.475976] bt878(0): Bt878 (rev 17) at 00:0b.1, 
[    5.475978] irq: 19, latency: 128, memory: 0xcffff000
[    5.821725] DVB: registering new adapter (bttv0)
[    5.996845] bt878 0000:00:0b.1: DVB: registering adapter 0 frontend 0 (Conexant CX24110 DVB-S)...
But there's no

Code: Select all

[    X.XXXXXX] cx24110: cx24110_dvb_register() allocating 1 frontend(s)
after that.

And it is the only tuner card:

Code: Select all

$ ls /dev/dvb*
adapter0
$ ls /dev/dvb/adapter0/
demux0  dvr0  frontend0  net0
And maybe lspci can help

Code: Select all

$ lspci -nn
00:0b.0 Multimedia video controller [0400]: Brooktree Corporation Bt878 Video Capture [109e:036e] (rev 11)
00:0b.1 Multimedia controller [0480]: Brooktree Corporation Bt878 Audio Capture [109e:0878] (rev 11)

lspci -v
00:0b.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)
	Subsystem: Pinnacle Systems Inc. PCTV Sat (DBC receiver)
	Flags: bus master, medium devsel, latency 128, IRQ 19
	Memory at cfffe000 (32-bit, prefetchable) [size=4K]
	Capabilities: <access denied>
	Kernel driver in use: bttv
	Kernel modules: bttv

00:0b.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)
	Subsystem: Pinnacle Systems Inc. PCTV Sat (DBC receiver)
	Flags: bus master, medium devsel, latency 128, IRQ 19
	Memory at cffff000 (32-bit, prefetchable) [size=4K]
	Capabilities: <access denied>
	Kernel driver in use: bt878
	Kernel modules: bt878
mysqld is running, mythbackend is not. But there ain't no firmware in /lib/firmware. Actually, there's no directory /lib/firmware at all.
On this machine, I'm dual-booting with an older MythBuntu 12.04, which I want to replace with what I'm trying here. That other installation has a /lib/firmware directory with (among others)

Code: Select all

v4l-cx231xx-avcore-01.fw
v4l-cx23418-apu.fw
v4l-cx23418-cpu.fw
v4l-cx23418-dig.fw
v4l-cx2341x-dec.fw
v4l-cx2341x-enc.fw
v4l-cx2341x-init.mpg
v4l-cx23885-avcore-01.fw
v4l-cx23885-enc.fw
v4l-cx25840.fw
v4l-pvrusb2-24xxx-01.fw
v4l-pvrusb2-29xxx-01.fw
Is that what I'm after?
Is it a good idea to copy those? Or is there a firmware package to install (the description of firmware-ivtv lists some Conexant stuff)?
MikeB2013
Senior
Posts: 519
Joined: Mon Jul 25, 2016 4:16 pm
Great Britain

Re: Installation on Debian 9.5 "Stretch"

Post by MikeB2013 »

Don't know if you need firmware for that PCTV card.
I forgot, Debian does not install most firmware by default, so /lib/firmware/ may not exist or have minimal contents.
If you need firmware, add contrib and non-free to your sources list and then install firmware-linux to get most of the firmware.
see https://linuxconfig.org/how-to-install- ... etch-linux ( just do the first bits upto but not including LLVM and then reboot)

The normal way to setup a DVB-S tuner using mythtv-setup is to:
start mythtv-setup from a terminal session
select Capture Cards
new capture card
make sure "DiSEqC (Switch, LNB, and Rotor Configuration)" has LNB set (common use, or select whatever is required from the drop down list), exit saving changes

select Video Sources
create new video source
make sure you set grabber to what is required (EIT is a good start, if provided by the Satellite), exit saving changes.

Input Connections (this is where you will scan the Satellite for channels)
You need Frequency, Polarity, and Symbol Rate data for your satellite.

Mike
luker
Newcomer
Posts: 10
Joined: Sun May 27, 2018 1:13 pm
Germany

Re: Installation on Debian 9.5 "Stretch"

Post by luker »

Installing firmware-linux didn't help in setting up my capture card. And now that I think of it, that was probably the wrong path since watching TV works in VLC with this card. It still does, but lacks MythTV's convenience for you have to enter a station's frequency, orientation and symbol rate to change channels.

In mythtv-setup's capture card settings, the DVB device is set to /dev/dvb/adapter0/frontend0. It automatically fills in the next lines Frontend-ID "Conexant CX24110 DVB-S" and Subtype "DVB-S", so I guess, something works in some way. DiSEqC is set to "LNB".

Starting a channel scan results in the error message "Error analyzing parameters" (my translation from German).
I tried following the cards->sources->connections->scan route but there must be something else.

Starting mythtv-setup first opens a new terminal window, then the gui. From this terminal:

Code: Select all

2018-06-01 20:45:15.364503 I  Assumed character encoding: de_DE.utf8
2018-06-01 20:45:15.364512 W  This application expects to be running a locale that specifies a UTF-8 codeset, and many features may behave improperly with your current language settings. Please set the LC_ALL or LC_CTYPE, and LANG variable(s) in the environment in which this program is executed to include a UTF-8 codeset (such as 'en_US.UTF-8').
And several complaints about missing font Droid Sans and that DejaVu Sans would be used instead.
I checked the environment variables in my console

Code: Select all

$ printenv | grep -e LC_ALL -e LC_CTYPE -e LANG
LANG=de_DE.utf8
But maybe that's not relevant for this other terminal window that opens before myhttv-setup gui.

Any thoughts what parameters could analyze erroneous for a channel scan? I mean, they are all in drop-downs or checkboxes.
My settings are:
Service: TV (not TV+Radio, not All)
Only unencrypted [v]
Check decryptability [_]
Video Source: "dish" (not changeable. It is the only source that I have set up)
Input: "DVB : /dev/dvb/adapter0/frontend0 (DVBInput)" (for unknown reasons, the corresponding dropdown contains this twice)
Scan Type: Complete (tuned)
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Installation on Debian 9.5 "Stretch"

Post by bill6502 »

Very little help, but if your message is a popup and auf Deutsch: Fehler beim Analysieren der Parameter
then it's: Error parsing parameters.

It's after the "if" here: https://code.mythtv.org/cgit/mythtv/tre ... d.cpp#n152
which calls: https://code.mythtv.org/cgit/mythtv/tre ... x.cpp#n347 and
https://code.mythtv.org/cgit/mythtv/tre ... x.cpp#n228 seems to be the
actual list of parameters checked.
luker
Newcomer
Posts: 10
Joined: Sun May 27, 2018 1:13 pm
Germany

Re: Installation on Debian 9.5 "Stretch"

Post by luker »

D'oh!

For days I didn't notice that "Scan Type" shows a little right-arrow that leads to a mask to input all those parameters that need to be parsed.

At this moment, I think that the firmware package is not necessary for my PCTV Sat because I could already watch TV through VLC before installing it. And it was there that I noticed (another d'oh!) that TV frequencies are in the dozen-gigahertz-range, not mega.

In other words: I have a channel scan running at the moment! Yay!

Thank you guys.
luker
Newcomer
Posts: 10
Joined: Sun May 27, 2018 1:13 pm
Germany

Re: Installation on Debian 9.5 "Stretch"

Post by luker »

Channel scan completed with a few hundred unencrypted channels to watch.

Next issue is that mythbackend doesn't start:

Code: Select all

~$ sudo service mythtv-backend status
● mythtv-backend.service - MythTV Backend
   Loaded: loaded (/lib/systemd/system/mythtv-backend.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2018-06-06 21:46:59 CEST; 1min 6s ago
     Docs: https://www.mythtv.org/wiki/Mythbackend
  Process: 1839 ExecStart=/usr/bin/mythbackend --quiet --syslog local7 $ADDITIONAL_ARGS (code=exited, status=138)
 Main PID: 1839 (code=exited, status=138)

Jun 06 21:46:58 michael systemd[1]: mythtv-backend.service: Unit entered failed state.
Jun 06 21:46:58 michael systemd[1]: mythtv-backend.service: Failed with result 'exit-code'.
Jun 06 21:46:59 michael systemd[1]: mythtv-backend.service: Service hold-off time over, scheduling restart.
Jun 06 21:46:59 michael systemd[1]: Stopped MythTV Backend.
Jun 06 21:46:59 michael systemd[1]: mythtv-backend.service: Start request repeated too quickly.
Jun 06 21:46:59 michael systemd[1]: Failed to start MythTV Backend.
Jun 06 21:46:59 michael systemd[1]: mythtv-backend.service: Unit entered failed state.
Jun 06 21:46:59 michael systemd[1]: mythtv-backend.service: Failed with result 'exit-code'.
mythbackend.log is a bit too long for a forum post. Here it is in parts:

Code: Select all

Jun  6 21:46:30 michael mythbackend: mythbackend[638]: C thread_unknown mythcommandlineparser.cpp:2619 (ConfigureLogging) mythbackend version: fixes/29 [v29.1-20-gccbded85c9-dirty] www.mythtv.org
Jun  6 21:46:30 michael mythbackend: mythbackend[638]: C thread_unknown mythcommandlineparser.cpp:2621 (ConfigureLogging) Qt version: compile: 5.7.1, runtime: 5.7.1
Jun  6 21:46:30 michael mythbackend: mythbackend[638]: N thread_unknown mythcommandlineparser.cpp:2623 (ConfigureLogging) Enabled verbose msgs:  general
Jun  6 21:46:30 michael mythbackend: mythbackend[638]: N thread_unknown logging.cpp:927 (logStart) Setting Log Level to LOG_INFO Jun  6 21:46:30 michael mythbackend: mythbackend[638]: I Logger logging.cpp:313 (run) Added logging to the console
Jun  6 21:46:30 michael mythbackend: mythbackend[638]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup Unterbrechung handler
[some more handlers]
Jun  6 21:46:45 michael mythbackend: mythbackend[1344]: I CoreContext mythtranslation.cpp:73 (load) Loading de translation for module mythfrontend
Jun  6 21:46:45 michael mythbackend: mythbackend[1344]: E CoreContext mythsocket.cpp:414 (ConnectToHost) MythSocket(5555ab987240:-1): Unable to lookup:
Jun  6 21:46:47 michael mythbackend: mythbackend[1435]: I CoreContext mythcontext.cpp:852 (TestDBconnection) Start up testing connections. DB localhost, BE , attempt 0, status dbAwake
Can someone see why mythbackend isn't running?
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Installation on Debian 9.5 "Stretch"

Post by bill6502 »

You can stop the BE and delete the log file, then restart the BE.
That should be short enough to attach here or on an open pastebin.
Post Reply