MyGica T230 dvb-t2 data corruption since commit 5fa8815
Subsystems (2)
(trying again in plain text)...
I'm encountering invalid checksum errors randomly in tvheadend with my MyGica T230 DVB-T2 tuner, straight after upgrading from Debian Stretch (kernel 4.9.168) to Buster (kernel 4.19.37).
For example
2019-06-29 16:32:27.259 [ INFO]:subscription: 004B: "scan" subscribing to mux "618.167MHz", weight: 6, adapter: "Silicon Labs Si2168 #0 : DVB-T #0", network: "Freeview", service: "Raw PID Subscription" 2019-06-29 16:32:27.769 [WARNING]:tbl-eit: uk_freeview: 618.167MHz in Freeview: invalid checksum (len 1558, errors 1) 2019-06-29 16:32:27.770 [WARNING]:tbl-base: pat: 618.167MHz in Freeview: invalid checksum (len 136, errors 1) 2019-06-29 16:32:27.967 [WARNING]:tbl-base: sdt: 618.167MHz in Freeview: invalid checksum (len 971, errors 1) 2019-06-29 16:32:28.462 [WARNING]:tbl-base: pmt: 618.167MHz in Freeview: invalid checksum (len 60, errors 1) 2019-06-29 16:32:28.463 [WARNING]:tbl-base: pmt: 618.167MHz in Freeview: invalid checksum (len 46, errors 1) 2019-06-29 16:32:28.637 [WARNING]:tbl-base: pmt: 618.167MHz in Freeview: invalid checksum (len 38, errors 1) 2019-06-29 16:32:32.258 [ INFO]:mpegts: 618.167MHz in Freeview scan complete 2019-06-29 16:32:32.258 [ INFO]:subscription: 004B: "scan" unsubscribing 2019-06-29 16:32:32.259 [ INFO]:mpegts: 642MHz in Freeview - tuning on Silicon Labs Si2168 #0 : DVB-T #0 2019-06-29 16:32:32.259 [ INFO]:subscription: 004E: "scan" subscribing to mux "642MHz", weight: 6, adapter: "Silicon Labs Si2168 #0 : DVB-T #0", network: "Freeview", service: "Raw PID Subscription" 2019-06-29 16:32:41.179 [ INFO]:mpegts: 642MHz in Freeview scan complete 2019-06-29 16:32:41.179 [ INFO]:subscription: 004E: "scan" unsubscribing 2019-06-29 16:32:41.180 [ INFO]:mpegts: 602MHz in Freeview - tuning on Silicon Labs Si2168 #0 : DVB-T #0 2019-06-29 16:32:41.180 [ INFO]:subscription: 0052: "scan" subscribing to mux "602MHz", weight: 6, adapter: "Silicon Labs Si2168 #0 : DVB-T #0", network: "Freeview", service: "Raw PID Subscription" 2019-06-29 16:32:41.835 [WARNING]:tbl-eit: uk_freeview: 602MHz in Freeview: invalid checksum (len 320, errors 1) 2019-06-29 16:32:42.109 [WARNING]:tbl-base: sdt: 602MHz in Freeview: invalid checksum (len 322, errors 1) 2019-06-29 16:32:42.314 [WARNING]:tbl-base: pmt: 602MHz in Freeview: invalid checksum (len 84, errors 1) 2019-06-29 16:32:46.180 [ INFO]:mpegts: 602MHz in Freeview scan complete 2019-06-29 16:32:46.180 [ INFO]:subscription: 0052: "scan" unsubscribing
The issue is not specific to particular muxes, and happens entirely at random. If I retune then the same mux will scan without issue. It also causes data corruption when streaming with continuity counter errors in the tvh log; again retuning often resolves the problem, but i never had any such issues with kernel v4.9.x.
Heres the output of lsusb to confirm my hardware id:
0572:c688 Conexant Systems (Rockwell), Inc. Geniatech T230 DVB-T2 TV Stick
I've been testing various kernel versions in-between 4.9->4.19 and quickly found that the issue was introduced somewhere between 4.9->4.10.
I therefore performed a (lengthy) git bisect to find out which of the 14,248 commits during the v4.10 development cycle introduced this regression.
I have tracked this regression down to the following commit:
5fa8815: [media] dvb-usb-cxusb: Geniatech T230 - resync TS FIFO after lock
Indeed, if I revert that commit on an upto-date kernel, I now have a stable MyGica T230 tuner once more.
Please note that i've tried the latest media_build drivers and have also the 5.2 kernel; both of which have the issue, and both of which can be fixed by reverting 5fa8815.
Regards,
James
Hi James,
I have T230 and T230C (v2) and with both sticks I see invalid checksum errors. My buest guess is that they come from bad power supply decoupling on the demodulator chip.
The fact that you only see errors with this commit can then be explained as a timing problem that exists because of this bad decoupling.
Cheers,
Jan Pieter.
Quoted 77 lines · James Hutchinson
(trying again in plain text)...
I'm encountering invalid checksum errors randomly in tvheadend with my MyGica T230 DVB-T2 tuner, straight after upgrading from Debian Stretch (kernel 4.9.168) to Buster (kernel 4.19.37).
For example
2019-06-29 16:32:27.259 [ INFO]:subscription: 004B: "scan" subscribing to mux "618.167MHz", weight: 6, adapter: "Silicon Labs Si2168 #0 : DVB-T #0", network: "Freeview", service: "Raw PID Subscription" 2019-06-29 16:32:27.769 [WARNING]:tbl-eit: uk_freeview: 618.167MHz in Freeview: invalid checksum (len 1558, errors 1) 2019-06-29 16:32:27.770 [WARNING]:tbl-base: pat: 618.167MHz in Freeview: invalid checksum (len 136, errors 1) 2019-06-29 16:32:27.967 [WARNING]:tbl-base: sdt: 618.167MHz in Freeview: invalid checksum (len 971, errors 1) 2019-06-29 16:32:28.462 [WARNING]:tbl-base: pmt: 618.167MHz in Freeview: invalid checksum (len 60, errors 1) 2019-06-29 16:32:28.463 [WARNING]:tbl-base: pmt: 618.167MHz in Freeview: invalid checksum (len 46, errors 1) 2019-06-29 16:32:28.637 [WARNING]:tbl-base: pmt: 618.167MHz in Freeview: invalid checksum (len 38, errors 1) 2019-06-29 16:32:32.258 [ INFO]:mpegts: 618.167MHz in Freeview scan complete 2019-06-29 16:32:32.258 [ INFO]:subscription: 004B: "scan" unsubscribing 2019-06-29 16:32:32.259 [ INFO]:mpegts: 642MHz in Freeview - tuning on Silicon Labs Si2168 #0 : DVB-T #0 2019-06-29 16:32:32.259 [ INFO]:subscription: 004E: "scan" subscribing to mux "642MHz", weight: 6, adapter: "Silicon Labs Si2168 #0 : DVB-T #0", network: "Freeview", service: "Raw PID Subscription" 2019-06-29 16:32:41.179 [ INFO]:mpegts: 642MHz in Freeview scan complete 2019-06-29 16:32:41.179 [ INFO]:subscription: 004E: "scan" unsubscribing 2019-06-29 16:32:41.180 [ INFO]:mpegts: 602MHz in Freeview - tuning on Silicon Labs Si2168 #0 : DVB-T #0 2019-06-29 16:32:41.180 [ INFO]:subscription: 0052: "scan" subscribing to mux "602MHz", weight: 6, adapter: "Silicon Labs Si2168 #0 : DVB-T #0", network: "Freeview", service: "Raw PID Subscription" 2019-06-29 16:32:41.835 [WARNING]:tbl-eit: uk_freeview: 602MHz in Freeview: invalid checksum (len 320, errors 1) 2019-06-29 16:32:42.109 [WARNING]:tbl-base: sdt: 602MHz in Freeview: invalid checksum (len 322, errors 1) 2019-06-29 16:32:42.314 [WARNING]:tbl-base: pmt: 602MHz in Freeview: invalid checksum (len 84, errors 1) 2019-06-29 16:32:46.180 [ INFO]:mpegts: 602MHz in Freeview scan complete 2019-06-29 16:32:46.180 [ INFO]:subscription: 0052: "scan" unsubscribingThe issue is not specific to particular muxes, and happens entirely at random. If I retune then the same mux will scan without issue. It also causes data corruption when streaming with continuity counter errors in the tvh log; again retuning often resolves the problem, but i never had any such issues with kernel v4.9.x.
Heres the output of lsusb to confirm my hardware id:
0572:c688 Conexant Systems (Rockwell), Inc. Geniatech T230 DVB-T2 TV StickI've been testing various kernel versions in-between 4.9->4.19 and quickly found that the issue was introduced somewhere between 4.9->4.10.
I therefore performed a (lengthy) git bisect to find out which of the 14,248 commits during the v4.10 development cycle introduced this regression.
I have tracked this regression down to the following commit:
5fa8815: [media] dvb-usb-cxusb: Geniatech T230 - resync TS FIFO after lockIndeed, if I revert that commit on an upto-date kernel, I now have a stable MyGica T230 tuner once more.
Please note that i've tried the latest
media_builddrivers and have also the 5.2 kernel; both of which have the issue, and both of which can be fixed by reverting 5fa8815.Regards,
James
Hi James,
I have both sticks (v1 and v2) and can confirm your observations. I also pinned the problem down to the commit you specified. I am running on a kernel with that commit reverted for some months now and didn't observe any problems so far.
The easiest way to reproduce this issue was to force a complete network scan in tvheadend. With that commit applied, the scan always failed after ~50% of all muxes were scanned. And it was not just about some continuity errors, but a complete loss of signal that could only be resolved by rebooting.
After reverting the commit, everything runs fine.
Best regards
Thomas
dvbsky: add MyGica T230.
Moved from cxusb driver as that driver can't handle FX2 FIFO issue.
---
drivers/media/usb/dvb-usb-v2/dvbsky.c +13 -3
@@ -561,11 +561,18 @@/* attach tuner */ si2157_config.fe = adap->fe[0 ]; - si2157_config.if_port =0 ; - - state->i2c_client_tuner =dvb_module_probe ("si2157" ,"si2141" , +if (le16_to_cpu (d->udev->descriptor.idProduct) ==USB_PID_MYGICA_T230 ) { + si2157_config.if_port =1 ; + state->i2c_client_tuner =dvb_module_probe ("si2157" ,NULL , + i2c_adapter, +0x60 , &si2157_config); + } +else { + si2157_config.if_port =0 ; + state->i2c_client_tuner =dvb_module_probe ("si2157" ,"si2141" , i2c_adapter,0x60 , &si2157_config); + }if (!state->i2c_client_tuner) {dvb_module_release (state->i2c_client_demod);return -ENODEV ;
@@ -787,6 +794,9 @@ {DVB_USB_DEVICE (USB_VID_TERRATEC ,USB_PID_TERRATEC_CINERGY_S2_R4 , &dvbsky_s960_props,"Terratec Cinergy S2 Rev.4" , RC_MAP_DVBSKY) }, + { DVB_USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230, + &mygica_t230c_props,"MyGica Mini DVB-T2 USB Stick T230" , + RC_MAP_TOTAL_MEDIA_IN_HAND_02) }, { DVB_USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230C, &mygica_t230c_props,"MyGica Mini DVB-T2 USB Stick T230C" , RC_MAP_TOTAL_MEDIA_IN_HAND_02) },
Quoted 2 lines · Jan Pieter van Woerkom
dvbsky: add MyGica T230.
Moved from cxusb driver as that driver can't handle FX2 FIFO issue.
Well then it should be deleted from the cxusb driver. Also how well is this tested?
Thanks
Sean
Quoted 38 lines
Signed-off-by Jan Pieter van Woerkom <[email protected]>---
diff -rua/drivers/media/usb/dvb-usb-v2/dvbsky.cb/drivers/media/usb/dvb-usb-v2/dvbsky.cdrivers/media/usb/dvb-usb-v2/dvbsky.c +13
-3@@ -561,11 +561,18 @@/* attach tuner */ si2157_config.fe = adap->fe[0 ]; - si2157_config.if_port =0 ; - - state->i2c_client_tuner =dvb_module_probe ("si2157" ,"si2141" , +if (le16_to_cpu (d->udev->descriptor.idProduct) ==USB_PID_MYGICA_T230 ) { + si2157_config.if_port =1 ; + state->i2c_client_tuner =dvb_module_probe ("si2157" ,NULL , + i2c_adapter, +0x60 , &si2157_config); + } +else { + si2157_config.if_port =0 ; + state->i2c_client_tuner =dvb_module_probe ("si2157" ,"si2141" , i2c_adapter,0x60 , &si2157_config); + }if (!state->i2c_client_tuner) {dvb_module_release (state->i2c_client_demod);return -ENODEV ;@@ -787,6 +794,9 @@ {DVB_USB_DEVICE (USB_VID_TERRATEC ,USB_PID_TERRATEC_CINERGY_S2_R4 , &dvbsky_s960_props,"Terratec Cinergy S2 Rev.4" , RC_MAP_DVBSKY) }, + { DVB_USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230, + &mygica_t230c_props,"MyGica Mini DVB-T2 USB Stick T230" , + RC_MAP_TOTAL_MEDIA_IN_HAND_02) }, { DVB_USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230C, &mygica_t230c_props,"MyGica Mini DVB-T2 USB Stick T230C" , RC_MAP_TOTAL_MEDIA_IN_HAND_02) },
Hi Sean,
Quoted 5 lines · Sean Young
Quoted 2 lines · Jan Pieter van Woerkom
dvbsky: add MyGica T230.
Moved from cxusb driver as that driver can't handle FX2 FIFO issue.Well then it should be deleted from the cxusb driver. Also how well is this tested?
I'm watching DVB-T2 TV now with this for a couple of days and see no problems. Will test on DVB-C coming week. James will also test coming week.
The driver in cxusb crashes the kernel when I remove the stick while running. That is gone with this. I needed that. Another advantage is one can switch off the RC. I needed that too. And almost all code was already in dvbsky.
Yep it should be deleted from cxusb. I now blacklist that module while testing.
Quoted 3 lines
Thanks
Sean
Thank you,
Jan Pieter.
Quoted 37 lines
Quoted 37 lines
Signed-off-by Jan Pieter van Woerkom <[email protected]>---
diff -rua/drivers/media/usb/dvb-usb-v2/dvbsky.cb/drivers/media/usb/dvb-usb-v2/dvbsky.cdrivers/media/usb/dvb-usb-v2/dvbsky.c +13
-3@@ -561,11 +561,18 @@/* attach tuner */ si2157_config.fe = adap->fe[0 ]; - si2157_config.if_port =0 ; - - state->i2c_client_tuner =dvb_module_probe ("si2157" ,"si2141" , +if (le16_to_cpu (d->udev->descriptor.idProduct) ==USB_PID_MYGICA_T230 ) { + si2157_config.if_port =1 ; + state->i2c_client_tuner =dvb_module_probe ("si2157" ,NULL , + i2c_adapter, +0x60 , &si2157_config); + } +else { + si2157_config.if_port =0 ; + state->i2c_client_tuner =dvb_module_probe ("si2157" ,"si2141" , i2c_adapter,0x60 , &si2157_config); + }if (!state->i2c_client_tuner) {dvb_module_release (state->i2c_client_demod);return -ENODEV ;@@ -787,6 +794,9 @@ {DVB_USB_DEVICE (USB_VID_TERRATEC ,USB_PID_TERRATEC_CINERGY_S2_R4 , &dvbsky_s960_props,"Terratec Cinergy S2 Rev.4" , RC_MAP_DVBSKY) }, + { DVB_USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230, + &mygica_t230c_props,"MyGica Mini DVB-T2 USB Stick T230" , + RC_MAP_TOTAL_MEDIA_IN_HAND_02) }, { DVB_USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230C, &mygica_t230c_props,"MyGica Mini DVB-T2 USB Stick T230C" , RC_MAP_TOTAL_MEDIA_IN_HAND_02) },
A message that is not in the archive (sent off-list or not yet received): CAD+OKUre40kQiucuryJC0uYrvBSqL5M=pAkmi7QxgOoKUWt0bg@mail.gmail.com
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): CAD+OKUr-f_a8dcPVp24d4wPhRAE80tf10_kt5s3_WvVmfWu9JQ@mail.gmail.com
remove t230 from cxusb
---
drivers/media/usb/dvb-usb/cxusb.c +0 -158
@@ -369,26 +369,6 @@return 0 ; } -static int cxusb_read_status (struct dvb_frontend *fe, -enum fe_status *status) -{ -struct dvb_usb_adapter *adap = (struct dvb_usb_adapter *)fe->dvb->priv; -struct cxusb_state *state = (struct cxusb_state *)adap->dev->priv; -int ret; - - ret = state->fe_read_status (fe, status); - -/* it need resync slave fifo when signal change from unlock to lock.*/ -if ((*status &FE_HAS_LOCK ) && (!state->last_lock)) { -mutex_lock (&state->stream_mutex); -cxusb_streaming_ctrl (adap,1 ); -mutex_unlock (&state->stream_mutex); - } - - state->last_lock = (*status &FE_HAS_LOCK ) ?1 :0 ; -return ret; -} -static void cxusb_d680_dmb_drain_message (struct dvb_usb_device *d) {int ep = d->props.generic_bulk_ctrl_endpoint;
@@ -1164,83 +1144,6 @@return 0 ; } -static int cxusb_mygica_t230_frontend_attach (struct dvb_usb_adapter *adap) -{ -struct dvb_usb_device *d = adap->dev; -struct cxusb_state *st = d->priv; -struct i2c_adapter *adapter; -struct i2c_client *client_demod; -struct i2c_client *client_tuner; -struct i2c_board_info info; -struct si2168_config si2168_config; -struct si2157_config si2157_config; - -/* Select required USB configuration */ -if (usb_set_interface (d->udev,0 ,0 ) <0 ) -err ("set interface failed" ); - -/* Unblock all USB pipes */ -usb_clear_halt (d->udev, -usb_sndbulkpipe (d->udev, d->props.generic_bulk_ctrl_endpoint)); -usb_clear_halt (d->udev, -usb_rcvbulkpipe (d->udev, d->props.generic_bulk_ctrl_endpoint)); -usb_clear_halt (d->udev, -usb_rcvbulkpipe (d->udev, d->props.adapter[0 ].fe[0 ].stream.endpoint)); - -/* attach frontend */ - si2168_config.i2c_adapter = &adapter; - si2168_config.fe = &adap->fe_adap[0 ].fe; - si2168_config.ts_mode =SI2168_TS_PARALLEL ; - si2168_config.ts_clock_inv =1 ; -memset (&info,0 ,sizeof (struct i2c_board_info )); -strscpy (info.type,"si2168" ,I2C_NAME_SIZE ); - info.addr =0x64 ; - info.platform_data = &si2168_config; -request_module (info.type); - client_demod =i2c_new_device (&d->i2c_adap, &info); -if (client_demod ==NULL || client_demod->dev.driver ==NULL ) -return -ENODEV ; - -if (!try_module_get (client_demod->dev.driver->owner)) { -i2c_unregister_device (client_demod); -return -ENODEV ; - } - - st->i2c_client_demod = client_demod; - -/* attach tuner */ -memset (&si2157_config,0 ,sizeof (si2157_config)); - si2157_config.fe = adap->fe_adap[0 ].fe; - si2157_config.if_port =1 ; -memset (&info,0 ,sizeof (struct i2c_board_info )); -strscpy (info.type,"si2157" ,I2C_NAME_SIZE ); - info.addr =0x60 ; - info.platform_data = &si2157_config; -request_module (info.type); - client_tuner =i2c_new_device (adapter, &info); -if (client_tuner ==NULL || client_tuner->dev.driver ==NULL ) { -module_put (client_demod->dev.driver->owner); -i2c_unregister_device (client_demod); -return -ENODEV ; - } -if (!try_module_get (client_tuner->dev.driver->owner)) { -i2c_unregister_device (client_tuner); -module_put (client_demod->dev.driver->owner); -i2c_unregister_device (client_demod); -return -ENODEV ; - } - - st->i2c_client_tuner = client_tuner; - -/* hook fe: need to resync the slave fifo when signal locks. */ -mutex_init (&st->stream_mutex); - st->last_lock =0 ; - st->fe_read_status = adap->fe_adap[0 ].fe->ops.read_status; - adap->fe_adap[0 ].fe->ops.read_status = cxusb_read_status; - -return 0 ; -} -/* * DViCO has shipped two devices with the same USB ID, but only one of them * needs a firmware download. Check the device class details to see if they
@@ -1322,7 +1225,6 @@static struct dvb_usb_device_properties cxusb_aver_a868r_properties;static struct dvb_usb_device_properties cxusb_d680_dmb_properties;static struct dvb_usb_device_properties cxusb_mygica_d689_properties; -static struct dvb_usb_device_properties cxusb_mygica_t230_properties;static int cxusb_probe (struct usb_interface *intf,const struct usb_device_id *id)
@@ -1353,8 +1255,6 @@ THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, &cxusb_mygica_d689_properties, THIS_MODULE, NULL, adapter_nr) || - 0 == dvb_usb_device_init(intf, &cxusb_mygica_t230_properties, - THIS_MODULE, NULL, adapter_nr) || 0)return 0 ;
@@ -1405,7 +1305,6 @@DVICO_BLUEBIRD_DUAL_4_REV_2 ,CONEXANT_D680_DMB ,MYGICA_D689 , -MYGICA_T230 , NR__cxusb_table_index };
@@ -1470,9 +1369,6 @@ [MYGICA_D689 ] = {USB_DEVICE (USB_VID_CONEXANT ,USB_PID_MYGICA_D689 ) }, - [MYGICA_T230 ] = { -USB_DEVICE (USB_VID_CONEXANT ,USB_PID_MYGICA_T230 ) - }, {} /* Terminating entry */ };MODULE_DEVICE_TABLE (usb ,cxusb_table );
@@ -2128,60 +2024,6 @@ }, } }; - -static struct dvb_usb_device_properties cxusb_mygica_t230_properties = { - .caps =DVB_USB_IS_AN_I2C_ADAPTER , - - .usb_ctrl =CYPRESS_FX2 , - - .size_of_priv =sizeof (struct cxusb_state ), - - .num_adapters =1 , - .adapter = { - { - .num_frontends =1 , - .fe = {{ - .streaming_ctrl = cxusb_streaming_ctrl, - .frontend_attach = cxusb_mygica_t230_frontend_attach, - -/* parameter for the MPEG2-data transfer */ - .stream = { - .type =USB_BULK , - .count =5 , - .endpoint =0x02 , - .u = { - .bulk = { - .buffersize =8192 , - } - } - }, - } }, - }, - }, - - .power_ctrl = cxusb_d680_dmb_power_ctrl, - - .i2c_algo = &cxusb_i2c_algo, - - .generic_bulk_ctrl_endpoint =0x01 , - - .rc.core = { - .rc_interval =100 , - .rc_codes =RC_MAP_D680_DMB , - .module_name =KBUILD_MODNAME , - .rc_query = cxusb_d680_dmb_rc_query, - .allowed_protos =RC_PROTO_BIT_UNKNOWN , - }, - - .num_device_descs =1 , - .devices = { - { -"Mygica T230 DVB-T/T2/C" , - {NULL }, - { &cxusb_table[MYGICA_T230 ],NULL }, - }, - } -};static struct usb_driver cxusb_driver = { .name ="dvb_usb_cxusb" ,
Hi Jan,
My initial testing of your two patches to move the T230 to the dvbsky module looks good so far.
I'm testing on an 8th Gen NUC (8i3BEH) 16GB RAM, 2 x MyGica T230 T2 USB tuners, and 2 x DVBSky S960 S2 tuners.
This machine is running Debian stretch with the Debian 4.19.37 backport kernel (incl. your two patches to move the T230 to the dvbsky module).
I have a test script that performs 200x consecutive tvheadend network scans... This was executed against the UK Freeview network (6 muxes) =~1,200 tuning requests. This took a couple of hours, but not a single checksum error.
I moved onto streaming various channels and didn't have any problems so far. I only noted a couple of minor picture disturbances (continuity counter errors) when i tried to record two HD channels whilst watching a 3rd on the same mux. I'm not sure whether this was pushing things too far, and would like to carry out similar tests on a known working 4.9.x kernel.
I'll do more testing over the next couple of weeks and report back.
Also adding Thomas who has the same issue with the T230 tuner and bisected to issue to the same problematic commit as me.
Regards,
James.
Quoted 215 lines · Jan Pieter van Woerkom
remove t230 from cxusb
Signed-off-by Jan Pieter van Woerkom <[email protected]>---
diff -rua/drivers/media/usb/dvb-usb/cxusb.cb/drivers/media/usb/dvb-usb/cxusb.cdrivers/media/usb/dvb-usb/cxusb.c 2019-07-22 17:34:51.550698820 +0200 renamed from drivers/media/usb/dvb-usb/cxusb.c 2019-07-08 00:41:56.000000000 +0200 +0
-158@@ -369,26 +369,6 @@ return 0; } -static int cxusb_read_status(struct dvb_frontend *fe, - enum fe_status *status) -{ - struct dvb_usb_adapter *adap = (struct dvb_usb_adapter *)fe->dvb->priv; - struct cxusb_state *state = (struct cxusb_state *)adap->dev->priv; - int ret; - - ret = state->fe_read_status(fe, status); - - /* it need resync slave fifo when signal change from unlock to lock.*/ - if ((*status & FE_HAS_LOCK) && (!state->last_lock)) { - mutex_lock(&state->stream_mutex); - cxusb_streaming_ctrl(adap, 1); - mutex_unlock(&state->stream_mutex); - } - - state->last_lock = (*status & FE_HAS_LOCK) ? 1 : 0; - return ret; -} - static void cxusb_d680_dmb_drain_message(struct dvb_usb_device *d) { int ep = d->props.generic_bulk_ctrl_endpoint;@@ -1164,83 +1144,6 @@ return 0; } -static int cxusb_mygica_t230_frontend_attach(struct dvb_usb_adapter *adap) -{ - struct dvb_usb_device *d = adap->dev; - struct cxusb_state *st = d->priv; - struct i2c_adapter *adapter; - struct i2c_client *client_demod; - struct i2c_client *client_tuner; - struct i2c_board_info info; - struct si2168_config si2168_config; - struct si2157_config si2157_config; - - /* Select required USB configuration */ - if (usb_set_interface(d->udev, 0, 0) < 0) - err("set interface failed"); - - /* Unblock all USB pipes */ - usb_clear_halt(d->udev, - usb_sndbulkpipe(d->udev, d->props.generic_bulk_ctrl_endpoint)); - usb_clear_halt(d->udev, - usb_rcvbulkpipe(d->udev, d->props.generic_bulk_ctrl_endpoint)); - usb_clear_halt(d->udev, - usb_rcvbulkpipe(d->udev, d->props.adapter[0].fe[0].stream.endpoint)); - - /* attach frontend */ - si2168_config.i2c_adapter = &adapter; - si2168_config.fe = &adap->fe_adap[0].fe; - si2168_config.ts_mode = SI2168_TS_PARALLEL; - si2168_config.ts_clock_inv = 1; - memset(&info, 0, sizeof(struct i2c_board_info)); - strscpy(info.type, "si2168", I2C_NAME_SIZE); - info.addr = 0x64; - info.platform_data = &si2168_config; - request_module(info.type); - client_demod = i2c_new_device(&d->i2c_adap, &info); - if (client_demod == NULL || client_demod->dev.driver == NULL) - return -ENODEV; - - if (!try_module_get(client_demod->dev.driver->owner)) { - i2c_unregister_device(client_demod); - return -ENODEV; - } - - st->i2c_client_demod = client_demod; - - /* attach tuner */ - memset(&si2157_config, 0, sizeof(si2157_config)); - si2157_config.fe = adap->fe_adap[0].fe; - si2157_config.if_port = 1; - memset(&info, 0, sizeof(struct i2c_board_info)); - strscpy(info.type, "si2157", I2C_NAME_SIZE); - info.addr = 0x60; - info.platform_data = &si2157_config; - request_module(info.type); - client_tuner = i2c_new_device(adapter, &info); - if (client_tuner == NULL || client_tuner->dev.driver == NULL) { - module_put(client_demod->dev.driver->owner); - i2c_unregister_device(client_demod); - return -ENODEV; - } - if (!try_module_get(client_tuner->dev.driver->owner)) { - i2c_unregister_device(client_tuner); - module_put(client_demod->dev.driver->owner); - i2c_unregister_device(client_demod); - return -ENODEV; - } - - st->i2c_client_tuner = client_tuner; - - /* hook fe: need to resync the slave fifo when signal locks. */ - mutex_init(&st->stream_mutex); - st->last_lock = 0; - st->fe_read_status = adap->fe_adap[0].fe->ops.read_status; - adap->fe_adap[0].fe->ops.read_status = cxusb_read_status; - - return 0; -} - /* * DViCO has shipped two devices with the same USB ID, but only one of them * needs a firmware download. Check the device class details to see if they@@ -1322,7 +1225,6 @@ static struct dvb_usb_device_properties cxusb_aver_a868r_properties; static struct dvb_usb_device_properties cxusb_d680_dmb_properties; static struct dvb_usb_device_properties cxusb_mygica_d689_properties; -static struct dvb_usb_device_properties cxusb_mygica_t230_properties; static int cxusb_probe(struct usb_interface *intf, const struct usb_device_id *id)@@ -1353,8 +1255,6 @@ THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, &cxusb_mygica_d689_properties, THIS_MODULE, NULL, adapter_nr) || - 0 == dvb_usb_device_init(intf, &cxusb_mygica_t230_properties, - THIS_MODULE, NULL, adapter_nr) || 0) return 0;@@ -1405,7 +1305,6 @@ DVICO_BLUEBIRD_DUAL_4_REV_2, CONEXANT_D680_DMB, MYGICA_D689, - MYGICA_T230, NR__cxusb_table_index };@@ -1470,9 +1369,6 @@ [MYGICA_D689] = { USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_D689) }, - [MYGICA_T230] = { - USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230) - }, {} /* Terminating entry */ }; MODULE_DEVICE_TABLE (usb, cxusb_table);@@ -2128,60 +2024,6 @@ }, } }; - -static struct dvb_usb_device_properties cxusb_mygica_t230_properties = { - .caps = DVB_USB_IS_AN_I2C_ADAPTER, - - .usb_ctrl = CYPRESS_FX2, - - .size_of_priv = sizeof(struct cxusb_state), - - .num_adapters = 1, - .adapter = { - { - .num_frontends = 1, - .fe = {{ - .streaming_ctrl = cxusb_streaming_ctrl, - .frontend_attach = cxusb_mygica_t230_frontend_attach, - - /* parameter for the MPEG2-data transfer */ - .stream = { - .type = USB_BULK, - .count = 5, - .endpoint = 0x02, - .u = { - .bulk = { - .buffersize = 8192, - } - } - }, - } }, - }, - }, - - .power_ctrl = cxusb_d680_dmb_power_ctrl, - - .i2c_algo = &cxusb_i2c_algo, - - .generic_bulk_ctrl_endpoint = 0x01, - - .rc.core = { - .rc_interval = 100, - .rc_codes = RC_MAP_D680_DMB, - .module_name = KBUILD_MODNAME, - .rc_query = cxusb_d680_dmb_rc_query, - .allowed_protos = RC_PROTO_BIT_UNKNOWN, - }, - - .num_device_descs = 1, - .devices = { - { - "Mygica T230 DVB-T/T2/C", - { NULL }, - { &cxusb_table[MYGICA_T230], NULL }, - }, - } -}; static struct usb_driver cxusb_driver = { .name = "dvb_usb_cxusb",
James Hutchinson
Tested-byHi Jan,
I've been running for a couple of weeks now with your two patches applied:
1) dvbsky: add MyGica T230
2) remove t230 from cxusb
Everything has been working perfectly - the checksum errors when scanning muxes have gone, and streaming has been working nicely.
Regards,
James
Quoted 251 lines · James Hutchinson
Hi Jan,
My initial testing of your two patches to move the T230 to the dvbsky module looks good so far.
I'm testing on an 8th Gen NUC (8i3BEH) 16GB RAM, 2 x MyGica T230 T2 USB tuners, and 2 x DVBSky S960 S2 tuners.
This machine is running Debian stretch with the Debian 4.19.37 backport kernel (incl. your two patches to move the T230 to the dvbsky module).
I have a test script that performs 200x consecutive tvheadend network scans... This was executed against the UK Freeview network (6 muxes) =~1,200 tuning requests. This took a couple of hours, but not a single checksum error.
I moved onto streaming various channels and didn't have any problems so far. I only noted a couple of minor picture disturbances (continuity counter errors) when i tried to record two HD channels whilst watching a 3rd on the same mux. I'm not sure whether this was pushing things too far, and would like to carry out similar tests on a known working 4.9.x kernel.
I'll do more testing over the next couple of weeks and report back.
Also adding Thomas who has the same issue with the T230 tuner and bisected to issue to the same problematic commit as me.
Regards,
James.Quoted 215 lines · Jan Pieter van Woerkom
remove t230 from cxusb
Signed-off-by Jan Pieter van Woerkom <[email protected]>---
diff -rua/drivers/media/usb/dvb-usb/cxusb.cb/drivers/media/usb/dvb-usb/cxusb.cdrivers/media/usb/dvb-usb/cxusb.c 2019-07-22 17:34:51.550698820 +0200 renamed from drivers/media/usb/dvb-usb/cxusb.c 2019-07-08 00:41:56.000000000 +0200 +0
-158@@ -369,26 +369,6 @@ return 0; } -static int cxusb_read_status(struct dvb_frontend *fe, - enum fe_status *status) -{ - struct dvb_usb_adapter *adap = (struct dvb_usb_adapter *)fe->dvb->priv; - struct cxusb_state *state = (struct cxusb_state *)adap->dev->priv; - int ret; - - ret = state->fe_read_status(fe, status); - - /* it need resync slave fifo when signal change from unlock to lock.*/ - if ((*status & FE_HAS_LOCK) && (!state->last_lock)) { - mutex_lock(&state->stream_mutex); - cxusb_streaming_ctrl(adap, 1); - mutex_unlock(&state->stream_mutex); - } - - state->last_lock = (*status & FE_HAS_LOCK) ? 1 : 0; - return ret; -} - static void cxusb_d680_dmb_drain_message(struct dvb_usb_device *d) { int ep = d->props.generic_bulk_ctrl_endpoint;@@ -1164,83 +1144,6 @@ return 0; } -static int cxusb_mygica_t230_frontend_attach(struct dvb_usb_adapter *adap) -{ - struct dvb_usb_device *d = adap->dev; - struct cxusb_state *st = d->priv; - struct i2c_adapter *adapter; - struct i2c_client *client_demod; - struct i2c_client *client_tuner; - struct i2c_board_info info; - struct si2168_config si2168_config; - struct si2157_config si2157_config; - - /* Select required USB configuration */ - if (usb_set_interface(d->udev, 0, 0) < 0) - err("set interface failed"); - - /* Unblock all USB pipes */ - usb_clear_halt(d->udev, - usb_sndbulkpipe(d->udev, d->props.generic_bulk_ctrl_endpoint)); - usb_clear_halt(d->udev, - usb_rcvbulkpipe(d->udev, d->props.generic_bulk_ctrl_endpoint)); - usb_clear_halt(d->udev, - usb_rcvbulkpipe(d->udev, d->props.adapter[0].fe[0].stream.endpoint)); - - /* attach frontend */ - si2168_config.i2c_adapter = &adapter; - si2168_config.fe = &adap->fe_adap[0].fe; - si2168_config.ts_mode = SI2168_TS_PARALLEL; - si2168_config.ts_clock_inv = 1; - memset(&info, 0, sizeof(struct i2c_board_info)); - strscpy(info.type, "si2168", I2C_NAME_SIZE); - info.addr = 0x64; - info.platform_data = &si2168_config; - request_module(info.type); - client_demod = i2c_new_device(&d->i2c_adap, &info); - if (client_demod == NULL || client_demod->dev.driver == NULL) - return -ENODEV; - - if (!try_module_get(client_demod->dev.driver->owner)) { - i2c_unregister_device(client_demod); - return -ENODEV; - } - - st->i2c_client_demod = client_demod; - - /* attach tuner */ - memset(&si2157_config, 0, sizeof(si2157_config)); - si2157_config.fe = adap->fe_adap[0].fe; - si2157_config.if_port = 1; - memset(&info, 0, sizeof(struct i2c_board_info)); - strscpy(info.type, "si2157", I2C_NAME_SIZE); - info.addr = 0x60; - info.platform_data = &si2157_config; - request_module(info.type); - client_tuner = i2c_new_device(adapter, &info); - if (client_tuner == NULL || client_tuner->dev.driver == NULL) { - module_put(client_demod->dev.driver->owner); - i2c_unregister_device(client_demod); - return -ENODEV; - } - if (!try_module_get(client_tuner->dev.driver->owner)) { - i2c_unregister_device(client_tuner); - module_put(client_demod->dev.driver->owner); - i2c_unregister_device(client_demod); - return -ENODEV; - } - - st->i2c_client_tuner = client_tuner; - - /* hook fe: need to resync the slave fifo when signal locks. */ - mutex_init(&st->stream_mutex); - st->last_lock = 0; - st->fe_read_status = adap->fe_adap[0].fe->ops.read_status; - adap->fe_adap[0].fe->ops.read_status = cxusb_read_status; - - return 0; -} - /* * DViCO has shipped two devices with the same USB ID, but only one of them * needs a firmware download. Check the device class details to see if they@@ -1322,7 +1225,6 @@ static struct dvb_usb_device_properties cxusb_aver_a868r_properties; static struct dvb_usb_device_properties cxusb_d680_dmb_properties; static struct dvb_usb_device_properties cxusb_mygica_d689_properties; -static struct dvb_usb_device_properties cxusb_mygica_t230_properties; static int cxusb_probe(struct usb_interface *intf, const struct usb_device_id *id)@@ -1353,8 +1255,6 @@ THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, &cxusb_mygica_d689_properties, THIS_MODULE, NULL, adapter_nr) || - 0 == dvb_usb_device_init(intf, &cxusb_mygica_t230_properties, - THIS_MODULE, NULL, adapter_nr) || 0) return 0;@@ -1405,7 +1305,6 @@ DVICO_BLUEBIRD_DUAL_4_REV_2, CONEXANT_D680_DMB, MYGICA_D689, - MYGICA_T230, NR__cxusb_table_index };@@ -1470,9 +1369,6 @@ [MYGICA_D689] = { USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_D689) }, - [MYGICA_T230] = { - USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230) - }, {} /* Terminating entry */ }; MODULE_DEVICE_TABLE (usb, cxusb_table);@@ -2128,60 +2024,6 @@ }, } }; - -static struct dvb_usb_device_properties cxusb_mygica_t230_properties = { - .caps = DVB_USB_IS_AN_I2C_ADAPTER, - - .usb_ctrl = CYPRESS_FX2, - - .size_of_priv = sizeof(struct cxusb_state), - - .num_adapters = 1, - .adapter = { - { - .num_frontends = 1, - .fe = {{ - .streaming_ctrl = cxusb_streaming_ctrl, - .frontend_attach = cxusb_mygica_t230_frontend_attach, - - /* parameter for the MPEG2-data transfer */ - .stream = { - .type = USB_BULK, - .count = 5, - .endpoint = 0x02, - .u = { - .bulk = { - .buffersize = 8192, - } - } - }, - } }, - }, - }, - - .power_ctrl = cxusb_d680_dmb_power_ctrl, - - .i2c_algo = &cxusb_i2c_algo, - - .generic_bulk_ctrl_endpoint = 0x01, - - .rc.core = { - .rc_interval = 100, - .rc_codes = RC_MAP_D680_DMB, - .module_name = KBUILD_MODNAME, - .rc_query = cxusb_d680_dmb_rc_query, - .allowed_protos = RC_PROTO_BIT_UNKNOWN, - }, - - .num_device_descs = 1, - .devices = { - { - "Mygica T230 DVB-T/T2/C", - { NULL }, - { &cxusb_table[MYGICA_T230], NULL }, - }, - } -}; static struct usb_driver cxusb_driver = { .name = "dvb_usb_cxusb",
James Hutchinson
Tested-byHi Jan,
I've been running for a couple of weeks now with your two patches applied:
1) dvbsky: add MyGica T230
2) remove t230 from cxusb
Everything has been working perfectly - the checksum errors when scanning muxes have gone, and streaming has been working nicely.
Regards,
James
Quoted 41 lines · Jan Pieter van Woerkom
dvbsky: add MyGica T230.
Moved from cxusb driver as that driver can't handle FX2 FIFO issue.Signed-off-by Jan Pieter van Woerkom <[email protected]>---
diff -rua/drivers/media/usb/dvb-usb-v2/dvbsky.cb/drivers/media/usb/dvb-usb-v2/dvbsky.cdrivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-19 17:50:54.671341146 +0200 renamed from drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-08 00:41:56.000000000 +0200 +13
-3@@ -561,11 +561,18 @@ /* attach tuner */ si2157_config.fe = adap->fe[0]; - si2157_config.if_port = 0; - - state->i2c_client_tuner = dvb_module_probe("si2157", "si2141", + if (le16_to_cpu(d->udev->descriptor.idProduct) == USB_PID_MYGICA_T230) { + si2157_config.if_port = 1; + state->i2c_client_tuner = dvb_module_probe("si2157", NULL, + i2c_adapter, + 0x60, &si2157_config); + } + else { + si2157_config.if_port = 0; + state->i2c_client_tuner = dvb_module_probe("si2157", "si2141", i2c_adapter, 0x60, &si2157_config); + } if (!state->i2c_client_tuner) { dvb_module_release(state->i2c_client_demod); return -ENODEV;@@ -787,6 +794,9 @@ { DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_S2_R4, &dvbsky_s960_props, "Terratec Cinergy S2 Rev.4", RC_MAP_DVBSKY) }, + { DVB_USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230, + &mygica_t230c_props, "MyGica Mini DVB-T2 USB Stick T230", + RC_MAP_TOTAL_MEDIA_IN_HAND_02) }, { DVB_USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230C, &mygica_t230c_props, "MyGica Mini DVB-T2 USB Stick T230C", RC_MAP_TOTAL_MEDIA_IN_HAND_02) },
Thanks James, my tests on both DVB-T and DVB-C all went OK.
So, with the t230 driver in cxusb broken for one hw version of the device and both hw versions now working fine in dvbsky & the driver in cxusb does not crash itself anymore (did you test that, James?) & everybody agrees I think this move to dvbsky should be done.
Sean: some hunks from the 'remove from cxusb' patch won't apply to linux-5.3 , because of the recent addition of the analogue driver code to cxusb. So I now have 2 different 'remove from cxusb' patches. How do I proceed with that?
[one more remark below]
Quoted 26 lines · James Hutchinson
Hi Jan,
I've been running for a couple of weeks now with your two patches applied:
1) dvbsky: add MyGica T230
2) remove t230 from cxusbEverything has been working perfectly - the checksum errors when scanning muxes have gone, and streaming has been working nicely.
Tested-by James Hutchinson <[email protected]>Regards,
JamesQuoted 10 lines · Jan Pieter van Woerkom
dvbsky: add MyGica T230.
Moved from cxusb driver as that driver can't handle FX2 FIFO issue.Signed-off-by Jan Pieter van Woerkom <[email protected]>---
diff -rua/drivers/media/usb/dvb-usb-v2/dvbsky.cb/drivers/media/usb/dvb-usb-v2/dvbsky.cdrivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-19 17:50:54.671341146 +0200 renamed from drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-08 00:41:56.000000000 +0200 +0
-0@@ -561,11 +561,18 @@
Quoted 12 lines
drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-19 17:50:54.671341146 +0200 line 570
Quoted 12 lines
drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-19 17:50:54.671341146 +0200 renamed from drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-08 00:41:56.000000000 +0200 +7
-3/* attach tuner */ si2157_config.fe = adap->fe[0]; - si2157_config.if_port = 0; - - state->i2c_client_tuner = dvb_module_probe("si2157", "si2141", + if (le16_to_cpu(d->udev->descriptor.idProduct) == USB_PID_MYGICA_T230) { + si2157_config.if_port = 1; + state->i2c_client_tuner = dvb_module_probe("si2157", NULL, + i2c_adapter, + 0x60, &si2157_config); + } + else {
Coding style: those last 2 lines should be:
} else {
Quoted 10 lines
Quoted 10 lines
drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-19 17:50:54.671341146 +0200 renamed from drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-08 00:41:56.000000000 +0200 +3
-0+ si2157_config.if_port = 0; + state->i2c_client_tuner = dvb_module_probe("si2157", "si2141", i2c_adapter, 0x60, &si2157_config); + } if (!state->i2c_client_tuner) { dvb_module_release(state->i2c_client_demod); return -ENODEV;@@ -787,6 +794,9 @@ { DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_S2_R4,
Quoted 8 lines
drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-19 17:50:54.671341146 +0200 line 802
Quoted 8 lines
drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-19 17:50:54.671341146 +0200 renamed from drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-08 00:41:56.000000000 +0200 +3
-0&dvbsky_s960_props, "Terratec Cinergy S2 Rev.4", RC_MAP_DVBSKY) }, + { DVB_USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230, + &mygica_t230c_props, "MyGica Mini DVB-T2 USB Stick T230", + RC_MAP_TOTAL_MEDIA_IN_HAND_02) }, { DVB_USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230C, &mygica_t230c_props, "MyGica Mini DVB-T2 USB Stick T230C", RC_MAP_TOTAL_MEDIA_IN_HAND_02) },
Cheers,
Jan Pieter.
Hi JP,
Quoted 8 lines · JP
Thanks James, my tests on both DVB-T and DVB-C all went OK.
So, with the t230 driver in cxusb broken for one hw version of the device and both hw versions now working fine in dvbsky & the driver in cxusb does not crash itself anymore (did you test that, James?) & everybody agrees I think this move to dvbsky should be done.
Quoted 4 lines
Sean: some hunks from the 'remove from cxusb' patch won't apply to linux-5.3 , because of the recent addition of the analogue driver code to cxusb. So I now have 2 different 'remove from cxusb' patches. How do I proceed with that?
Would it be possible to submit new patches which apply? The testing is great (thanks James!) so should be good for v5.4 if we have patches on time.
Thanks,
Sean
Quoted 64 lines
[one more remark below]
Quoted 26 lines · James Hutchinson
Hi Jan,
I've been running for a couple of weeks now with your two patches applied:
1) dvbsky: add MyGica T230
2) remove t230 from cxusbEverything has been working perfectly - the checksum errors when scanning muxes have gone, and streaming has been working nicely.
Tested-by James Hutchinson <[email protected]>Regards,
JamesQuoted 10 lines · Jan Pieter van Woerkom
dvbsky: add MyGica T230.
Moved from cxusb driver as that driver can't handle FX2 FIFO issue.Signed-off-by Jan Pieter van Woerkom <[email protected]>---
diff -rua/drivers/media/usb/dvb-usb-v2/dvbsky.cb/drivers/media/usb/dvb-usb-v2/dvbsky.cdrivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-19 17:50:54.671341146 +0200 renamed from drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-08 00:41:56.000000000 +0200 +0
-0@@ -561,11 +561,18 @@Quoted 12 lines
drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-19 17:50:54.671341146 +0200 line 570
Quoted 12 lines
drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-19 17:50:54.671341146 +0200 renamed from drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-08 00:41:56.000000000 +0200 +7
-3/* attach tuner */ si2157_config.fe = adap->fe[0]; - si2157_config.if_port = 0; - - state->i2c_client_tuner = dvb_module_probe("si2157", "si2141", + if (le16_to_cpu(d->udev->descriptor.idProduct) == USB_PID_MYGICA_T230) { + si2157_config.if_port = 1; + state->i2c_client_tuner = dvb_module_probe("si2157", NULL, + i2c_adapter, + 0x60, &si2157_config); + } + else {Coding style: those last 2 lines should be:
} else {Quoted 10 lines
Quoted 10 lines
drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-19 17:50:54.671341146 +0200 renamed from drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-08 00:41:56.000000000 +0200 +3
-0+ si2157_config.if_port = 0; + state->i2c_client_tuner = dvb_module_probe("si2157", "si2141", i2c_adapter, 0x60, &si2157_config); + } if (!state->i2c_client_tuner) { dvb_module_release(state->i2c_client_demod); return -ENODEV;@@ -787,6 +794,9 @@ { DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_S2_R4,Quoted 8 lines
drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-19 17:50:54.671341146 +0200 line 802
Quoted 8 lines
drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-19 17:50:54.671341146 +0200 renamed from drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-08 00:41:56.000000000 +0200 +3
-0&dvbsky_s960_props, "Terratec Cinergy S2 Rev.4", RC_MAP_DVBSKY) }, + { DVB_USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230, + &mygica_t230c_props, "MyGica Mini DVB-T2 USB Stick T230", + RC_MAP_TOTAL_MEDIA_IN_HAND_02) }, { DVB_USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230C, &mygica_t230c_props, "MyGica Mini DVB-T2 USB Stick T230C", RC_MAP_TOTAL_MEDIA_IN_HAND_02) },Cheers,
Jan Pieter.
cover media: dvb-usb: move T230 to dvbsky
media: dvb-usb: move t230 driver from cxusb to dvbsky
This solves (amongst others) the 'T230 dvb-t2 data corruption since commit 5fa8815' problem.
The 'remove from cxusb' patch has 2 versions: the a version applies to linux-5.2 and earlier, the b version applies to linux 5.3-rc4 (and possibly others). Use one or the other.
Thank you very much! :-)
Re: [PATCH 1/2] media: dvb-usb: move T230 to dvbsky
add t230 to dvbsky
---
drivers/media/usb/dvb-usb-v2/dvbsky.c +12 -3
@@ -561,11 +561,18 @@/* attach tuner */ si2157_config.fe = adap->fe[0 ]; - si2157_config.if_port =0 ; - - state->i2c_client_tuner =dvb_module_probe ("si2157" ,"si2141" , +if (le16_to_cpu (d->udev->descriptor.idProduct) ==USB_PID_MYGICA_T230 ) { + si2157_config.if_port =1 ; + state->i2c_client_tuner =dvb_module_probe ("si2157" ,NULL , + i2c_adapter, +0x60 , &si2157_config); + }else { + si2157_config.if_port =0 ; + state->i2c_client_tuner =dvb_module_probe ("si2157" ,"si2141" , i2c_adapter,0x60 , &si2157_config); + }if (!state->i2c_client_tuner) {dvb_module_release (state->i2c_client_demod);return -ENODEV ;
@@ -787,6 +794,9 @@ {DVB_USB_DEVICE (USB_VID_TERRATEC ,USB_PID_TERRATEC_CINERGY_S2_R4 , &dvbsky_s960_props,"Terratec Cinergy S2 Rev.4" , RC_MAP_DVBSKY) }, + { DVB_USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230, + &mygica_t230c_props,"MyGica Mini DVB-T2 USB Stick T230" , + RC_MAP_TOTAL_MEDIA_IN_HAND_02) }, { DVB_USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230C, &mygica_t230c_props,"MyGica Mini DVB-T2 USB Stick T230C" , RC_MAP_TOTAL_MEDIA_IN_HAND_02) },
Re: [PATCH 2a/2] media: dvb-usb: move T230 to dvbsky
In reply to Jan Pieter van Woerkomremove t230 from cxusb (for linux <= 5.2)
---
drivers/media/usb/dvb-usb/cxusb.c +0 -158
@@ -369,26 +369,6 @@return 0 ; } -static int cxusb_read_status (struct dvb_frontend *fe, -enum fe_status *status) -{ -struct dvb_usb_adapter *adap = (struct dvb_usb_adapter *)fe->dvb->priv; -struct cxusb_state *state = (struct cxusb_state *)adap->dev->priv; -int ret; - - ret = state->fe_read_status (fe, status); - -/* it need resync slave fifo when signal change from unlock to lock.*/ -if ((*status &FE_HAS_LOCK ) && (!state->last_lock)) { -mutex_lock (&state->stream_mutex); -cxusb_streaming_ctrl (adap,1 ); -mutex_unlock (&state->stream_mutex); - } - - state->last_lock = (*status &FE_HAS_LOCK ) ?1 :0 ; -return ret; -} -static void cxusb_d680_dmb_drain_message (struct dvb_usb_device *d) {int ep = d->props.generic_bulk_ctrl_endpoint;
@@ -1164,83 +1144,6 @@return 0 ; } -static int cxusb_mygica_t230_frontend_attach (struct dvb_usb_adapter *adap) -{ -struct dvb_usb_device *d = adap->dev; -struct cxusb_state *st = d->priv; -struct i2c_adapter *adapter; -struct i2c_client *client_demod; -struct i2c_client *client_tuner; -struct i2c_board_info info; -struct si2168_config si2168_config; -struct si2157_config si2157_config; - -/* Select required USB configuration */ -if (usb_set_interface (d->udev,0 ,0 ) <0 ) -err ("set interface failed" ); - -/* Unblock all USB pipes */ -usb_clear_halt (d->udev, -usb_sndbulkpipe (d->udev, d->props.generic_bulk_ctrl_endpoint)); -usb_clear_halt (d->udev, -usb_rcvbulkpipe (d->udev, d->props.generic_bulk_ctrl_endpoint)); -usb_clear_halt (d->udev, -usb_rcvbulkpipe (d->udev, d->props.adapter[0 ].fe[0 ].stream.endpoint)); - -/* attach frontend */ - si2168_config.i2c_adapter = &adapter; - si2168_config.fe = &adap->fe_adap[0 ].fe; - si2168_config.ts_mode =SI2168_TS_PARALLEL ; - si2168_config.ts_clock_inv =1 ; -memset (&info,0 ,sizeof (struct i2c_board_info )); -strscpy (info.type,"si2168" ,I2C_NAME_SIZE ); - info.addr =0x64 ; - info.platform_data = &si2168_config; -request_module (info.type); - client_demod =i2c_new_device (&d->i2c_adap, &info); -if (client_demod ==NULL || client_demod->dev.driver ==NULL ) -return -ENODEV ; - -if (!try_module_get (client_demod->dev.driver->owner)) { -i2c_unregister_device (client_demod); -return -ENODEV ; - } - - st->i2c_client_demod = client_demod; - -/* attach tuner */ -memset (&si2157_config,0 ,sizeof (si2157_config)); - si2157_config.fe = adap->fe_adap[0 ].fe; - si2157_config.if_port =1 ; -memset (&info,0 ,sizeof (struct i2c_board_info )); -strscpy (info.type,"si2157" ,I2C_NAME_SIZE ); - info.addr =0x60 ; - info.platform_data = &si2157_config; -request_module (info.type); - client_tuner =i2c_new_device (adapter, &info); -if (client_tuner ==NULL || client_tuner->dev.driver ==NULL ) { -module_put (client_demod->dev.driver->owner); -i2c_unregister_device (client_demod); -return -ENODEV ; - } -if (!try_module_get (client_tuner->dev.driver->owner)) { -i2c_unregister_device (client_tuner); -module_put (client_demod->dev.driver->owner); -i2c_unregister_device (client_demod); -return -ENODEV ; - } - - st->i2c_client_tuner = client_tuner; - -/* hook fe: need to resync the slave fifo when signal locks. */ -mutex_init (&st->stream_mutex); - st->last_lock =0 ; - st->fe_read_status = adap->fe_adap[0 ].fe->ops.read_status; - adap->fe_adap[0 ].fe->ops.read_status = cxusb_read_status; - -return 0 ; -} -/* * DViCO has shipped two devices with the same USB ID, but only one of them * needs a firmware download. Check the device class details to see if they
@@ -1322,7 +1225,6 @@static struct dvb_usb_device_properties cxusb_aver_a868r_properties;static struct dvb_usb_device_properties cxusb_d680_dmb_properties;static struct dvb_usb_device_properties cxusb_mygica_d689_properties; -static struct dvb_usb_device_properties cxusb_mygica_t230_properties;static int cxusb_probe (struct usb_interface *intf,const struct usb_device_id *id)
@@ -1353,8 +1255,6 @@ THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, &cxusb_mygica_d689_properties, THIS_MODULE, NULL, adapter_nr) || - 0 == dvb_usb_device_init(intf, &cxusb_mygica_t230_properties, - THIS_MODULE, NULL, adapter_nr) || 0)return 0 ;
@@ -1405,7 +1305,6 @@DVICO_BLUEBIRD_DUAL_4_REV_2 ,CONEXANT_D680_DMB ,MYGICA_D689 , -MYGICA_T230 , NR__cxusb_table_index };
@@ -1470,9 +1369,6 @@ [MYGICA_D689 ] = {USB_DEVICE (USB_VID_CONEXANT ,USB_PID_MYGICA_D689 ) }, - [MYGICA_T230 ] = { -USB_DEVICE (USB_VID_CONEXANT ,USB_PID_MYGICA_T230 ) - }, {} /* Terminating entry */ };MODULE_DEVICE_TABLE (usb ,cxusb_table );
@@ -2128,60 +2024,6 @@ }, } }; - -static struct dvb_usb_device_properties cxusb_mygica_t230_properties = { - .caps =DVB_USB_IS_AN_I2C_ADAPTER , - - .usb_ctrl =CYPRESS_FX2 , - - .size_of_priv =sizeof (struct cxusb_state ), - - .num_adapters =1 , - .adapter = { - { - .num_frontends =1 , - .fe = {{ - .streaming_ctrl = cxusb_streaming_ctrl, - .frontend_attach = cxusb_mygica_t230_frontend_attach, - -/* parameter for the MPEG2-data transfer */ - .stream = { - .type =USB_BULK , - .count =5 , - .endpoint =0x02 , - .u = { - .bulk = { - .buffersize =8192 , - } - } - }, - } }, - }, - }, - - .power_ctrl = cxusb_d680_dmb_power_ctrl, - - .i2c_algo = &cxusb_i2c_algo, - - .generic_bulk_ctrl_endpoint =0x01 , - - .rc.core = { - .rc_interval =100 , - .rc_codes =RC_MAP_D680_DMB , - .module_name =KBUILD_MODNAME , - .rc_query = cxusb_d680_dmb_rc_query, - .allowed_protos =RC_PROTO_BIT_UNKNOWN , - }, - - .num_device_descs =1 , - .devices = { - { -"Mygica T230 DVB-T/T2/C" , - {NULL }, - { &cxusb_table[MYGICA_T230 ],NULL }, - }, - } -};static struct usb_driver cxusb_driver = { .name ="dvb_usb_cxusb" ,
Re: [PATCH 2b/2] media: dvb-usb: move T230 to dvbsky
In reply to Jan Pieter van Woerkomremove t230 from cxusb (for linux >= 5.3)
---
drivers/media/usb/dvb-usb/cxusb.c +0 -161
@@ -78,7 +78,6 @@DVICO_BLUEBIRD_DUAL_4_REV_2 ,CONEXANT_D680_DMB ,MYGICA_D689 , -MYGICA_T230 , NR__cxusb_table_index };
@@ -456,26 +455,6 @@return 0 ; } -static int cxusb_read_status (struct dvb_frontend *fe, -enum fe_status *status) -{ -struct dvb_usb_adapter *adap = (struct dvb_usb_adapter *)fe->dvb->priv; -struct cxusb_state *state = (struct cxusb_state *)adap->dev->priv; -int ret; - - ret = state->fe_read_status (fe, status); - -/* it need resync slave fifo when signal change from unlock to lock.*/ -if ((*status &FE_HAS_LOCK ) && (!state->last_lock)) { -mutex_lock (&state->stream_mutex); -cxusb_streaming_ctrl (adap,1 ); -mutex_unlock (&state->stream_mutex); - } - - state->last_lock = (*status &FE_HAS_LOCK ) ?1 :0 ; -return ret; -} -static void cxusb_d680_dmb_drain_message (struct dvb_usb_device *d) {int ep = d->props.generic_bulk_ctrl_endpoint;
@@ -1374,86 +1353,6 @@return 0 ; } -static int cxusb_mygica_t230_frontend_attach (struct dvb_usb_adapter *adap) -{ -struct dvb_usb_device *d = adap->dev; -struct cxusb_state *st = d->priv; -struct i2c_adapter *adapter; -struct i2c_client *client_demod; -struct i2c_client *client_tuner; -struct i2c_board_info info; -struct si2168_config si2168_config; -struct si2157_config si2157_config; - -/* Select required USB configuration */ -if (usb_set_interface (d->udev,0 ,0 ) <0 ) -err ("set interface failed" ); - -/* Unblock all USB pipes */ -usb_clear_halt (d->udev, -usb_sndbulkpipe (d->udev, - d->props.generic_bulk_ctrl_endpoint)); -usb_clear_halt (d->udev, -usb_rcvbulkpipe (d->udev, - d->props.generic_bulk_ctrl_endpoint)); -usb_clear_halt (d->udev, -usb_rcvbulkpipe (d->udev, - d->props.adapter[0 ].fe[0 ].stream.endpoint)); - -/* attach frontend */ - si2168_config.i2c_adapter = &adapter; - si2168_config.fe = &adap->fe_adap[0 ].fe; - si2168_config.ts_mode =SI2168_TS_PARALLEL ; - si2168_config.ts_clock_inv =1 ; -memset (&info,0 ,sizeof (struct i2c_board_info )); -strscpy (info.type,"si2168" ,I2C_NAME_SIZE ); - info.addr =0x64 ; - info.platform_data = &si2168_config; -request_module (info.type); - client_demod =i2c_new_device (&d->i2c_adap, &info); -if (!client_demod || !client_demod->dev.driver) -return -ENODEV ; - -if (!try_module_get (client_demod->dev.driver->owner)) { -i2c_unregister_device (client_demod); -return -ENODEV ; - } - - st->i2c_client_demod = client_demod; - -/* attach tuner */ -memset (&si2157_config,0 ,sizeof (si2157_config)); - si2157_config.fe = adap->fe_adap[0 ].fe; - si2157_config.if_port =1 ; -memset (&info,0 ,sizeof (struct i2c_board_info )); -strscpy (info.type,"si2157" ,I2C_NAME_SIZE ); - info.addr =0x60 ; - info.platform_data = &si2157_config; -request_module (info.type); - client_tuner =i2c_new_device (adapter, &info); -if (!client_tuner || !client_tuner->dev.driver) { -module_put (client_demod->dev.driver->owner); -i2c_unregister_device (client_demod); -return -ENODEV ; - } -if (!try_module_get (client_tuner->dev.driver->owner)) { -i2c_unregister_device (client_tuner); -module_put (client_demod->dev.driver->owner); -i2c_unregister_device (client_demod); -return -ENODEV ; - } - - st->i2c_client_tuner = client_tuner; - -/* hook fe: need to resync the slave fifo when signal locks. */ -mutex_init (&st->stream_mutex); - st->last_lock =0 ; - st->fe_read_status = adap->fe_adap[0 ].fe->ops.read_status; - adap->fe_adap[0 ].fe->ops.read_status = cxusb_read_status; - -return 0 ; -} -/* * DViCO has shipped two devices with the same USB ID, but only one of them * needs a firmware download. Check the device class details to see if they
@@ -1633,7 +1532,6 @@static struct dvb_usb_device_properties cxusb_aver_a868r_properties;static struct dvb_usb_device_properties cxusb_d680_dmb_properties;static struct dvb_usb_device_properties cxusb_mygica_d689_properties; -static struct dvb_usb_device_properties cxusb_mygica_t230_properties;static int cxusb_medion_priv_init (struct dvb_usb_device *dvbdev) {
@@ -1759,8 +1657,6 @@ THIS_MODULE, NULL, adapter_nr) || !dvb_usb_device_init(intf, &cxusb_mygica_d689_properties, THIS_MODULE, NULL, adapter_nr) || - !dvb_usb_device_init(intf, &cxusb_mygica_t230_properties, - THIS_MODULE, NULL, adapter_nr) || 0)return 0 ;
@@ -1862,9 +1758,6 @@ [MYGICA_D689 ] = {USB_DEVICE (USB_VID_CONEXANT ,USB_PID_MYGICA_D689 ) }, - [MYGICA_T230 ] = { -USB_DEVICE (USB_VID_CONEXANT ,USB_PID_MYGICA_T230 ) - }, {} /* Terminating entry */ };MODULE_DEVICE_TABLE (usb ,cxusb_table );
@@ -2534,60 +2427,6 @@ }, } }; - -static struct dvb_usb_device_properties cxusb_mygica_t230_properties = { - .caps =DVB_USB_IS_AN_I2C_ADAPTER , - - .usb_ctrl =CYPRESS_FX2 , - - .size_of_priv =sizeof (struct cxusb_state ), - - .num_adapters =1 , - .adapter = { - { - .num_frontends =1 , - .fe = {{ - .streaming_ctrl = cxusb_streaming_ctrl, - .frontend_attach = cxusb_mygica_t230_frontend_attach, - -/* parameter for the MPEG2-data transfer */ - .stream = { - .type =USB_BULK , - .count =5 , - .endpoint =0x02 , - .u = { - .bulk = { - .buffersize =8192 , - } - } - }, - } }, - }, - }, - - .power_ctrl = cxusb_d680_dmb_power_ctrl, - - .i2c_algo = &cxusb_i2c_algo, - - .generic_bulk_ctrl_endpoint =0x01 , - - .rc.core = { - .rc_interval =100 , - .rc_codes =RC_MAP_D680_DMB , - .module_name =KBUILD_MODNAME , - .rc_query = cxusb_d680_dmb_rc_query, - .allowed_protos =RC_PROTO_BIT_UNKNOWN , - }, - - .num_device_descs =1 , - .devices = { - { -"Mygica T230 DVB-T/T2/C" , - {NULL }, - { &cxusb_table[MYGICA_T230 ],NULL }, - }, - } -};static struct usb_driver cxusb_driver = { .name ="dvb_usb_cxusb" ,
Hi JP, James,
Quoted 7 lines · JP
Thanks James, my tests on both DVB-T and DVB-C all went OK.
So, with the t230 driver in cxusb broken for one hw version of the device and both hw versions now working fine in dvbsky & the driver in cxusb does not crash itself anymore (did you test that, James?) & everybody agrees I think this move to dvbsky should be done.
So I think the commmit message should say what the two hardware revisions are and what the FX2 FIFO issue is exactly.
Would you be able to provide some words for the commit message which says what the issue with the existing driver (FX2 FIFO, anything else), what hardware revisions were tested (maybe what they look like) and what was exactly tested (and for whole long).
Thanks
Sean
Quoted 68 lines
Sean: some hunks from the 'remove from cxusb' patch won't apply to linux-5.3 , because of the recent addition of the analogue driver code to cxusb. So I now have 2 different 'remove from cxusb' patches. How do I proceed with that?
[one more remark below]
Quoted 26 lines · James Hutchinson
Hi Jan,
I've been running for a couple of weeks now with your two patches applied:
1) dvbsky: add MyGica T230
2) remove t230 from cxusbEverything has been working perfectly - the checksum errors when scanning muxes have gone, and streaming has been working nicely.
Tested-by James Hutchinson <[email protected]>Regards,
JamesQuoted 10 lines · Jan Pieter van Woerkom
dvbsky: add MyGica T230.
Moved from cxusb driver as that driver can't handle FX2 FIFO issue.Signed-off-by Jan Pieter van Woerkom <[email protected]>---
diff -rua/drivers/media/usb/dvb-usb-v2/dvbsky.cb/drivers/media/usb/dvb-usb-v2/dvbsky.cdrivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-19 17:50:54.671341146 +0200 renamed from drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-08 00:41:56.000000000 +0200 +0
-0@@ -561,11 +561,18 @@Quoted 12 lines
drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-19 17:50:54.671341146 +0200 line 570
Quoted 12 lines
drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-19 17:50:54.671341146 +0200 renamed from drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-08 00:41:56.000000000 +0200 +7
-3/* attach tuner */ si2157_config.fe = adap->fe[0]; - si2157_config.if_port = 0; - - state->i2c_client_tuner = dvb_module_probe("si2157", "si2141", + if (le16_to_cpu(d->udev->descriptor.idProduct) == USB_PID_MYGICA_T230) { + si2157_config.if_port = 1; + state->i2c_client_tuner = dvb_module_probe("si2157", NULL, + i2c_adapter, + 0x60, &si2157_config); + } + else {Coding style: those last 2 lines should be:
} else {Quoted 10 lines
Quoted 10 lines
drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-19 17:50:54.671341146 +0200 renamed from drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-08 00:41:56.000000000 +0200 +3
-0+ si2157_config.if_port = 0; + state->i2c_client_tuner = dvb_module_probe("si2157", "si2141", i2c_adapter, 0x60, &si2157_config); + } if (!state->i2c_client_tuner) { dvb_module_release(state->i2c_client_demod); return -ENODEV;@@ -787,6 +794,9 @@ { DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_S2_R4,Quoted 8 lines
drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-19 17:50:54.671341146 +0200 line 802
Quoted 8 lines
drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-19 17:50:54.671341146 +0200 renamed from drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-08 00:41:56.000000000 +0200 +3
-0&dvbsky_s960_props, "Terratec Cinergy S2 Rev.4", RC_MAP_DVBSKY) }, + { DVB_USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230, + &mygica_t230c_props, "MyGica Mini DVB-T2 USB Stick T230", + RC_MAP_TOTAL_MEDIA_IN_HAND_02) }, { DVB_USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230C, &mygica_t230c_props, "MyGica Mini DVB-T2 USB Stick T230C", RC_MAP_TOTAL_MEDIA_IN_HAND_02) },Cheers,
Jan Pieter.
JP
Tested-by James HutchinsonHoi Sean,
Quoted 5 lines · Sean Young
Hi JP, James,
Quoted 2 lines · JP
Thanks James, my tests on both DVB-T and DVB-C all went OK.
Quoted 7 lines
Quoted 5 lines
So, with the t230 driver in cxusb broken for one hw version of the device and both hw versions now working fine in dvbsky & the driver in cxusb does not crash itself anymore (did you test that, James?) & everybody agrees I think this move to dvbsky should be done.
So I think the commmit message should say what the two hardware revisions are and what the FX2 FIFO issue is exactly.
There are no real different hw versions. My mistake. There are simply some receiver units that needed the FIFO fix, and some that did not. Most did not, and some (maybe most or all) of them suffered like the 2 units James has.
The issue was that after lock, the TS FIFO sometimes got overrun and caused a TS error. With commit 5fa8815, the FIF0 was resync'd after each lock. While this fixed the driver for some units, it broke the driver for others.
Quoted 4 lines
Would you be able to provide some words for the commit message which says what the issue with the existing driver (FX2 FIFO, anything else), what hardware revisions were tested (maybe what they look like) and what was exactly tested (and for whole long).
move Mygica T230 driver from cxusb to dvbsky
Fixes (kernel NULL pointer dereference) crash of the cxusb driver when unit is unplugged live from it's USB port. Adds module option to disable the RC.
Fixes buggy 'resync FIF0 after lock' streaming fix that broke the driver for most receiver units.
Tested by patch author. DVB-T/T2/C scan and stream A/V and data 24/7 without any problems on a production machine for several weeks now.
"I've been running for a couple of weeks now" "Everything has been working perfectly - the checksum errors when scanning muxes have gone, and streaming has been working nicely."
Quoted 3 lines
Thanks
Sean
Thank you
Jan Pieter
Quoted 70 lines
Quoted 70 lines
Sean: some hunks from the 'remove from cxusb' patch won't apply to linux-5.3 , because of the recent addition of the analogue driver code to cxusb. So I now have 2 different 'remove from cxusb' patches. How do I proceed with that?
[one more remark below]
Quoted 26 lines · James Hutchinson
Hi Jan,
I've been running for a couple of weeks now with your two patches applied:
1) dvbsky: add MyGica T230
2) remove t230 from cxusbEverything has been working perfectly - the checksum errors when scanning muxes have gone, and streaming has been working nicely.
Tested-by James Hutchinson <[email protected]>Regards,
JamesQuoted 10 lines · Jan Pieter van Woerkom
dvbsky: add MyGica T230.
Moved from cxusb driver as that driver can't handle FX2 FIFO issue.Signed-off-by Jan Pieter van Woerkom <[email protected]>---
diff -rua/drivers/media/usb/dvb-usb-v2/dvbsky.cb/drivers/media/usb/dvb-usb-v2/dvbsky.cdrivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-19 17:50:54.671341146 +0200 renamed from drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-08 00:41:56.000000000 +0200 +0
-0@@ -561,11 +561,18 @@Quoted 12 lines
drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-19 17:50:54.671341146 +0200 line 570
Quoted 12 lines
drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-19 17:50:54.671341146 +0200 renamed from drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-08 00:41:56.000000000 +0200 +7
-3/* attach tuner */ si2157_config.fe = adap->fe[0]; - si2157_config.if_port = 0; - - state->i2c_client_tuner = dvb_module_probe("si2157", "si2141", + if (le16_to_cpu(d->udev->descriptor.idProduct) == USB_PID_MYGICA_T230) { + si2157_config.if_port = 1; + state->i2c_client_tuner = dvb_module_probe("si2157", NULL, + i2c_adapter, + 0x60, &si2157_config); + } + else {Coding style: those last 2 lines should be:
} else {Quoted 10 lines
Quoted 10 lines
drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-19 17:50:54.671341146 +0200 renamed from drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-08 00:41:56.000000000 +0200 +3
-0+ si2157_config.if_port = 0; + state->i2c_client_tuner = dvb_module_probe("si2157", "si2141", i2c_adapter, 0x60, &si2157_config); + } if (!state->i2c_client_tuner) { dvb_module_release(state->i2c_client_demod); return -ENODEV;@@ -787,6 +794,9 @@ { DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_S2_R4,Quoted 8 lines
drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-19 17:50:54.671341146 +0200 line 802
Quoted 8 lines
drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-19 17:50:54.671341146 +0200 renamed from drivers/media/usb/dvb-usb-v2/dvbsky.c 2019-07-08 00:41:56.000000000 +0200 +3
-0&dvbsky_s960_props, "Terratec Cinergy S2 Rev.4", RC_MAP_DVBSKY) }, + { DVB_USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230, + &mygica_t230c_props, "MyGica Mini DVB-T2 USB Stick T230", + RC_MAP_TOTAL_MEDIA_IN_HAND_02) }, { DVB_USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230C, &mygica_t230c_props, "MyGica Mini DVB-T2 USB Stick T230C", RC_MAP_TOTAL_MEDIA_IN_HAND_02) },Cheers,
Jan Pieter.