[solved] Many discontinuities when simultaneously recording from 3 tuners (1 Viewer)

rsenden

Portal Pro
August 22, 2006
88
108
Rotterdam, NL
Home Country
Netherlands Netherlands
I have the following two USB tuners connected to my Mac Mini:
  • Cinergy T Stick DUAL RC (2xDVB-T)
  • Terratec H7 (1xDVB-C, recently added)
My cable provider broadcasts both DVB-C and DVB-T signals over the same cable, so all tuners are connected to the same cable. In TV Server setup under Manual Control, I notice the following behavior:
  • All tuners show good signal quality (98-100) for almost all channels.
  • When timeshifting on two tuners simultaneously (2xDVB-T or DVB-T+DVB-C), no discontinuities are logged.
  • When timeshifting on all three tuners simultaneously, many discontinuities are logged for the second DVB-T tuner. The first DVB-T tuner and the DVB-C tuner show no discontinuities. All tuners still show good signal quality. I have tried many different channel/tuner combinations; every time only the second DVB-T tuner shows these discontinuities.
Is this likely a cable/signal problem, or could it be that USB is not fast enough for three video streams? Is there anything I can do to further investigate this issue?
 

Vasilich

Portal Pro
August 30, 2009
3,394
1,170
Germany, Mayence
Home Country
Russian Federation Russian Federation
have you tried to put sticks to different USB ports? it can be that all the ports you use for tuners are connected internally tho the same hub, and the bottleneck can be there... check device manager - show devices by connection
 

