Quantcast

Building Black Gold BGT3xxx DVB-T2 Drivers for Linux

DragonQ

Novice Member
OK so I just did the following:

Code:
sudo rm -rf /lib/modules/4.15.0-34-generic/kernel/drivers/media/dvb-frontends/
sudo rm -rf /lib/modules/4.15.0-34-generic/kernel/drivers/media/dvb-core/
sudo rm -rf /lib/modules/4.15.0-34-generic/kernel/drivers/media/dvb/
cd /usr/src/BGT3xxx-fork-for-cxd2837/
sudo ./build.sh
sudo reboot now
I started tvheadend service after rebooting and I can see the tuner card. However, when I do a "force scan" on DVB-S, every single scan result is "FAIL". Then I see a bunch of warnings:

Code:
2018-10-01 12:10:02.524 [WARNING]:linuxdvb: STV090x Multistandard #1 : DVB-S #0 - poll TIMEOUT
2018-10-01 12:10:03.060 [WARNING]:linuxdvb: STV090x Multistandard #1 : DVB-S #0 - retune nodata
2018-10-01 12:10:03.635 [  DEBUG]:linuxdvb: STV090x Multistandard #1 : DVB-S #0 - status    GOOD (SIGNAL | CARRIER | VITERBI | SYNC | LOCK)
2018-10-01 12:10:10.184 [WARNING]:linuxdvb: STV090x Multistandard #1 : DVB-S #0 - poll TIMEOUT
2018-10-01 12:10:10.636 [WARNING]:linuxdvb: STV090x Multistandard #1 : DVB-S #0 - retune nodata
2018-10-01 12:10:11.211 [  DEBUG]:linuxdvb: STV090x Multistandard #1 : DVB-S #0 - status    GOOD (SIGNAL | CARRIER | VITERBI | SYNC | LOCK)
2018-10-01 12:10:17.844 [WARNING]:linuxdvb: STV090x Multistandard #1 : DVB-S #0 - poll TIMEOUT
2018-10-01 12:10:18.212 [WARNING]:linuxdvb: STV090x Multistandard #1 : DVB-S #0 - retune nodata
2018-10-01 12:10:18.787 [  DEBUG]:linuxdvb: STV090x Multistandard #1 : DVB-S #0 - status    GOOD (SIGNAL | CARRIER | VITERBI | SYNC | LOCK)
2018-10-01 12:10:25.504 [WARNING]:linuxdvb: STV090x Multistandard #1 : DVB-S #0 - poll TIMEOUT
2018-10-01 12:10:25.788 [WARNING]:linuxdvb: STV090x Multistandard #1 : DVB-S #0 - retune nodata
2018-10-01 12:10:26.363 [  DEBUG]:linuxdvb: STV090x Multistandard #1 : DVB-S #0 - status    GOOD (SIGNAL | CARRIER | VITERBI | SYNC | LOCK)
2018-10-01 12:10:33.164 [WARNING]:linuxdvb: STV090x Multistandard #1 : DVB-S #0 - poll TIMEOUT
2018-10-01 12:10:33.364 [WARNING]:linuxdvb: STV090x Multistandard #1 : DVB-S #0 - retune nodata
2018-10-01 12:10:33.940 [  DEBUG]:linuxdvb: STV090x Multistandard #1 : DVB-S #0 - status    GOOD (SIGNAL | CARRIER | VITERBI | SYNC | LOCK)
2018-10-01 12:10:40.824 [WARNING]:linuxdvb: STV090x Multistandard #1 : DVB-S #0 - poll TIMEOUT
2018-10-01 12:10:40.940 [WARNING]:linuxdvb: STV090x Multistandard #1 : DVB-S #0 - retune nodata
2018-10-01 12:10:41.515 [  DEBUG]:linuxdvb: STV090x Multistandard #1 : DVB-S #0 - status    GOOD (SIGNAL | CARRIER | VITERBI | SYNC | LOCK)
 
Last edited:

trident01

Active Member
sorry no idea why it not working for you when it works for me
i see if there something else but right now i can not think of anything
 

DragonQ

Novice Member
Right so here's my plan of attack for these two issues:

Driver on Ubuntu 18.04
- Once my old server is decommissioned (hopefully by the weekend), I will put my BGT3630 in it, install Ubuntu 18.04 LTS, followed by the BGT driver and Tvheadend. If it works then my current issue must be due to some configuration somewhere on my current system.
- If that also doesn't work, maybe it's a problem with Ubuntu 18.04 specifically (i.e. the driver might work with newer kernels but not Ubuntu 18.04 specifically).

