Autor Thema: how to restart driver  (Gelesen 1021 mal)

tomasl

  • Newbie
  • *
  • Beiträge: 24
    • Profil anzeigen
how to restart driver
« am: Oktober 25, 2024, 05:36:19 Nachmittag »
Hi, I have both skytv 6 dongle and dual tuner and use them with TVHeadend inside docker container.
I don't know why, the tuners disappear from TVHeadend Configuration/DVB Inputs/Adapters tab.
recently I found out that it might help just to restart the container. before I was recreating the whole container including recreating the nodes. now the question is. if it's possible just to restart the driver instead of the whole docker container so I can set it up in the container's crontab to test.

tomasl

  • Newbie
  • *
  • Beiträge: 24
    • Profil anzeigen
Re: how to restart driver
« Antwort #1 am: Oktober 25, 2024, 06:38:05 Nachmittag »
nevermind, I think I found it.

*/1 * * * * /usr/bin/timeout 1m bash -c "dmesg -w | tail -f | grep -qsm 1 'Sundtek' && docker exec tvh /opt/bin/mediaclient --shutdown && sleep 10 && docker exec tvh /opt/bin/mediaclient --start"

I'll try to restart it using crontab this way.
« Letzte Änderung: Oktober 25, 2024, 08:55:49 Nachmittag von tomasl »

Sundtek

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 8604
    • Profil anzeigen
Re: how to restart driver
« Antwort #2 am: Oktober 26, 2024, 07:20:39 Vormittag »
They should not disappear, there might be another issue there. Check your system logs and enable the driver logs.

sundtek.conf (you need to check where this is in your container maybe in /config/etc/sundtek.conf you have to create this file because it's optional, the driver loads the most common default values if it's not there)
add:
loglevel=max

/var/log/syslog
Failure is a good thing! I'll fix it

tomasl

  • Newbie
  • *
  • Beiträge: 24
    • Profil anzeigen
Re: how to restart driver
« Antwort #3 am: Oktober 26, 2024, 04:33:15 Nachmittag »
I suspect part of the problem are power outages. it happens at my place, there are split of the second outages. but I'll enable debug logging as you suggested. I think already second time, but I'm idiot, so I have to open 3 different threads for one issue.  ;D

tomasl

  • Newbie
  • *
  • Beiträge: 24
    • Profil anzeigen
Re: how to restart driver
« Antwort #4 am: November 02, 2024, 06:34:31 Nachmittag »
ok, it happened twice in past few days. this is output from dmesg

[829781.271485] usb 1-2.4: usbfs: usb_submit_urb returned -19
[829781.271488] usb 1-2.4: USB disconnect, device number 9
[829781.549966] usb 1-2.4: new high-speed USB device number 10 using xhci-hcd
[829781.675198] usb 1-2.4: New USB device found, idVendor=2659, idProduct=1802
[829781.675204] usb 1-2.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[829781.675207] usb 1-2.4: Product: Dual S2
[829781.675209] usb 1-2.4: Manufacturer: Sundtek
[829781.675212] usb 1-2.4: SerialNumber: U220618172741
[829781.683682] usb 1-2.4: Unsupported device
[830891.207803] usb 1-2.4: USB disconnect, device number 10
[830891.482322] usb 1-2.4: new high-speed USB device number 11 using xhci-hcd
[830891.607588] usb 1-2.4: New USB device found, idVendor=2659, idProduct=1802
[830891.607595] usb 1-2.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[830891.607597] usb 1-2.4: Product: Dual S2
[830891.607600] usb 1-2.4: Manufacturer: Sundtek
[830891.607603] usb 1-2.4: SerialNumber: U220618172741
[830891.618709] usb 1-2.4: Unsupported device

I only enabled the debug logging of the sundtek driver after first time it happened, so the driver debug log should have at least one set of events recorded, if I'm lucky. where should I look for the driver debug log file?

Sundtek

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 8604
    • Profil anzeigen
Re: how to restart driver
« Antwort #5 am: November 05, 2024, 01:18:19 Vormittag »
/etc/sundtek.conf
loglevel=max

that will show what the driver is doing.

The log is stored in /var/log/mediasrv.log

also try ir_disabled=1 in /etc/sundtek.conf it's using interrupt transfers, which is a little bit different from the rest.
« Letzte Änderung: November 05, 2024, 04:18:54 Nachmittag von Sundtek »
Failure is a good thing! I'll fix it

tomasl

  • Newbie
  • *
  • Beiträge: 24
    • Profil anzeigen
Re: how to restart driver
« Antwort #6 am: November 07, 2024, 01:00:56 Nachmittag »
so apparently I edited wrong sundtek.conf before. so I had to fix that and edited one /etc. and I restarted the container. now the tuner disappeared again from TV Headend and the /var/log/mediasrv.log is empty.
I verified the debuglevel line is still there in /etc/sundtek.conf and restarted the container again. and I'll wait again till the tuner disappears. after it's empty again, I don't know what I'm doing wrong.


tomasl

  • Newbie
  • *
  • Beiträge: 24
    • Profil anzeigen
