Building Black Gold BGT3xxx DVB-T2 Drivers for Linux

DragonQ

Member
The code from your gitlab repo was working for 4.15. I have now tested my branch for 5.4 and it seems to work fine. I am not sure about any kernels in between unfortunately, you'd have to look at when certain functions the drivers use were deprecated in the Linux kernel.

4.15 and 5.4 are the kernels used in the latest two LTS version of Ubuntu Server, which are probably the most commonly used by home users. Maybe testing with LTS versions of Debian would help fill the gaps between 4.15 and 5.4? I do know that the 5.4 branch does still work on 4.15, so as far as I'm concerned the branch can be merged to master.
 
Last edited:

trident01

Member
i will sort out how to make it work with both version of kernal using you code
will do over the weekend

will get my linux machine back up working at the moment it down as it was a media center machine and the case had a control panel that just failed so it all apart right now so i can repair teh controll panel (replace the usb chip onthe pcb )
 

DragonQ

Member
As I said, it does work with both version 4.15 and 5.4. All that changed is deprecated functions were removed from the kernel sometime between those two versions, but the new functions already existed in 4.15. There may well be changes required if you want compatibility with older versions though.
 

trident01

Member
if you check you see i have to support different kernel
am not going to drop the different kernel as there people out there will not use the latest kernel.
so i make sure it can support latest stuff like what you done and older stuff

it this problem you see so much of this type of code
#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,13,0)
and >= KERNEL_VERSION

these are the time big changes in the kernel happen
anyway thanks for what you done i will add as i said
 

tumbleclatter

Novice Member
Thanks for pointing me to that commit. I can confirm that the drivers work in Ubuntu 20.04 with the 5.4 kernel.

Thank you so much!

I have now been able to eliminate the last unsupported Windows 7 PC from my house. Now I just need to get used to writing SQL for custom recordings with mythtv instead of just using the web interface in Argus TV. Who knows if it annoys me enough maybe I can duplicate the Argus TV edit schedule interface in the mythtv web frontend.
 

tumbleclatter

Novice Member
I have noticed a minor issue and I've not read all 13 pages so it might have been noticed before but the driver does not work after a suspend and resume cycle
I have been able to build a workaround to fix this

Code:
[email protected]:~# cat /lib/systemd/system-sleep/fix-blackgold
#!/bin/bash

PROGNAME=$(basename "$0")
state=$1
action=$2

function log {
    logger -i -t "$PROGNAME" "$*"
}

log "Running $action $state"

if [[ $state == post ]]; then
  rmmod saa7231_drv || true
  rmmod saa7231_core || true
  rmmod cxd2843 || true
  rmmod tda18272 || true
  rmmod stv6110x || true
  modprobe tda18272
  modprobe cxd2843
  modprobe saa7231_core
  modprobe saa7231_drv
fi
and then make that executable with
chmod +x /lib/systemd/system-sleep/fix-blackgold

without this script running after a resume I get the following in dmesg:

Code:
Mon May 11 22:15:02 2020] i2c i2c-2: cxd2820r: i2c rd failed=-5 reg=26 len=2
[Mon May 11 22:15:03 2020] i2c i2c-2: cxd2820r: i2c rd failed=-5 reg=28 len=2
[Mon May 11 22:15:05 2020] i2c i2c-2: cxd2820r: i2c rd failed=-5 reg=26 len=2
[Mon May 11 22:15:06 2020] i2c i2c-2: cxd2820r: i2c rd failed=-5 reg=28 len=2
[Mon May 11 22:15:08 2020] i2c i2c-2: cxd2820r: i2c rd failed=-5 reg=26 len=2
[Mon May 11 22:15:09 2020] i2c i2c-2: cxd2820r: i2c rd failed=-5 reg=28 len=2
[Mon May 11 22:15:11 2020] i2c i2c-2: cxd2820r: i2c rd failed=-5 reg=26 len=2
[Mon May 11 22:15:12 2020] i2c i2c-2: cxd2820r: i2c rd failed=-5 reg=28 len=2
[Mon May 11 22:15:13 2020] i2c i2c-2: cxd2820r: i2c rd failed=-5 reg=26 len=2
[Mon May 11 22:15:15 2020] i2c i2c-2: cxd2820r: i2c rd failed=-5 reg=28 len=2
[Mon May 11 22:15:16 2020] i2c i2c-2: cxd2820r: i2c rd failed=-5 reg=26 len=2
[Mon May 11 22:15:18 2020] i2c i2c-2: cxd2820r: i2c rd failed=-5 reg=28 len=2
[Mon May 11 22:15:19 2020] i2c i2c-2: cxd2820r: i2c rd failed=-5 reg=26 len=2
[Mon May 11 22:15:20 2020] i2c i2c-2: cxd2820r: i2c rd failed=-5 reg=28 len=2
[Mon May 11 22:15:22 2020] i2c i2c-2: cxd2820r: i2c rd failed=-5 reg=26 len=2
[Mon May 11 22:15:23 2020] i2c i2c-2: cxd2820r: i2c wr failed=-5 reg=ff len=1
It's probably mssive overkill to unload and reload the lot but it works
 

DragonQ

Member
There several issues with the driver, which was abandoned by BlackGold after a single release. Sleep/resume is one of them, but fortunately my home server doesn't sleep so I'm unaffected. Another is you cannot use 2+ DVB-S tuners on a single card at the same time or the driver/card will crash. Maybe one day I'll look into that bug...
 

trident01

Member
not had time to look at the bug yet
i hope to start again on the drivers
did not know about sleep/resume so will have a look at how to fix that

if someone can add the bug report to my git server then i try to get them fixed
if anyone want git access to my stuff just ask and i give you access so all code can be in one place
 

The latest video from AVForums

Podcast: New TVs, Samsung Q800T Soundbar review, IFA latest, Movie and AV News, B+W Brad Pitt
Top Bottom