Continuity errors
- I'll put a fresh install of Ubuntu 16.04 LTS on my old server, followed by the BGT driver and Tvheadend. If that works without the continuity errors I'm seeing on my current server then that will suggest that problem is related to either the fact that I'm currently running Tvheadend in a VM, or the specific hardware configuration of my new system.
- If I get the same issues on the old server with a bare metal install, then it's probably an issue with the driver or card. Considering others seem to be using the driver without issues, it would more likely be the card.
- If it is a card issue, I could test whether I get continuity errors with DVB-T too. I need to move the server upstairs to do this though, otherwise I'd have done it already.
 

DragonQ

Novice Member
OK well I've successfully installed the driver onto an Ubuntu 18.04 installation and recorded all afternoon on DVB-T2 and DVB-S2 with zero continuity errors. So clearly both of my issues are specific to my other machine.

I think the continuity errors are either a side effect of running in a VM, or an issue with the particular setup (e.g. chipset driver). Running on the host OS will tell me either way so I need to get the card working in that respect. I wonder if the card isn't working in the host OS because it's reserved by the guest OS even when it isn't running...I'll have a play and see what I can figure out.
 

trident01

Active Member
thanks for the update in the machine that got problem if you can try the card in a different slot
as i have been told of a problem with one asus board with that
but at least you can work on it now as you know it does work
so a clean install of the os can help
good luck
 

DragonQ

Novice Member
I cannot do a clean install of the OS because I have set up a lot of stuff by now. That's why I wanted Tvheadend in a VM originally.

Everything I can find on the Tvheadend forums just suggest "poll TIMEOUT" is due to a driver/hardware error. Obviously the driver and hardware are fine because they work on the other machine. I can try the card in a different slot but this really makes no sense - the card works fine (apart from the continuity errors) in a VM in the same slot. I originally chose this PCIe slot because it's in its own IOMMU group.

I can see in dmesg:

Code:
[   61.381143] SAA7231 0000:09:00.0: DVB: adapter 1 frontend 0 frequency 0 out of range (950000..2150000)
[   61.735396] SAA7231 0000:09:00.0: DVB: adapter 0 frontend 0 frequency 0 out of range (42000000..870000000)
Not sure where this comes from?
 
Last edited:

trident01

Active Member
slot can be wire up different on each slot and some slot share irq with other devices
this is why i say try it may or may not work but as i use to work for a motherboard manufacture in the past and slots causing problem i saw loads of time with different cards

what board is it
 

DragonQ

Novice Member
It's an Asus PRIME X370-PRO with the latest BIOS.

I've tried the card in two other slots now. Every time I move the card to a new slot, I get a bunch of PAGE_FAULT errors in dmesg relating to the card. If I then reinstall the driver and reboot, the errors go away. However, I get exactly the same behaviour no matter which slot I try: it supposedly tunes successfully (I can even see the SnR and signal strength in the Tvheadend GUI) but doesn't get any data from the card:

Code:
2018-10-08 16:01:31.167 [  DEBUG]:linuxdvb: STV090x Multistandard #1 : DVB-S #0 - status    GOOD (SIGNAL | CARRIER | VITERBI | SYNC | LOCK)
2018-10-08 16:01:37.827 [WARNING]:linuxdvb: STV090x Multistandard #1 : DVB-S #0 - poll TIMEOUT
2018-10-08 16:01:38.237 [WARNING]:linuxdvb: STV090x Multistandard #1 : DVB-S #0 - retune nodata
EDIT: I finally solved the problem: I had to disable IOMMU in the BIOS. Slightly annoying because now I know that if I run Tvheadend on the host machine I can't use IOMMU in the future but at least for now it's usable!

Now I shall see if I still get the continuity errors on the host machine...
 
Last edited:

pgslegs

Novice Member
Hi there,

Thanks for all this great work. I have had a BGT3595 for 6 or 8 years and had long given up on getting it to work in linux. Then my Gigablue Quad broke last week so decided to revisit TVheadend and Kodi.

It really was very exciting to finally be able to compile and see the card come up in TVHeadend.

I have two small issues that others may have seen before.

I am running ubuntu 18.04.1 LTS and kernel is 4.15.0-38

1. The DVB-T tuners work great but dont seem to work independently. If a mux is in use the other tuner is blocked to that mux. Is this expected?
2. I cant get the DVB-S2 tuners to lock. I keep getting the error below in TVheadend.