Re: how to restart driver
« Antwort #7 am: November 11, 2024, 01:54:12 Nachmittag »
so, the /etc/sundtek.conf contains only line, which is loglevel=max
I restarted the container, I hope that this forces the sundtek driver to read the conf file and log the debug level of events in the mediasrv.log.

you said the mediasrv.log should be under /var/log/syslog, but it's in /var/log and it contains only this, events from 4 days ago.

2024-11-07 11:59:00 [195] Starting up Multimedia Framework (Aug 22 2024 14:52:09)
2024-11-07 11:59:00 [195] Detected DVB version.h
2024-11-07 11:59:00 [196] Starting service processor (PID 196)
2024-11-07 11:59:00 [195] API Version: 5.11
2024-11-07 11:59:00 [195] Running on Linux (4.9.277-82)
2024-11-07 11:59:00 [195] scanning devices
2024-11-07 11:59:00 [195] scanning for drivers
2024-11-07 11:59:00 [195] scanning for plugins
2024-11-07 11:59:00 [195] Starting up device manager
2024-11-07 11:59:00 [195] Setting permission of /dev/dvb to 777
2024-11-07 11:59:00 [195] This is to avoid problems if TV Applications are started as another user
2024-11-07 11:59:00 [195] as seen on eg. Synology NAS Systems where tvheadend is unable to read
2024-11-07 11:59:00 [195] /dev/dvb and because of that would not detect the TV tuner
2024-11-07 11:59:00 [195] scanning devices done
2024-11-07 11:59:00 [195] attached devices:
2024-11-07 11:59:00 [195] registering ID: 0
2024-11-07 11:59:00 [195] Memory mapped transfers are not available
2024-11-07 11:59:00 [195] Using dynamic configuration
2024-11-07 11:59:00 [195] DTV1 Transfer is set to: Bulk
2024-11-07 11:59:01 [196] Autostarting scripts in /etc/sundtek/
2024-11-07 11:59:02 [196] executed all available items
2024-11-07 11:59:02 [196] trying to load uinput module
2024-11-07 11:59:02 [196] loading uinput kernel extention failed, remote control will not work with lirc
2024-11-07 11:59:02 [195] No remote control support available
2024-11-07 11:59:02 [195] Initializing SYSV-IPC
2024-11-07 11:59:02 [195] Allocation using pg for type 65678
2024-11-07 11:59:02 [195] Allocated Shared memory buffer: 0x7f8f813000
2024-11-07 11:59:02 [195]
2024-11-07 11:59:02 [195] This device is using the new voltage control mechanism
2024-11-07 11:59:02 [195] Hardcoded limit 500mA
2024-11-07 11:59:02 [195] Vertical Polarisation is set to 13.00 Volt
2024-11-07 11:59:02 [195] Horizontal Polarisation is set to 19.80 Volt
2024-11-07 11:59:02 [195] Current limit is set to 1000 mA
2024-11-07 11:59:02 [195]
2024-11-07 11:59:02 [195] demodulator successfully attached (DVB_S/S2)!
2024-11-07 11:59:02 [195] Allocated Shared memory buffer: 0x7f8f7ad000
2024-11-07 11:59:02 [195] Allocated Shared memory buffer: 0x7f8f154000
2024-11-07 11:59:02 [195] Allocation using pg for type 16
2024-11-07 11:59:02 [195] Allocated Shared memory buffer: 0x7f8f06e000
2024-11-07 11:59:02 [195] Setting up default decoder settings
2024-11-07 11:59:02 [195] attaching video decoder
2024-11-07 11:59:03 [195] Configure urbs for bulk
2024-11-07 11:59:03 [195] Registering OSS emulation
2024-11-07 11:59:03 [195] registering: adapter0/0
2024-11-07 11:59:03 [195] registered virtual: /dev/dvb/adapter0/frontend0
2024-11-07 11:59:03 [195] registered virtual: /dev/dvb/adapter0/demux0
2024-11-07 11:59:03 [195] registered virtual: /dev/dvb/adapter0/dvr0
2024-11-07 11:59:03 [195] registered virtual: /dev/dsp0
2024-11-07 11:59:03 [195] registered virtual: /dev/video0
2024-11-07 11:59:03 [195] registered virtual: /dev/vbi0
2024-11-07 11:59:03 [195] Initializing Remote Control Support



on the other hand, this is what dmesg on the host (not inside container) says, and it's much more verbose this time.

