All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] [RFC] em28xx: Fix dual transport stream use
@ 2018-06-28 17:29 Brad Love
  2018-06-28 17:29 ` [PATCH v2] em28xx: Fix dual transport stream operation Brad Love
  0 siblings, 1 reply; 2+ messages in thread
From: Brad Love @ 2018-06-28 17:29 UTC (permalink / raw)
  To: mchehab, linux-media; +Cc: Brad Love

When dual transport stream support was added the call to set
alt mode on the USB interface was moved to em28xx_dvb_init.
This was reported to break streaming for a device, so the
call was re-added to em28xx_start_streaming.

Commit 509f89652f83 ("media: em28xx: fix a regression with HVR-950")

This regression fix however broke dual transport stream support.
When a tuner starts streaming it sets alt mode on the USB interface.
The problem is both tuners share the same USB interface, so when
the second tuner becomes active and sets alt mode on the interface
it kills streaming on the other port.

This v2 patch changes from shared state and device locking to a
simple check to verify if a device has dual tuner capability.
If a device is a single tuner model, then alt mode is explicitly
set during start_streaming, but dual tuner devices are not altered.
Testing has shown that DualHD devices, both isoc and bulk models,
work correctly if alt mode is set once in em28xx_dvb_init.

This v2 patch only handles the regression, and ignores the fact
alt mode setting logic could probably be rethought across
em28xx-dvb, em28xx-video, and em28xx-also drivers. However since
the alt mode is never set to 0 on DVB stream stop, this simple v2
approach seems sufficient for now.


Brad Love (1):
  em28xx: Fix dual transport stream operation

 drivers/media/usb/em28xx/em28xx-dvb.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

-- 
2.7.4

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

* [PATCH v2] em28xx: Fix dual transport stream operation
  2018-06-28 17:29 [PATCH v2] [RFC] em28xx: Fix dual transport stream use Brad Love
@ 2018-06-28 17:29 ` Brad Love
  0 siblings, 0 replies; 2+ messages in thread
From: Brad Love @ 2018-06-28 17:29 UTC (permalink / raw)
  To: mchehab, linux-media; +Cc: Brad Love

Addresses the following, which introduced a regression itself:

Commit 509f89652f83 ("media: em28xx: fix a regression with HVR-950")

The regression fix breaks dual transport stream support. Currently,
when a tuner starts streaming it sets alt mode on the USB interface.
The problem is, in a dual tuner model, both tuners share the same
USB interface, so when the second tuner becomes active and sets alt
mode on the interface it kills streaming on the other port.

This patch addresses the regression by only setting alt mode
on the USB interface during em28xx_start_streaming, if the
device is not a dual tuner model. This allows all older and
single tuner devices to explicitly set alt mode during stream
startup. Testers report both isoc and bulk DualHD models work
correctly with the alt mode set only once, in em28xx_dvb_init.

Signed-off-by: Brad Love <brad@nextdimension.cc>
---
Since v1:
- Removed all locking and shared state
- Only set alt mode in start_streaming if not a dual tuner device

 drivers/media/usb/em28xx/em28xx-dvb.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
index b778d8a..a73faf1 100644
--- a/drivers/media/usb/em28xx/em28xx-dvb.c
+++ b/drivers/media/usb/em28xx/em28xx-dvb.c
@@ -218,7 +218,9 @@ static int em28xx_start_streaming(struct em28xx_dvb *dvb)
 		dvb_alt = dev->dvb_alt_isoc;
 	}
 
-	usb_set_interface(udev, dev->ifnum, dvb_alt);
+	if (!dev->board.has_dual_ts)
+		usb_set_interface(udev, dev->ifnum, dvb_alt);
+
 	rc = em28xx_set_mode(dev, EM28XX_DIGITAL_MODE);
 	if (rc < 0)
 		return rc;
-- 
2.7.4

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

end of thread, other threads:[~2018-06-28 17:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-28 17:29 [PATCH v2] [RFC] em28xx: Fix dual transport stream use Brad Love
2018-06-28 17:29 ` [PATCH v2] em28xx: Fix dual transport stream operation Brad Love

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.