Nov 04 11:21:52 PWALSRV tvheadend[2314]: mpegts: 11068V in Freesat - tuning on STV090x Multistandard #0 : DVB-S #0
Nov 04 11:21:52 PWALSRV tvheadend[2314]: diseqc: failed to set voltage (e=Operation not supported)

I have the LNB set to Not Set for higher voltage. I get similar messages when higher voltage setting in TVHeadend is enabled

Any ideas would be much appreciated?

cheers
 

pgslegs

Novice Member
I am also getting this from lsdvb


lsdvb: Simple utility to list PCI/PCIe DVB devices
Version: 0.0.4
Copyright (C) Manu Abraham


SAA7231 (1131:7231 14:3585) on PCI Domain:0 Bus:9 Device:0 Function:0
DEVICE:0 ADAPTER:2 ERROR: Open frontend0 failed
 

trident01

Active Member
hi
yes dual tuner bug there is, not had time to see why

not got got any deseqc hardware so can not test, but will start to get back to doing stuff with the drivers. but testing sat was working fine for me and even dual tuner.

lsdvd not working if you got tvheadend running it got hold of the tuner.
make sure you stop tvheradend then lsdvb will work

so my plan for the driver is to make it able to use the kernel drivers. this way i dont need to worry if the kernel driver for the tuner are there I dont need to install are driver just use.
this way we keep in line with the kernel.

hope this helps a little
 

pgslegs

Novice Member
Thanks yes helps alot.

Im not using disecq either. Its fixed at Astra 28.2 thats why the message is confusing. Will play around with settings in Tvheadend

Great work again!
 

DragonQ

Novice Member
I am also getting this from lsdvb


lsdvb: Simple utility to list PCI/PCIe DVB devices
Version: 0.0.4
Copyright (C) Manu Abraham


SAA7231 (1131:7231 14:3585) on PCI Domain:0 Bus:9 Device:0 Function:0
DEVICE:0 ADAPTER:2 ERROR: Open frontend0 failed
I get the same output when running lsdvb. Both tuners seem to work fine within Tvheadend though.

Annoyingly, I cannot get rid of the "poll TIMEOUT" error I described above. When I had IOMMU enabled, it would appear all the time. With IOMMU disabled, the card works but only for a certain period of time. Eventually, normally after a day or two, the card starts exhibiting this error again. The only fix I've found is to reboot the machine. I haven't yet found a cause for it - I've tried disabling automatic updates, and I've turned off my power saving tweaks too. I'm not even sure what to look for in log files for a clue to be honest.
 

DragonQ

Novice Member
thanks for the update
i see if i can work out why this happen for you
It broke twice today. Both times I rebooted the server, then tested tuning worked, then I noticed the error in the logs whilst it was trying to do an EPG grab some time later (a couple of hours).
 

pgslegs

Novice Member
I get the same output when running lsdvb. Both tuners seem to work fine within Tvheadend though.

Annoyingly, I cannot get rid of the "poll TIMEOUT" error I described above. When I had IOMMU enabled, it would appear all the time. With IOMMU disabled, the card works but only for a certain period of time. Eventually, normally after a day or two, the card starts exhibiting this error again. The only fix I've found is to reboot the machine. I haven't yet found a cause for it - I've tried disabling automatic updates, and I've turned off my power saving tweaks too. I'm not even sure what to look for in log files for a clue to be honest.
I get the same poll timeout errors now on DVBT. Stopped working after a few days. Restarting tvheadend doesn’t make a difference
 

trident01

Active Member
not seen that on dvbt
which card was that did you have both tuner on
and which board cpu

sorry if am a pain but as i did not write the main drive i have to start look and see what is wrng so the more information i get the better
plus say what tuner driver it using as well like cx2820r or cxd2837

what linux version/kernel
thanks
Carl
 

pgslegs

Novice Member
My card is BG3595

Core i5 CPU
Ubuntu 18.04.01 LTS
Kernel 4.15.0-38 x64

How do I check which driver above in use I only see saa7231_core for dvb_core
 

trident01

Active Member
lsdvb show all the tuner you have
just make sure you not using TVheadend is on as it lock the tuner and lsdvb does not work
thanks
 

DragonQ

Novice Member
not seen that on dvbt
which card was that did you have both tuner on
and which board cpu

sorry if am a pain but as i did not write the main drive i have to start look and see what is wrng so the more information i get the better
plus say what tuner driver it using as well like cx2820r or cxd2837

what linux version/kernel
thanks
Carl
I get it on DVB-S2.