[1553838.984414] docker0: port 5(veth530535f) entered disabled state
[1573794.834967] meson6-dwmac ff3f0000.ethernet eth0: Link is Down
[1573797.906832] meson6-dwmac ff3f0000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[1590976.267703] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 2 ret -71
[1590976.267976] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.268160] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.268291] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 2 ret -71
[1590976.268776] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.268940] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.269019] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.269161] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.269290] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.269421] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.269495] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.270440] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.270553] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.270776] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.270919] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.271360] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.271493] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.271776] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.271891] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.272077] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.272153] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.272310] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.272395] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.272572] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.279730] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.279976] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.280108] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.280293] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.280374] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.280568] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.280672] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.280862] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.280946] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.281158] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.328307] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.328625] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.328763] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.328930] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.329014] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.329152] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.329279] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.329414] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.329488] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.330186] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.379983] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.380267] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.380396] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.380563] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.380698] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.380833] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.380960] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.381095] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.381172] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 64 rq 187 len 1 ret -71
[1590976.381350] usb 1-2.4: usbfs: USBDEVFS_CONTROL failed cmd mediasrv rqt 192 rq 187 len 1 ret -71
[1590976.391340] usb 1-2.4: USB disconnect, device number 12
[1590976.669541] usb 1-2.4: new high-speed USB device number 13 using xhci-hcd
[1590982.005279] usb 1-2.4: device descriptor read/64, error -71
[1590983.997597] usb 1-2-port4: Cannot enable. Maybe the USB cable is bad?
[1590984.101107] usb 1-2.4: new high-speed USB device number 14 using xhci-hcd
[1590984.901077] usb 1-2.4: device descriptor read/64, error -71
[1590985.865019] usb 1-2.4: device descriptor read/64, error -71
[1590985.973621] usb 1-2-port4: attempt power cycle
[1590987.261280] usb 1-2-port4: Cannot enable. Maybe the USB cable is bad?
[1590987.828853] usb 1-2.4: new high-speed USB device number 16 using xhci-hcd
[1590987.828903] usb 1-2.4: Device not responding to setup address.
[1590988.036993] usb 1-2.4: Device not responding to setup address.
[1590988.244808] usb 1-2.4: device not accepting address 16, error -71
[1590988.245781] usb 1-2.4: the parent's name is 1-2
[1590988.245851] usb 1-2-port4: Device no response
[1590988.251507] usb 1-2-port4: unable to enumerate USB device
[1590989.373206] usb 1-2-port4: Cannot enable. Maybe the USB cable is bad?
[1590989.476752] usb 1-2.4: new high-speed USB device number 18 using xhci-hcd
[1590991.708653] usb 1-2.4: device descriptor read/64, error -71
[1590994.544441] usb 1-2.4: device descriptor read/64, error -71
[1590994.652669] usb 1-2-port4: attempt power cycle
[1590995.304421] usb 1-2.4: new high-speed USB device number 19 using xhci-hcd
[1590999.458932] usb 1-2.4: device descriptor read/8, error -71
[1590999.585354] usb 1-2.4: device descriptor read/8, error -71
[1591000.028140] usb 1-2.4: new high-speed USB device number 20 using xhci-hcd
[1591005.163850] usb 1-2.4: device descriptor read/8, error -110
[1591005.345653] usb 1-2.4: device descriptor read/8, error -71
[1591005.451983] usb 1-2.4: the parent's name is 1-2
[1591005.452052] usb 1-2-port4: Device no response
[1591005.452103] usb 1-2-port4: unable to enumerate USB device
[1591005.703772] usb 1-2.4: new high-speed USB device number 21 using xhci-hcd
[1591010.899452] usb 1-2.4: device descriptor read/64, error -110
[1591010.899818] usb 1-2.4: Device no response
[1591017.967046] usb 1-2.4: device descriptor read/64, error -71
[1591018.178972] usb 1-2.4: new high-speed USB device number 22 using xhci-hcd
[1591023.442692] usb 1-2.4: device descriptor read/64, error -110
[1591023.443074] usb 1-2.4: Device no response
[1591039.057717] usb 1-2.4: device descriptor read/64, error -110
[1591039.058100] usb 1-2.4: Device no response
[1591039.169904] usb 1-2-port4: attempt power cycle
[1591039.821672] usb 1-2.4: new high-speed USB device number 23 using xhci-hcd
[1591045.097354] usb 1-2.4: device descriptor read/8, error -110
[1591050.473056] usb 1-2.4: device descriptor read/8, error -110
[1591050.684975] usb 1-2.4: new high-speed USB device number 24 using xhci-hcd
[1591055.848729] usb 1-2.4: device descriptor read/8, error -110
[1591061.224396] usb 1-2.4: device descriptor read/8, error -110
[1591061.332886] usb 1-2.4: the parent's name is 1-2
[1591061.332959] usb 1-2-port4: Device no response
[1591061.333009] usb 1-2-port4: unable to enumerate USB device

I have 2 tuners (skytv and dual, I was waiting for quad tuner which never was released), connected via USB hub, I'll remove the older skytv dongle and USB hub and will connect it directly to my home linux NAS which has sadly only one USB port (...) and will observe if that's not the USB hub causing this.



Sundtek

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 8604
    • Profil anzeigen
Re: how to restart driver
« Antwort #8 am: November 15, 2024, 04:57:20 Vormittag »
Are those tuners connected to an external USB Hub?
Failure is a good thing! I'll fix it

Sundtek

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 8604
    • Profil anzeigen
Re: how to restart driver
« Antwort #9 am: November 15, 2024, 05:01:09 Vormittag »
Try this one please (as root):

echo -1 >/sys/module/usbcore/parameters/autosuspend

But USB Hubs should be eliminated between the Tuner and the System!
« Letzte Änderung: November 15, 2024, 08:36:58 Vormittag von Sundtek »
Failure is a good thing! I'll fix it