All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: em28xx: fix a regression with HVR-950
@ 2018-03-09 12:21 Mauro Carvalho Chehab
  2018-06-26 20:09 ` Brad Love
  0 siblings, 1 reply; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2018-03-09 12:21 UTC (permalink / raw)
  To: Linux Media Mailing List
  Cc: Mauro Carvalho Chehab, Mauro Carvalho Chehab, Brad Love

Changeset be7fd3c3a8c5 ("media: em28xx: Hauppauge DualHD second tuner
functionality") removed the logic with sets the alternate for the DVB
device. Without setting the right alternate, the device won't be
able to submit URBs, and userspace fails with -EMSGSIZE:

	ERROR     DMX_SET_PES_FILTER failed (PID = 0x2000): 90 Message too long

Tested with Hauppauge HVR-950 model A1C0.

Cc: Brad Love <brad@nextdimension.cc>
Fixes: be7fd3c3a8c5 ("media: em28xx: Hauppauge DualHD second tuner functionality")
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 drivers/media/usb/em28xx/em28xx-dvb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
index a54cb8dc52c9..2ce7de1c7cce 100644
--- a/drivers/media/usb/em28xx/em28xx-dvb.c
+++ b/drivers/media/usb/em28xx/em28xx-dvb.c
@@ -199,6 +199,7 @@ static int em28xx_start_streaming(struct em28xx_dvb *dvb)
 	int rc;
 	struct em28xx_i2c_bus *i2c_bus = dvb->adapter.priv;
 	struct em28xx *dev = i2c_bus->dev;
+	struct usb_device *udev = interface_to_usbdev(dev->intf);
 	int dvb_max_packet_size, packet_multiplier, dvb_alt;
 
 	if (dev->dvb_xfer_bulk) {
@@ -217,6 +218,7 @@ static int em28xx_start_streaming(struct em28xx_dvb *dvb)
 		dvb_alt = dev->dvb_alt_isoc;
 	}
 
+	usb_set_interface(udev, dev->ifnum, dvb_alt);
 	rc = em28xx_set_mode(dev, EM28XX_DIGITAL_MODE);
 	if (rc < 0)
 		return rc;
-- 
2.14.3

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

* Re: [PATCH] media: em28xx: fix a regression with HVR-950
  2018-03-09 12:21 [PATCH] media: em28xx: fix a regression with HVR-950 Mauro Carvalho Chehab
@ 2018-06-26 20:09 ` Brad Love
  2018-06-26 20:23   ` Devin Heitmueller
  0 siblings, 1 reply; 3+ messages in thread
From: Brad Love @ 2018-06-26 20:09 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Linux Media Mailing List
  Cc: Mauro Carvalho Chehab, Brad Love

Hi Mauro,

It turns out this patch breaks DualHD multiple tuner capability. When
alt mode is set in start_streaming it immediately kills the other tuners
stream. Essentially both tuners cannot be used together when this is
applied. I unfortunately don't have a HVR-950 to try and fix the
original regression better. Can you please take another look at this?
Until this is sorted, DualHD are effectively broken.

Cheers,

Brad




On 2018-03-09 06:21, Mauro Carvalho Chehab wrote:
> Changeset be7fd3c3a8c5 ("media: em28xx: Hauppauge DualHD second tuner
> functionality") removed the logic with sets the alternate for the DVB
> device. Without setting the right alternate, the device won't be
> able to submit URBs, and userspace fails with -EMSGSIZE:
>
> 	ERROR     DMX_SET_PES_FILTER failed (PID = 0x2000): 90 Message too long
>
> Tested with Hauppauge HVR-950 model A1C0.
>
> Cc: Brad Love <brad@nextdimension.cc>
> Fixes: be7fd3c3a8c5 ("media: em28xx: Hauppauge DualHD second tuner functionality")
> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
> ---
>  drivers/media/usb/em28xx/em28xx-dvb.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
> index a54cb8dc52c9..2ce7de1c7cce 100644
> --- a/drivers/media/usb/em28xx/em28xx-dvb.c
> +++ b/drivers/media/usb/em28xx/em28xx-dvb.c
> @@ -199,6 +199,7 @@ static int em28xx_start_streaming(struct em28xx_dvb *dvb)
>  	int rc;
>  	struct em28xx_i2c_bus *i2c_bus = dvb->adapter.priv;
>  	struct em28xx *dev = i2c_bus->dev;
> +	struct usb_device *udev = interface_to_usbdev(dev->intf);
>  	int dvb_max_packet_size, packet_multiplier, dvb_alt;
>  
>  	if (dev->dvb_xfer_bulk) {
> @@ -217,6 +218,7 @@ static int em28xx_start_streaming(struct em28xx_dvb *dvb)
>  		dvb_alt = dev->dvb_alt_isoc;
>  	}
>  
> +	usb_set_interface(udev, dev->ifnum, dvb_alt);
>  	rc = em28xx_set_mode(dev, EM28XX_DIGITAL_MODE);
>  	if (rc < 0)
>  		return rc;

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

* Re: [PATCH] media: em28xx: fix a regression with HVR-950
  2018-06-26 20:09 ` Brad Love
@ 2018-06-26 20:23   ` Devin Heitmueller
  0 siblings, 0 replies; 3+ messages in thread
From: Devin Heitmueller @ 2018-06-26 20:23 UTC (permalink / raw)
  To: Brad Love
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List, Mauro Carvalho Chehab

On Tue, Jun 26, 2018 at 4:09 PM, Brad Love <brad@nextdimension.cc> wrote:
> Hi Mauro,
>
> It turns out this patch breaks DualHD multiple tuner capability. When
> alt mode is set in start_streaming it immediately kills the other tuners
> stream. Essentially both tuners cannot be used together when this is
> applied. I unfortunately don't have a HVR-950 to try and fix the
> original regression better. Can you please take another look at this?
> Until this is sorted, DualHD are effectively broken.

Yeah, because the Empia device uses the same USB Interface for both
endpoints, you need to have a reference count and only change the
alternate when the first endpoint is put into use and then only reset
the alternate back to zero when neither endpoint is in use.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com

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

end of thread, other threads:[~2018-06-26 20:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-09 12:21 [PATCH] media: em28xx: fix a regression with HVR-950 Mauro Carvalho Chehab
2018-06-26 20:09 ` Brad Love
2018-06-26 20:23   ` Devin Heitmueller

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.