Bug #5128

When tuner is configured as a slave device, after reboot settings are lost

Added by Trex the Daemon 2 months ago. Updated about 1 month ago.

Status:NewStart date:2018-06-10
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Configuration
Target version:-
Found in version:4.3 Affected Versions:

Description

I have 3 tv tuners:
- Dvbsky S960 DVB-S2,
- Sundtek Skytv ultimate v6 DVB-S2
- Dvbsky T330 DVB-C+DVB-T

I have usals and multiple sattelites configured.
Now the DVBSKY and Sundtek are connected through a splitter to the same LNB, therefore I wanted to set the DVBSKY as a slave.
After configuring everything, after reboot the settings are lost and the slave tuner reverts back to "Universal only" and no network configured.
I've attached the whole configuration, only the passwords are deleted for security reasons.

backup_hts_10-06-2018.zip (8.21 MB) Trex the Daemon, 2018-06-10 14:47

History

#1 Updated by Jaroslav Kysela 2 months ago

You may try to swap master/slave devices. Appearently, if the order is wrong (slave is first at the load time), the config is not restored properly, because master does not exist.

#2 Updated by Trex the Daemon 2 months ago

Jaroslav Kysela wrote:

You may try to swap master/slave devices. Appearently, if the order is wrong (slave is first at the load time), the config is not restored properly, because master does not exist.

Thanks. I will have to create some udev rules to specify the adapter names statically, so that the master device will always get the /dev/adapter0 entry.

#3 Updated by Trex the Daemon 2 months ago

Trex the Daemon wrote:

Jaroslav Kysela wrote:

You may try to swap master/slave devices. Appearently, if the order is wrong (slave is first at the load time), the config is not restored properly, because master does not exist.

Thanks. I will have to create some udev rules to specify the adapter names statically, so that the master device will always get the /dev/adapter0 entry.

Well, I've just checked the startup log and what we've assumed here seems to not be the reason:

Jun 12 15:22:45 raspberrypi tvheadend[21472]: linuxdvb: adapter added /dev/dvb/adapter2
Jun 12 15:22:45 raspberrypi tvheadend[21472]: linuxdvb: adapter added /dev/dvb/adapter1
Jun 12 15:22:45 raspberrypi tvheadend[21472]: linuxdvb: adapter added /dev/dvb/adapter0

So adapter 2 is the master adapter, and adapter 1 is the slave. If we take the order of the addition of the adapters, the master does exist before the slave is added.

Could you tell me where is this part of the code implemented ? Maybe I can have a look to see if I can find something there..

#4 Updated by Jaroslav Kysela 2 months ago

It seems that the order should not matter. The master tuner should be identified just using the uuid string. Check linuxdvb_frontend_create() linuxdvb_frontend_save() in src/input/mpegts/linuxdvb/linuxdvb_frontend.c . Look for 'master for #' strings.

#5 Updated by Trex the Daemon 2 months ago

Jaroslav Kysela wrote:

It seems that the order should not matter. The master tuner should be identified just using the uuid string. Check linuxdvb_frontend_create() linuxdvb_frontend_save() in src/input/mpegts/linuxdvb/linuxdvb_frontend.c . Look for 'master for #' strings.

I've just checked in the config file the UUID and they are correct.
I'll have a look in the code...

#6 Updated by Jaroslav Kysela 2 months ago

There must be something wrong - linuxdvb_frontend_dvbs_slave_class is not probably used for the slave.

#7 Updated by Trex the Daemon about 1 month ago

Jaroslav Kysela wrote:

There must be something wrong - linuxdvb_frontend_dvbs_slave_class is not probably used for the slave.

I've checked the code but I'm not quite getting what here is meant:
/* Tuner slave */
snprintf(buf, sizeof(buf), "master for #%d", number);
if (conf && type == DVB_TYPE_S) {
muuid = htsmsg_get_str(conf, buf);
if (muuid && uuid && !strcmp(muuid, uuid))
muuid = NULL;
}

It gets the uuid of the master I suppose, and then checks to make sure that the master and the slave uuids are different ? What's the reason for that?

Later on, depending if we have a master uuid, it will use the correct pointer:
if (type == DVB_TYPE_S)
idc = muuid ? &linuxdvb_frontend_dvbs_slave_class : &linuxdvb_frontend_dvbs_class;

so this should be fine..

Also available in: Atom PDF