mm1352000

Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Hello

    I generally agree with Vasilich. The bottleneck might be USB bandwidth or power. That is probably the most likely explanation. However, there are other possible explanations too.

    You say that the signal strength/quality is good even when all three tuners are in use... but I wouldn't discount this. Especially interference. The signal strength/quality readings from TV Server shouldn't really be trusted to begin with, because we don't know the scale that the tuner driver is using to report its readings. We assume it is 0 to 100, but it could be (and sometimes is) completely different. Also, since the readings are only updated every few seconds you'd be very unlikely to see "dynamic" issues like jitter and interference which come and go within milliseconds.

    Another potential issue is the HDD.

    Regards,
    mm
     

    rsenden

    Portal Pro
    August 22, 2006
    88
    108
    Rotterdam, NL
    Home Country
    Netherlands Netherlands
    Thanks for the responses. I already checked the devices by connection; unfortunately the Mac Mini seems to use one USB 3.0 hub for all external USB ports so switching to different USB ports will not help.

    All 4 ports are occupied; an USB 3.0 HDD for recordings, the two tuners and a wireless keyboard receiver. I think the timeshift folder is on the internal HDD, but I need to double-check. Now that you mention USB power; I remember that my external HDD was sometimes powering down when charging a tablet on one of the other USB ports (before I had the DVB-C tuner and thus a free port), so that may very well be the issue.

    I will do some more tests later on, for example check whether the issue still exists when disconnecting the external HDD. With regards to bandwidth; any idea how much USB bandwidth a single video stream would use?
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Ahh, that could introduce its own compatibility issues.

    With regards to bandwidth; any idea how much USB bandwidth a single video stream would use?
    Well, stream bandwidth is variable from channel to channel. In general a single TV/video stream is usually anywhere from around 2 Mb/s (0.25 MB/s) up to 16 Mb/s (2 MB/s). However, when you tune a channel TV Server receives the full transport stream for the transponder/multiplex/transmitter. So, you need to be thinking about the bandwidth of that full TS... which for your provider with 64 QAM and symbol rate 6900 ks/s is approximately 40 Mb/s (5 MB/s). Multiply that by 3 for the 3 active tuners and you have 120 Mb/s (15 MB/s). Consider also the HDD bandwidth if the USB HDD is also being used for timeshifting (3 x 7 Mb/s???) or other things...

    In theory that shouldn't be too much even for USB 2 (limit 480 Mb/s)... but theory does not always work out in practise.
     

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,849
    1,771
    Southampton
    Home Country
    United Kingdom United Kingdom
    Multiply that by 3 for the 3 active tuners and you have 120 Mb/s (15 MB/s). Consider also the HDD bandwidth if the USB HDD is also being used for timeshifting (3 x 7 Mb/s???) or other things... In theory that shouldn't be too much even for USB 2 (limit 480 Mb/s)... but theory does not always work out in practise.
    My experience with USB and ethernet connections is that sustained throughput is very much lower than the rated maximum speed. The "rule of thumb" that I use is:

    achievable sustained throughput = one third of rated maximum speed

    So, a USB2 connection rated at 480Mbit/sec (== 60MByte/sec) has an achievable sustained throughput of circa 20MByte/sec. This seems perilously close to three TS broadcast streams coming in from the tuners, and three TS programme streams going out to the USB disk.

    -- from CyberSimian in the UK
     

    rsenden

    Portal Pro
    August 22, 2006
    88
    108
    Rotterdam, NL
    Home Country
    Netherlands Netherlands
    Thanks again for the responses. I did some additional testing, and indeed it looks like a USB bandwidth problem. I connected the tuners to my laptop, which has both USB 2.0 and USB 3.0 controllers. When connecting the H7 and T-Stick Dual to the same USB controller (either 2.0 or 3.0), I can reproduce the discontinuity issue. When connecting the devices to different USB controllers, all 3 tuners can record simultaneously without any discontinuities.

    Apparently the USB controller limits the combined bandwidth for all connected USB 2.0 devices to 480Mbit/sec, even if it is a USB 3.0 controller. I was previously assuming that each individual USB port could handle up to 480Mbit/sec.

    I also tried some other things, like connecting the two tuner devices to an external (powered) USB 3.0 hub. I was hoping that this would use the USB 3.0 bandwidth to transfer the multiple USB 2.0 data streams, but apparently an USB 3.0 hub acts as both a USB 2.0 and USB 3.0 hub. So for USB 2.0 devices, the USB 2.0 electrical wiring is used to connect to the host PC, again limiting the combined bandwidth to 480Mbit/sec.

    Now the question remains whether there are any solutions for this. I can think of the following:
    • Use some device (cable, hub, dock) to convert the USB 2.0 signal into a USB 3.0 signal, such that the controller can use the full USB 3.0 bandwidth for one of the tuner devices. Does anyone know whether such a device exists for a reasonable price?
    • Use a Thunderbolt dock or Kanex adapter to add additional USB ports via the Thunderbolt port. I'm assuming this would add an additional USB controller, but unfortunately this solution is quite expensive.
    • Connect one of the tuner devices to my NAS or router, and use for example http://usbip.sourceforge.net/ to make this available as a remote USB device on the Mac Mini. This would probably be the cheapest solution, but probably also the least stable. Anyone ever tried something like this?
    • Any other solutions?
    Thanks,

    Ruud
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Hello again Ruud

    Thanks for reporting your findings. :)

    Did you try timeshifting/recording to the internal drive and disconnecting the external USB HDD? ...and what about also disconnecting the keyboard receiver?
    Have you considered drivers and power saving mode as possible problems?

    In the past people have encountered issues with badly written/designed drivers that caused discontinuities because their ISR took too long. USB device, USB controller, and network adapter drivers seem to be particularly susceptible to this problem. There is a DPC latency analysis tool that can be used to check this:
    http://www.thesycon.de/deu/latency_check.shtml

    It would be interesting to see the results from such a tool...

    And about the power: I wonder if the USB controller reduces the bandwidth to save power, and whether such power saving could be disabled. Of course there is no way to change the link speed between the tuners and the controller because the tuners themselves are USB 2.0. But the link between the controller and the PCH could be affected by this too.

    Regards,
    mm
     

    rsenden

    Portal Pro
    August 22, 2006
    88
    108
    Rotterdam, NL
    Home Country
    Netherlands Netherlands
    Thanks again for the suggestions. I ran the DPC latency analysis too l; the absolute maximum latency is around 300us (and usually between 70-130us), so according to this tool 'This machine should be able to handle real-time streaming of audio and/or video data without drop-outs.'.

    I think I have disabled most power saving settings, for example HDD is set to never spin down, and USB selective suspend is turned off. Any particular settings that I could look at?

    I'm using the latest available Terratec drivers and just updated the drivers for the Intel USB 3.0 controller & hub to the latest version available on the Intel site, but without any difference. So if it is a driver problem, I'm not sure whether I can do much about it. But since I do not have the issue when the tuners are connected to different USB controllers, I guess it is more likely to be a problem with the USB controller (or the Terratec drivers do not like multiple tuners connected to the same controller).

    With regards to 'some device to convert the USB 2.0 signal into a USB 3.0 signal' I actually meant something like adding an additional, external USB controller on one of the USB 3.0 ports. Maybe the following picture explains it better:

    USB.png


    So, as far as the Mac Mini is concerned, only one of the tuner devices is using the USB 2.0 bandwidth, whereas the other tuner device is using USB 3.0 bandwidth. No idea whether something like this exists, or whether the USB standard even supports such a use case. According to http://en.wikipedia.org/wiki/USB_hub, this would be similar to a Transaction Translator, but a quick Google search shows that this probably does not exist for USB 3.0/2.0.

    Regards,
    Ruud
     
    Last edited:

    RonD

    Test Group
  • Team MediaPortal
  • December 20, 2011
    911
    278
    SillyValley CA
    Home Country
    United States of America United States of America
    What generation CPU/chipset mac mini are you using? Also a bit curious about seeing the terms MediaPortal and Mac-Mini in the same sentence. What OS are you running?
     

    Users who are viewing this thread

    Top Bottom