Skip to contentSkip to conversation

Multiple Mantis devices gives me glitches

DISCUSSION Vidar Tyldum 2 participants 3 messages Dec 12, 2011 – Dec 13, 2011 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

Hello,

I have three Cinergy C (DVB-C cards) like this:
05:04.0 Multimedia controller: Twinhan Technology Co. Ltd Mantis DTV PCI Bridge Controller [Ver 1.0] (rev 01)
Subsystem: TERRATEC Electronic GmbH Device 1178
Flags: bus master, medium devsel, latency 128, IRQ 20 Memory at fdcfe000 (32-bit, prefetchable) [size=4K] Kernel driver in use: Mantis
Kernel modules: mantis

Kernel: 2.6.38-13-generic-pae (Ubuntu Natty stock)
Motherboard: P43-ES3G
CPU: Intel(R) Core(TM)2 Quad CPU Q8400

At some point i started having glitches (I would from time to time get an 'old' frame displayed and sometimes audio noise when this happened). I tried pretty much every trick I could find:
* CPU affinity
* Dedicated IRQ for each card (only shared with USB, which has no units
attached)
* Various process priorities (also for the kdvb-processes)
* pci latency (from 0x20 to 0xff)

I have quite decent results when I only have 2 DVB cards present, and the results became even better when running the irqbalancer-dæmon as well. The glitches are not completely gone, but much more manageble now.

So the problem seems to be caused by too many interrupts for my system to handle, however this is where I am in over my head.

I know 2.6.38 isn't the freshest brew, but I could not find any changes to the driver since then that seemed relevant (which could just be my lack of source-fu).

So, any ideas on how to improve the performance? I am suffering from some hardware incompatibility or is the driver this resource hungry?

Signature · 2 lines
Vidar Tyldum
                              [email protected]               PGP: 0x3110AA98
#1 lore raw
Quoted 32 lines

Hello,

I have three Cinergy C (DVB-C cards) like this:
05:04.0 Multimedia controller: Twinhan Technology Co. Ltd Mantis DTV PCI Bridge Controller [Ver 1.0] (rev 01)
Subsystem: TERRATEC Electronic GmbH Device 1178
Flags: bus master, medium devsel, latency 128, IRQ 20 Memory at fdcfe000 (32-bit, prefetchable) [size=4K] Kernel driver in use: Mantis
Kernel modules: mantis

Kernel: 2.6.38-13-generic-pae (Ubuntu Natty stock)
Motherboard: P43-ES3G
CPU: Intel(R) Core(TM)2 Quad CPU Q8400

At some point i started having glitches (I would from time to time get an 'old' frame displayed and sometimes audio noise when this happened). I tried pretty much every trick I could find:
* CPU affinity
* Dedicated IRQ for each card (only shared with USB, which has no units
attached)
* Various process priorities (also for the kdvb-processes)
* pci latency (from 0x20 to 0xff)

I have quite decent results when I only have 2 DVB cards present, and the results became even better when running the irqbalancer-dæmon as well. The glitches are not completely gone, but much more manageble now.

So the problem seems to be caused by too many interrupts for my system to handle, however this is where I am in over my head.

Quoted 6 lines

I know 2.6.38 isn't the freshest brew, but I could not find any changes to the driver since then that seemed relevant (which could just be my lack of source-fu).

So, any ideas on how to improve the performance? I am suffering from some hardware incompatibility or is the driver this resource hungry?

Hi,
I noticed some SMP problems with the mantis driver as well (see my post "Mantis CAM not SMP safe / Activating CAM on Technisat Skystar HD2 (DVB-S2)").
One workaround for me is to limit the CPU to one core (to be sure disable the hyperthreading cores as well). That can be done via BIOS *or* adding maxcpus=1 as kernel parameter *or* you can disable the cores one by one via "|echo 0 > /sys/devices/system/cpu/cpuX/online|" where X is the core to disable. Since you need to be root for this, I did "sudo su" first. But of course our problems might be completely unrelated and limiting to one core won't change a thing ;)

Manuel

#2 lore raw
In reply to Vidar Tyldum

(sorry for breaking the threading, the reply came faster than my subscription to the list :)

Quoted 11 lines

From Ninja <Ninja15@xxxxxx>,
Hi, I noticed some SMP problems with the mantis driver as well (see my post "Mantis CAM not SMP safe / Activating CAM on Technisat Skystar HD2 (DVB-S2)"). One workaround for me is to limit the CPU to one core (to be sure disable the hyperthreading cores as well). That can be done via BIOS *or* adding maxcpus=1 as kernel parameter *or* you can disable the cores one by one via "|echo 0 > /sys/devices/system/cpu/cpuX/online|" where X is the core to disable. Since you need to be root for this, I did "sudo su" first. But of course our problems might be completely unrelated and limiting to one core won't change a thing ;)

Quoted 1 line

Manuel

I doubt I'll revert back to the stock mantis module to test right now, but your suggestion and observations might certainly be of interest. If/when Ubuntu releases a new kernel which overwrites my current driver I will give it a go.
However, instead of disabling SMP completely I hope adjusting IRQ affinity could be sufficient:
http://kernel.org/doc/Documentation/IRQ-affinity.txt

Couple this with increased PCI latency might work, however with three devices connected I think the only solution is to reduce the number of interrupts (though I am by no means any expert on this subject).

Signature · 2 lines
Vidar Tyldum
                              [email protected]               PGP: 0x3110AA98