All of lore.kernel.org
 help / color / mirror / Atom feed
* Fwd: Experimental additions dvb-usb-v2 rtl28xxu to support Delock 61959 V2
       [not found] <CAFi-X+WyqNv5ZcDdTH0ZXgWa7o+eT5EE2UsGnemKjeSiGRHyeQ@mail.gmail.com>
@ 2021-08-29 10:13 ` Oliver Kleinecke
  2021-09-06  5:46   ` Matthias Schwarzott
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Kleinecke @ 2021-08-29 10:13 UTC (permalink / raw)
  To: linux-media

[-- Attachment #1: Type: text/plain, Size: 1062 bytes --]

Hi everybody !

While trying to get a usb dvb-c/t stick running, which I own, I was
able to make a biot of progress and I hope it is enough to ask for
further help with tidying up my noobish poc code and help me to fix an
I2C problem I am unable to fix myself actually.

The device is a  Delock USB 2.0 DVB-T/DVB-C Receiver (Version 2.0) -
V1 is fully supported, V2 currently not.
This device is nearly identical to the (already fully mainline-kernel
supported) GotView  MasterHD3 except it uses a different slave demod -
the SI2165 instead of SI2168.

Current status for the device with my unprofessional additions: dvb-c
running with regular continuity errors and FE-Read errors. Dvb-T is
fully untested, as I have no signal in my area here.

The patch with my own additions is attached as well as a log showing
the full usb-registering and load of fw files. Any help on debugging
mentioned continuity errors / FE errors would be very much
appreciated, I am willing to apply testing patches & provide
additional debug info, if necessary.

Best regards,
Oliver

[-- Attachment #2: delock61959v2_experimental.patch --]
[-- Type: application/x-patch, Size: 6100 bytes --]

[-- Attachment #3: delock61959_usb_register_syslog.log --]
[-- Type: application/octet-stream, Size: 6121 bytes --]

Aug 29 11:26:13 transcodepi1 kernel: [   97.914771] usb 1-1.2: new high-speed USB device number 6 using xhci_hcd
Aug 29 11:26:13 transcodepi1 kernel: [   98.054962] usb 1-1.2: New USB device found, idVendor=1b80, idProduct=d3b1, bcdDevice= 1.00
Aug 29 11:26:13 transcodepi1 kernel: [   98.054984] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Aug 29 11:26:13 transcodepi1 kernel: [   98.055003] usb 1-1.2: Product: usbtv
Aug 29 11:26:13 transcodepi1 kernel: [   98.055020] usb 1-1.2: Manufacturer: realtek
Aug 29 11:26:14 transcodepi1 kernel: [   98.117751] usb 1-1.2: dvb_usb_v2: found a 'Delock 61959 v2' in warm state
Aug 29 11:26:14 transcodepi1 kernel: [   98.331322] usb 1-1.2: dvb_usb_v2: will pass the complete MPEG2 transport stream to the software demuxer
Aug 29 11:26:14 transcodepi1 kernel: [   98.331346] dvbdev: DVB: registering new adapter (Delock 61959 v2)
Aug 29 11:26:14 transcodepi1 kernel: [   98.331356] usb 1-1.2: media controller created
Aug 29 11:26:14 transcodepi1 kernel: [   98.332519] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered.
Aug 29 11:26:14 transcodepi1 kernel: [   98.348536] i2c i2c-22: Added multiplexed i2c bus 23
Aug 29 11:26:14 transcodepi1 kernel: [   98.348547] rtl2832 22-0010: Realtek RTL2832 successfully attached
Aug 29 11:26:14 transcodepi1 kernel: [   98.373681] si2165 22-0064: Detected Silicon Labs Si2165-D (type 7, rev 3)
Aug 29 11:26:14 transcodepi1 kernel: [   98.373754] usb 1-1.2: DVB: registering adapter 0 frontend 0 (Realtek RTL2832 (DVB-T))...
Aug 29 11:26:14 transcodepi1 kernel: [   98.373769] dvbdev: dvb_create_media_entity: media entity 'Realtek RTL2832 (DVB-T)' registered.
Aug 29 11:26:14 transcodepi1 kernel: [   98.373886] usb 1-1.2: DVB: registering adapter 0 frontend 1 (Silicon Labs Si2165 DVB-T DVB-C)...
Aug 29 11:26:14 transcodepi1 kernel: [   98.373896] dvbdev: dvb_create_media_entity: media entity 'Silicon Labs Si2165 DVB-T DVB-C' registered.
Aug 29 11:26:14 transcodepi1 kernel: [   98.385661] si2157 22-0060: Silicon Labs Si2147/2148/2157/2158 successfully attached
Aug 29 11:26:14 transcodepi1 kernel: [   98.402056] usb 1-1.2: dvb_usb_v2: 'Delock 61959 v2' successfully initialized and connected
Aug 29 11:26:14 transcodepi1 kernel: [   98.402159] usbcore: registered new interface driver dvb_usb_rtl28xxu
Aug 29 11:26:51 transcodepi1 kernel: [  135.593147] si2157 22-0060: found a 'Silicon Labs Si2148-A20'
Aug 29 11:26:51 transcodepi1 kernel: [  135.595435] si2157 22-0060: downloading firmware from file 'dvb-tuner-si2158-a20-01.fw'
Aug 29 11:26:53 transcodepi1 kernel: [  137.108309] si2157 22-0060: firmware version: 2.1.9
Aug 29 11:26:53 transcodepi1 kernel: [  137.121724] usb 1-1.2: DVB: adapter 0 frontend 0 frequency 0 out of range (174000000..862000000)
Aug 29 11:26:53 transcodepi1 kernel: [  137.783235] si2165 22-0064: downloading firmware from file 'dvb-demod-si2165.fw' size=5768
Aug 29 11:26:53 transcodepi1 kernel: [  137.801744] si2165 22-0064: si2165_upload_firmware: extracted patch_version=0x9a, block_count=0x27, crc_expected=0xcc0a
Aug 29 11:26:57 transcodepi1 kernel: [  141.552038] si2165 22-0064: fw load finished
Aug 29 11:26:57 transcodepi1 kernel: [  141.578787] si2157 22-0060: found a 'Silicon Labs Si2148-A20'
Aug 29 11:26:57 transcodepi1 kernel: [  141.578916] si2157 22-0060: downloading firmware from file 'dvb-tuner-si2158-a20-01.fw'
Aug 29 11:26:59 transcodepi1 kernel: [  143.102670] si2157 22-0060: firmware version: 2.1.9
Aug 29 11:26:59 transcodepi1 kernel: [  143.116327] usb 1-1.2: DVB: adapter 0 frontend 1 frequency 0 out of range (42000000..870000000)
Aug 29 11:26:59 transcodepi1 kernel: [  143.258721] si2157 22-0060: found a 'Silicon Labs Si2148-A20'
Aug 29 11:26:59 transcodepi1 kernel: [  143.258813] si2157 22-0060: downloading firmware from file 'dvb-tuner-si2158-a20-01.fw'
Aug 29 11:27:00 transcodepi1 kernel: [  144.771118] si2157 22-0060: firmware version: 2.1.9

Aug 29 11:29:29 transcodepi1 tvheadend[1357]: TS: DVB-C Network/146MHz/ProSieben HD: H264 @ #523 Continuity counter error (total 1)
Aug 29 11:29:40 transcodepi1 tvheadend[1357]: TS: DVB-C Network/146MHz/ProSieben HD: H264 @ #523 Continuity counter error (total 3)
Aug 29 11:29:50 transcodepi1 tvheadend[1357]: TS: DVB-C Network/146MHz/ProSieben HD: H264 @ #523 Continuity counter error (total 4)
Aug 29 11:29:56 transcodepi1 tvheadend[1357]: tbl-eit: eit: 146MHz in DVB-C Network: invalid checksum (len 3390, errors 1)
Aug 29 11:29:56 transcodepi1 tvheadend[1357]: tbl-pass: pass-eit: -: invalid checksum (len 3390, errors 1)
Aug 29 11:30:05 transcodepi1 tvheadend[1357]: TS: DVB-C Network/146MHz/ProSieben HD: H264 @ #523 Continuity counter error (total 12)
Aug 29 11:30:16 transcodepi1 tvheadend[1357]: TS: DVB-C Network/146MHz/ProSieben HD: H264 @ #523 Continuity counter error (total 16)
Aug 29 11:30:30 transcodepi1 tvheadend[1357]: TS: DVB-C Network/146MHz/ProSieben HD: H264 @ #523 Continuity counter error (total 19)
Aug 29 11:30:31 transcodepi1 tvheadend[1357]: tbl-eit: eit: 146MHz in DVB-C Network: invalid checksum (len 3653, errors 2)
Aug 29 11:30:31 transcodepi1 tvheadend[1357]: tbl-pass: pass-eit: -: invalid checksum (len 3653, errors 2)
Aug 29 11:30:41 transcodepi1 tvheadend[1357]: linuxdvb: Silicon Labs Si2165 DVB-T DVB-C #0 : DVB-C #1 - FE_READ_STATUS error Datenübergabe unterbrochen (broken pipe)
Aug 29 11:30:47 transcodepi1 tvheadend[1357]: TS: DVB-C Network/146MHz/ProSieben HD: H264 @ #523 Continuity counter error (total 21)
Aug 29 11:31:01 transcodepi1 tvheadend[1357]: TS: DVB-C Network/146MHz/ProSieben HD: H264 @ #523 Continuity counter error (total 24)
Aug 29 11:31:17 transcodepi1 tvheadend[1357]: TS: DVB-C Network/146MHz/ProSieben HD: H264 @ #523 Continuity counter error (total 27)
Aug 29 11:31:27 transcodepi1 tvheadend[1357]: TS: DVB-C Network/146MHz/ProSieben HD: H264 @ #523 Continuity counter error (total 31)
Aug 29 11:31:29 transcodepi1 tvheadend[1357]: linuxdvb: Silicon Labs Si2165 DVB-T DVB-C #0 : DVB-C #1 - FE_READ_STATUS error Datenübergabe unterbrochen (broken pipe)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Fwd: Experimental additions dvb-usb-v2 rtl28xxu to support Delock 61959 V2
  2021-08-29 10:13 ` Fwd: Experimental additions dvb-usb-v2 rtl28xxu to support Delock 61959 V2 Oliver Kleinecke
@ 2021-09-06  5:46   ` Matthias Schwarzott
  0 siblings, 0 replies; 2+ messages in thread
From: Matthias Schwarzott @ 2021-09-06  5:46 UTC (permalink / raw)
  To: Oliver Kleinecke, linux-media

Am 29.08.21 um 12:13 schrieb Oliver Kleinecke:
 > Hi everybody !
 >
Hi Oliver,

 > While trying to get a usb dvb-c/t stick running, which I own, I was
 > able to make a biot of progress and I hope it is enough to ask for
 > further help with tidying up my noobish poc code and help me to fix an
 > I2C problem I am unable to fix myself actually.
 >
 > The device is a  Delock USB 2.0 DVB-T/DVB-C Receiver (Version 2.0) -
 > V1 is fully supported, V2 currently not.
 > This device is nearly identical to the (already fully mainline-kernel
 > supported) GotView  MasterHD3 except it uses a different slave demod -
 > the SI2165 instead of SI2168.
 >
 > Current status for the device with my unprofessional additions: dvb-c
 > running with regular continuity errors and FE-Read errors. Dvb-T is
 > fully untested, as I have no signal in my area here.

With an Hauppauge stick I had the same issue. DVB-C had permanent 
issues. Channel lock was fine, but the data was having missing parts. 
This was fixed by Brad Love in commit 
8b1ca8a0363efdfa63358f598a2cadda2e514ab7 (media: cx231xx: Increase USB 
bridge bandwidth).
Maybe a similar fix could be applied to RTL2832P chip.
According to your log the continuity errors do not appear each second, 
but with intervals of ~10s. So it might be a different issue that just 
requires some fine-tuning of parameters.

 >
 > The patch with my own additions is attached as well as a log showing
 > the full usb-registering and load of fw files. Any help on debugging
 > mentioned continuity errors / FE errors would be very much
 > appreciated, I am willing to apply testing patches & provide
 > additional debug info, if necessary.

Please put patches into the body of the mail and not as attachment.
I copied your patch here to comment on it. See comments inline.
The patch is a good start.

Regards
Matthias


I had a look at the patch:
 > --- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c    2021-08-29 
11:52:57.046097064 +0200
 > +++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c    2021-08-29 
11:58:54.903816166 +0200
 > @@ -594,6 +594,13 @@
 >              dev->slave_demod = SLAVE_DEMOD_SI2168;
 >              goto demod_found;
 >          }
 > +        /* TODO: check Si2165 ID register; reg=23 val=07 assumed but 
doesnt work

According to your comment you tried to read the ID register from here. 
But this does not work as long as si2165 is in standby. To wake it up 
you need to write to REG_CHIP_MODE (0x0000). Then you are able to read 
other registers besides 0x0000 and 0x0001, e.g. the ID and revision. And 
after that you should send it back to standby.

Compare the probe function of si2165: 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/media/dvb-frontends/si2165.c#n1200


 > +        terrible hack here for PoC */
 > +                else {
 > +                        dev_dbg(&d->intf->dev, "Si2165 found\n");
 > +                        dev->slave_demod = SLAVE_DEMOD_SI2165;
 > +                        goto demod_found;
 > +                }
 >      }
 >
 >  demod_found:
 > @@ -1010,33 +1017,65 @@
 >                  goto err_slave_demod_failed;
 >              adap->fe[1]->id = 1;
 >              dev->i2c_client_slave_demod = NULL;
 > -        } else {
 > -            struct si2168_config si2168_config = {};
 > -            struct i2c_adapter *adapter;
 > -
 > -            si2168_config.i2c_adapter = &adapter;
 > -            si2168_config.fe = &adap->fe[1];
 > -            si2168_config.ts_mode = SI2168_TS_SERIAL;
 > -            si2168_config.ts_clock_inv = false;
 > -            si2168_config.ts_clock_gapped = true;
 > -            strscpy(info.type, "si2168", I2C_NAME_SIZE);
 > -            info.addr = 0x64;
 > -            info.platform_data = &si2168_config;
 > -            request_module(info.type);
 > -            client = i2c_new_client_device(&d->i2c_adap, &info);
 > -            if (!i2c_client_has_driver(client))
 > -                goto err_slave_demod_failed;
 > -
 > -            if (!try_module_get(client->dev.driver->owner)) {
 > -                i2c_unregister_device(client);
 > -                goto err_slave_demod_failed;
 > -            }
 > -
 > -            dev->i2c_client_slave_demod = client;
 > -
 > -            /* for Si2168 devices use only new I2C write method */
 > -            dev->new_i2c_write = true;
 > -        }
 > +        } else if (dev->slave_demod == SLAVE_DEMOD_SI2168) {
 > +                        struct si2168_config si2168_config = {};
 > +                        struct i2c_adapter *adapter;
 > +
 > +                        si2168_config.i2c_adapter = &adapter;
 > +                        si2168_config.fe = &adap->fe[1];
 > +                        si2168_config.ts_mode = SI2168_TS_SERIAL;
 > +                        si2168_config.ts_clock_inv = false;
 > +                        si2168_config.ts_clock_gapped = true;
 > +                        strscpy(info.type, "si2168", I2C_NAME_SIZE);
 > +                        info.addr = 0x64;
 > +                        info.platform_data = &si2168_config;
 > +                        request_module(info.type);
 > +                        client = i2c_new_client_device(&d->i2c_adap, 
&info);
 > +                        if (!i2c_client_has_driver(client)) {
 > +                                dev->slave_demod = SLAVE_DEMOD_NONE;
 > +                                goto err_slave_demod_failed;
 > +                        }
 > +
 > +                        if 
(!try_module_get(client->dev.driver->owner)) {
 > +                                i2c_unregister_device(client);
 > +                                dev->slave_demod = SLAVE_DEMOD_NONE;
 > +                                goto err_slave_demod_failed;
 > +                        }
 > +
 > +                        dev->i2c_client_slave_demod = client;
 > +
 > +                        /* for Si2168 devices use only new I2C write 
method */
 > +                        dev->new_i2c_write = true;
 > +                } else if (dev->slave_demod == SLAVE_DEMOD_SI2165) {
 > +                        struct si2165_platform_data 
si2165_platform_data = {};
 > +                        si2165_platform_data.fe = &adap->fe[1];
 > +                        si2165_platform_data.chip_mode = 
SI2165_MODE_PLL_XTAL;
 > +                        si2165_platform_data.ref_freq_hz = 24000000;
 > +                        si2165_platform_data.inversion = false;
 > +                        strscpy(info.type, "si2165", I2C_NAME_SIZE);
 > +                        info.addr = 0x64;
 > +                        info.platform_data = &si2165_platform_data;
 > +                        request_module(info.type);
 > +                        client = i2c_new_client_device(&d->i2c_adap, 
&info);
 > +                        if (!i2c_client_has_driver(client)) {
 > +                                dev->slave_demod = SLAVE_DEMOD_NONE;
 > +                                goto err_slave_demod_failed;
 > +
 > +                        }
 > +
 > +                        if 
(!try_module_get(client->dev.driver->owner)) {
 > +                                i2c_unregister_device(client);
 > +                                dev->slave_demod = SLAVE_DEMOD_NONE;
 > +                                goto err_slave_demod_failed;
 > +                        }

This part could be switched to dvb_module_probe. But I do not know if 
this conversion can be done for single frontends at a time. Or if it 
need to be done for all supported devices (of rt28xxu) together.

 > +
 > +                        dev->i2c_client_slave_demod = client;
 > +                        dev->new_i2c_write = true;
 > +                } else {
 > +                        /* Unknown demodulator */
 > +                        dev->slave_demod = SLAVE_DEMOD_NONE;
 > +                        goto err_slave_demod_failed;
 > +                }
 >      }
 >      return 0;
 >
 > @@ -1969,6 +2008,8 @@
 >          RC_MAP_ASTROMETA_T2HYBRID) },
 >      { DVB_USB_DEVICE(0x5654, 0xca42,
 >          &rtl28xxu_props, "GoTView MasterHD 3", NULL) },
 > +    { DVB_USB_DEVICE(0x1b80, 0xd3b1,
 > +                &rtl28xxu_props, "Delock 61959 v2", NULL) },
 >      { }
 >  };
 >  MODULE_DEVICE_TABLE(usb, rtl28xxu_id_table);
 > --- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.h    2021-08-29 
