ljalves / linux_media

TBS linux open source drivers
https://github.com/ljalves/linux_media/wiki
Other
89 stars 150 forks source link

TBS6991 support #180

Open woooow1 opened 1 month ago

woooow1 commented 1 month ago

Hello Luis, Need some support for this card! I am trying to run it in opensource driver, but with no luck so far! In code I see that :

tbs6991 seems to have different settings depending on a value that the closed source driver reads from the eeprom. This is probabbly related to card HW revisons.

When I change default TBS6991_TSMODE0 to 1, card was able to tune in tvheadend, but with lot of errors. When I change to 0- unable to tune! Transport error indicator (total 1) I also try do decompile closed source driver to find any useful info.This is related to tsmode:

tbs6991fe_wr(state_00,0xd,uVar2 | 0xc0); if (state_00->demod == 0) { tbs6991fe_wr(state_00,0xe6,0x10); tbs6991fe_wr(state_00,0xe7,0x32); tbs6991fe_wr(state_00,0xe8,0x54); tbs6991fe_wr(state_00,0xe9,0x76); tbs6991fe_wr(state_00,0xea,0xa8); tbs6991fe_wr(state_00,0xeb,0x9b); iVar1 = state_00->tsmode; } else { tbs6991fe_wr(state_00,0xe6,0x30); tbs6991fe_wr(state_00,0xe7,0x21); tbs6991fe_wr(state_00,0xe8,0x54); tbs6991fe_wr(state_00,0xe9,0x76); tbs6991fe_wr(state_00,0xea,0xb8); tbs6991fe_wr(state_00,0xeb,0x9a); iVar1 = state_00->tsmode; } if (iVar1 == 1) { tbs6991fe_wr(state_00,0xe0,0x31); } else { tbs6991fe_wr(state_00,0xe0,0x33); } Any help is welcome!

crazycat69 commented 1 month ago

This demod TS bus config (TAS2101 pins for TS bus). Need configure CI support chip for different TBS cards - use TBS fork which contain CI support for SAA716x based cards https://github.com/tbsdtv/linux_media/blob/latest/drivers/media/pci/saa716x/tbs-ci.c#L397

P.S. Supported kernels 4.14-6.8 https://github.com/tbsdtv/linux_media https://github.com/tbsdtv/media_build

woooow1 commented 1 month ago

@crazycat69 , thanks for reply! I already use tbs fork, but card not work! Tested also on fta channels. Card is v13! I think need some settings in tuner, or demod... I2c is detected :

i2c-9 smbus Mantis I2C SMBus adapter i2c-10 i2c TT-Budget S2-1600 PCI I2C adapter i2c-11 i2c SAA716x I2C Core 0 I2C adapter i2c-12 i2c SAA716x I2C Core 1 I2C adapter i2c-13 i2c SAA716x I2C Core 0 I2C adapter i2c-14 i2c SAA716x I2C Core 1 I2C adapter

Ci slot is available... Driver modules are loaded. What else is missing??? With same settings in tvheadend, with closed source driver, both tuners working!

crazycat69 commented 1 month ago

TBS6991_TSMODE0 (0x33) is parallel TS TBS6991_TSMODE1 (0x31) is serial TS

woooow1 commented 1 month ago

Other related settings in decompiled driver for tsmode in function called tbs6991fe_attach: if (((iVar2 == 0x58) || (iVar2 < 0x59)) || ((iVar2 != 0x66 && (iVar2 != 0x68)))) { state_00->tsmode = 0; } else { state_00->tsmode = 1; }

crazycat69 commented 1 month ago

you have "tbsci: Initializing TBS 6991 v13 CI" in kernel log ?

crazycat69 commented 1 month ago

https://github.com/tbsdtv/linux_media/blob/c561bd051b09cc16622d021713b75f1b814d9e19/drivers/media/pci/saa716x/saa716x_budget.c#L2487 change to ret = tbsci_i2c_probe(adapter,count?3:4);

woooow1 commented 1 month ago

you have "tbsci: Initializing TBS 6991 v13 CI" in kernel log ?

Yes, tbsci: Initializing TBS 6991 v13 CI 0 slot tbsci: Initializing TBS 6991 v13 CI 1 slot

I already try you suggestion, with ret = tbsci_i2c_probe(adapter,count?3:4); ci slots is not initialized!