Motherboard: Asus PRIME X370-PRO
CPU: AMD Ryzen 1700
OS: Ubuntu 18.04 LTS
Kernel: 4.15.0.38-generic
Tuner: BGT3600
Driver: BGT3xxx-fork-for-cxd2837 (branch: master, SHA: 6eb85f61)

Output of lsdvb:

Code:
lsdvb: Simple utility to list PCI/PCIe DVB devices
                Version: 0.0.4
                Copyright (C) Manu Abraham

SAA7231 (1131:7231 14:3600) on PCI Domain:0 Bus:0 Device:0 Function:0
        DEVICE:0 ADAPTER:2 FRONTEND:0 (Sony CXD2820R)
                 FE_OFDM Fmin=42MHz Fmax=870MHz
        DEVICE:0 ADAPTER:0 ERROR: Open frontend0 failed
The other adapter might be the DVB-C2 or DVB-T2 tuner on the card, which is disabled in Tvheadend.

Output of lsmod | grep saa:
Code:
saa7231_drv            24576  0
saa7231_core           65536  3 saa7231_drv
dvb_core              122880  2 cxd2820r,saa7231_core
 

pgslegs

Novice Member
My card is BG3595

Core i5 CPU
Ubuntu 18.04.01 LTS
Kernel 4.15.0-38 x64

How do I check which driver above in use I only see saa7231_core for dvb_core
Lsdvb output

SAA7231 (1131:7231 14:3585) on PCI Domain:0 Bus:9 Device:0 Function:0

DEVICE:0 ADAPTER:2 FRONTEND:0 (NXP TDA10048HN DVB-T) FE_OFDM Fmin=177MHz Fmax=858MHz
DEVICE:0 ADAPTER:0 FRONTEND:0 (STV090x Multistandard) FE_QPSK Fmin=950MHz Fmax=2150MHz
DEVICE:0 ADAPTER:3 FRONTEND:0 (NXP TDA10048HN DVB-T) FE_OFDM Fmin=177MHz Fmax=858MHz
DEVICE:0 ADAPTER:1 FRONTEND:0 (STV090x Multistandard) FE_QPSK Fmin=95
 

trident01

Active Member
so it the satellite part
that the oldest driver which has never been touch by me as it alwayed worked
not fun

when i bit better i will work on doing the driver from the ground up and get the kernel driver to work with are driver
 

DragonQ

Novice Member
My system is currently in an errored state. The outputs of lsdvb and lsmod are identical. I can see nothing of interest in dmesg - should there be dmesg logs for this driver? Is there anywhere else I can check for debug info?

The information in this bug might be relevant? They link to a kernel issue that has the same symptoms, albeit for a USB tuner. It definitely has the hallmarks of some mutex locking issue.

For now, I've discovered that I can get the tuner working again by resetting the card, which is certainly faster and less annoying than rebooting the system. First, find the device ID of the card:

Code:
lspci | grep SAA
Then issue the following command as root:

Code:
echo "1" > /sys/bus/pci/devices/<device ID>/reset
I'm gonna try to put this in a cron script to do it automatically when a "poll TIMEOUT" is seen in the Tvheadend logs. It's a useful workaround but not ideal because obviously if it happens mid-recording you're gonna lose part of the recording, and if it happens mid-viewing who knows how clients will react.

EDIT: Although this does fix the card, it seems to break again VERY quickly when it tries to do an EPG scan (currently set to every 5 minutes), so I'm not sure this is viable. Maybe there is a chance of the driver locking up every time a tune is performed and therefore having it scan every 5 minutes makes it happen very quickly? I reset the card at 14:32, then it performed EPG scans at 14:35, 14:40, and 14:45, then I got the "poll TIMEOUT" error at 14:48. My EPG scans have a timeout of 3 minutes so it looks like the error first appeared exactly when the EPG scan timed out:

