Skip to contentSkip to conversation

hdpvr: Disable IR receiver by default.

PATCH In review Jeff Hansen 2 participants 3 messages May 14, 2013 – May 24, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hdpvr: Disable IR receiver by default.

All of the firmwares I've tested, including 0x1e, will inevitably crash before recording for even 10 minutes. There must be a race condition of IR RX vs. video-encoding in the firmware, because if you disable IR receiver polling, then the firmware is stable again. I'd guess that most people don't use this feature anyway, so we might as well disable it by default, and warn them that it might be unstable until Hauppauge fixes it in a future firmware.

---
 drivers/media/usb/hdpvr/hdpvr-core.c |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
drivers/media/usb/hdpvr/hdpvr-core.c +11 -5
index 8247c19..3e80202 100644
@@ -53,6 +53,10 @@ static bool boost_audio;
 module_param(boost_audio, bool, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(boost_audio, "boost the audio signal");
 
+int ir_rx_enable;
+module_param(ir_rx_enable, int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(ir_rx_enable, "Enable HDPVR IR receiver (firmware may be unstable)");
+
 
 /* table of devices that work with this driver */
 static struct usb_device_id hdpvr_table[] = {
@@ -394,11 +398,13 @@ static int hdpvr_probe(struct usb_interface *interface,
 		goto error;
 	}
 
-	client = hdpvr_register_ir_rx_i2c(dev);
-	if (!client) {
-		v4l2_err(&dev->v4l2_dev, "i2c IR RX device register failed\n");
-		retval = -ENODEV;
-		goto reg_fail;
+	if (ir_rx_enable) {
+		client = hdpvr_register_ir_rx_i2c(dev);
+		if (!client) {
+			v4l2_err(&dev->v4l2_dev, "i2c IR RX device register failed\n");
+			retval = -ENODEV;
+			goto reg_fail;
+		}
 	}
 
 	client = hdpvr_register_ir_tx_i2c(dev);
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 7 lines · On Tue 14 May 2013 06:44:19 Jeff Hansen wrote:

All of the firmwares I've tested, including 0x1e, will inevitably crash before recording for even 10 minutes. There must be a race condition of IR RX vs. video-encoding in the firmware, because if you disable IR receiver polling, then the firmware is stable again. I'd guess that most people don't use this feature anyway, so we might as well disable it by default, and warn them that it might be unstable until Hauppauge fixes it in a future firmware.

Leonid, have you ever seen this? Can you verify that this happens for you as well?

Regards,

Hans

Quoted 41 lines
---
 drivers/media/usb/hdpvr/hdpvr-core.c |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
drivers/media/usb/hdpvr/hdpvr-core.c +11 -5
index 8247c19..3e80202 100644
@@ -53,6 +53,10 @@ static bool boost_audio;
 module_param(boost_audio, bool, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(boost_audio, "boost the audio signal");
 
+int ir_rx_enable;
+module_param(ir_rx_enable, int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(ir_rx_enable, "Enable HDPVR IR receiver (firmware may be unstable)");
+
 
 /* table of devices that work with this driver */
 static struct usb_device_id hdpvr_table[] = {
@@ -394,11 +398,13 @@ static int hdpvr_probe(struct usb_interface *interface,
 		goto error;
 	}
 
-	client = hdpvr_register_ir_rx_i2c(dev);
-	if (!client) {
-		v4l2_err(&dev->v4l2_dev, "i2c IR RX device register failed\n");
-		retval = -ENODEV;
-		goto reg_fail;
+	if (ir_rx_enable) {
+		client = hdpvr_register_ir_rx_i2c(dev);
+		if (!client) {
+			v4l2_err(&dev->v4l2_dev, "i2c IR RX device register failed\n");
+			retval = -ENODEV;
+			goto reg_fail;
+		}
 	}
 
 	client = hdpvr_register_ir_tx_i2c(dev);
#2 lore raw

Does anyone have any contacts at Hauppauge that could make HD-PVR firmware source available? I have done a little bit of work on Ambarella chips, and I'd be happy to take a look at why the firmware is crashing. My firmware is yet to crash after disabling IR RX.

-Jeff

Quoted 55 lines · Hans Verkuil
Quoted 7 lines · On Tue 14 May 2013 06:44:19 Jeff Hansen wrote:

All of the firmwares I've tested, including 0x1e, will inevitably crash before recording for even 10 minutes. There must be a race condition of IR RX vs. video-encoding in the firmware, because if you disable IR receiver polling, then the firmware is stable again. I'd guess that most people don't use this feature anyway, so we might as well disable it by default, and warn them that it might be unstable until Hauppauge fixes it in a future firmware.

Leonid, have you ever seen this? Can you verify that this happens for you as well?

Regards,

Hans

Quoted 40 lines
---
 drivers/media/usb/hdpvr/hdpvr-core.c |   16 +++++++++++-----
 1 file changed, 11 insertionshau(+), 5 deletions(-)
drivers/media/usb/hdpvr/hdpvr-core.c +11 -5
index 8247c19..3e80202 100644
@@ -53,6 +53,10 @@ static bool boost_audio;
 module_param(boost_audio, bool, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(boost_audio, "boost the audio signal");
 
+int ir_rx_enable;
+module_param(ir_rx_enable, int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(ir_rx_enable, "Enable HDPVR IR receiver (firmware may be unstable)");
+
 
 /* table of devices that work with this driver */
 static struct usb_device_id hdpvr_table[] = {
@@ -394,11 +398,13 @@ static int hdpvr_probe(struct usb_interface *interface,
 		goto error;
 	}
 
-	client = hdpvr_register_ir_rx_i2c(dev);
-	if (!client) {
-		v4l2_err(&dev->v4l2_dev, "i2c IR RX device register failed\n");
-		retval = -ENODEV;
-		goto reg_fail;
+	if (ir_rx_enable) {
+		client = hdpvr_register_ir_rx_i2c(dev);
+		if (!client) {
+			v4l2_err(&dev->v4l2_dev, "i2c IR RX device register failed\n");
+			retval = -ENODEV;
+			goto reg_fail;
+		}
 	}
 
 	client = hdpvr_register_ir_tx_i2c(dev);
Signature · 3 lines
---------------------------------------------------
"If someone's gotta do it, it might as well be me."
                [email protected]