11:36:06.034933825 +0200
 > +++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.h    2021-08-11 
17:40:13.625130749 +0200
 > @@ -29,6 +29,7 @@
 >  #include "fc2580.h"
 >  #include "tua9001.h"
 >  #include "r820t.h"
 > +#include "si2165.h"
 >  #include "si2168.h"
 >  #include "si2157.h"
 >
 > @@ -76,6 +77,7 @@
 >      #define SLAVE_DEMOD_MN88473        2
 >      #define SLAVE_DEMOD_SI2168         3
 >      #define SLAVE_DEMOD_CXD2837ER      4
 > +    #define SLAVE_DEMOD_SI2165         5
 >      unsigned int slave_demod:3;
 >      union {
 >          struct rtl2830_platform_data rtl2830_platform_data;
 > --- a/drivers/media/usb/dvb-usb-v2/Kconfig    2021-08-29 
11:37:01.364542549 +0200
 > +++ b/drivers/media/usb/dvb-usb-v2/Kconfig    2021-08-11 
16:26:00.294109619 +0200
 > @@ -138,6 +138,7 @@
 >      select DVB_RTL2830
 >      select DVB_RTL2832
 >      select DVB_RTL2832_SDR if (MEDIA_SUBDRV_AUTOSELECT && 
MEDIA_SDR_SUPPORT && VIDEO_V4L2)
 > +    select DVB_SI2165 if MEDIA_SUBDRV_AUTOSELECT
 >      select DVB_SI2168 if MEDIA_SUBDRV_AUTOSELECT
 >      select MEDIA_TUNER_E4000 if (MEDIA_SUBDRV_AUTOSELECT && VIDEO_V4L2)
 >      select MEDIA_TUNER_FC0012 if MEDIA_SUBDRV_AUTOSELECT

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-06  5:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAFi-X+WyqNv5ZcDdTH0ZXgWa7o+eT5EE2UsGnemKjeSiGRHyeQ@mail.gmail.com>
2021-08-29 10:13 ` Fwd: Experimental additions dvb-usb-v2 rtl28xxu to support Delock 61959 V2 Oliver Kleinecke
2021-09-06  5:46   ` Matthias Schwarzott

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.