Code:
2018-11-10 14:45:00.985 [  DEBUG]:mpegts: 11425H in Freesat HD - add raw service
2018-11-10 14:45:00.985 [  DEBUG]:service: 8: 11425H in Freesat HD si 0x7fa63401ec90 BGT3600: DVB-S #0 weight 0 prio 10 error 0 (OK)
2018-11-10 14:45:00.985 [  DEBUG]:service: 7: 11425H in Freesat HD si 0x7fa63400bf70 BGT3600: DVB-S #1 weight 0 prio 10 error 0 (OK)
2018-11-10 14:45:00.985 [   INFO]:mpegts: 11425H in Freesat HD - tuning on BGT3600: DVB-S #1
2018-11-10 14:45:00.987 [  DEBUG]:linuxdvb: BGT3600: DVB-S #1 - starting 11425H in Freesat HD
2018-11-10 14:45:01.303 [  DEBUG]:mpegts: 11425H in Freesat HD - started
2018-11-10 14:45:01.303 [  DEBUG]:tbl-eit: uk_freesat: grab started
2018-11-10 14:45:01.303 [  DEBUG]:mpegts: 11425H in Freesat HD - open PID tables subscription [0042/0x7fa6340092c0]
2018-11-10 14:45:01.303 [   INFO]:subscription: 005C: "epggrab" subscribing to mux "11425H", weight: 4, adapter: "BGT3600: DVB-S #1", network: "Freesa
t HD", service: "Raw PID Subscription"
2018-11-10 14:45:01.303 [  DEBUG]:epggrab: no OTA modules active for 10936.5V in Freesat HD, check again next time
2018-11-10 14:45:01.623 [  DEBUG]:linuxdvb: BGT3600: DVB-S #1 - status    GOOD (SIGNAL | CARRIER | VITERBI | SYNC | LOCK)
2018-11-10 14:45:01.623 [  DEBUG]:linuxdvb: BGT3600: DVB-S #1 - locked
...
2018-11-10 14:48:08.956 [WARNING]:linuxdvb: BGT3600: DVB-S #1 - poll TIMEOUT
2018-11-10 14:48:09.359 [WARNING]:linuxdvb: BGT3600: DVB-S #1 - retune nodata
2018-11-10 14:48:09.965 [  DEBUG]:linuxdvb: BGT3600: DVB-S #1 - status    GOOD (SIGNAL | CARRIER | VITERBI | SYNC | LOCK)
2018-11-10 14:48:11.286 [  DEBUG]:epggrab: grab done for 11425H in Freesat HD (timeout)
2018-11-10 14:48:11.286 [WARNING]:epggrab: UK: Freesat - data completion timeout for 11425H in Freesat HD
2018-11-10 14:48:11.286 [   INFO]:subscription: 005C: "epggrab" unsubscribing
2018-11-10 14:48:11.286 [  DEBUG]:mpegts: 11425H in Freesat HD - close PID tables subscription [0042/0x7fa6340092c0]
2018-11-10 14:48:11.286 [  DEBUG]:mpegts: 11425H in Freesat HD - stopping mux
2018-11-10 14:48:11.286 [  DEBUG]:linuxdvb: BGT3600: DVB-S #1 - stopping 11425H in Freesat HD
2018-11-10 14:48:11.287 [  DEBUG]:linuxdvb: BGT3600: DVB-S #1 - stopped dvr thread
 
Last edited:

DragonQ

Novice Member
I enabled verbose mode for the driver and got a tonne of syslog entries. My monitoring script detected that the card died between 2018-11-18 18:37:01 and 2018-11-18 18:38:01, so I've trimmed down the log to a couple of minutes around that time. It means nothing to me but maybe it will mean something to trident01?
 

Attachments

DragonQ

Novice Member
An update on this card lock-up issue: it seems to go away if I only enable one of my two DVB-S2 tuners. Obviously only having one tuner isn't ideal but at least it seems stable for now. I've recorded about 6-7 hours of TV so far without it locking up, whereas before I'd be lucky to get 20-30 minutes without it locking up.

Has anyone else used these drivers with a card that has more than one tuner of a certain type on it? I imagine something like a BGT3630 wouldn't have this issue, maybe that's why I seem to be the first person to encounter it. Hopefully this helps narrow down the underlying cause as well.
 

trident01

Active Member
ok thanks for the update that the dual tuner bug
it only seem to happen manly with dual dvb-t2 not dvb-s2 but it now show it the driver at fault
it one of the bug a few people are looking at but noone know were
and as the person who made the driver is gone it a hard job
 

Similar threads

Trending threads

Latest News

Xbox Series X console rises from Microsoft's Project Scarlett
  • By Andy Bassett
  • Published
BT Sports introduces all-access monthly pass for £25
  • By Andy Bassett
  • Published
Dolby Atmos Music comes to Tidal streaming service
  • By Andy Bassett
  • Published
Samsung TVs unexpectedly losing access to BBC iPlayer
  • By Andy Bassett
  • Published
Bowers & Wilkins to release updated Formation Home app in 2020
  • By Andy Bassett
  • Published
Top Bottom