Re: HauppaugeTV-quadHD DVB-T mpeg risc op code errors

2017-06-19 Thread Adam Zegelin
Hi Thomas,

I haven't had much time to investigate the issue -- I'm currently in
the process of moving country, which is a lot of work!

One thing I was able to determine is that it appears to be related to
Intel VT-d/VT-x or whatever Intel's IOMMU/x86 virtualisation tech
thing is called.

I tried the card in a different older Intel i7 board and it worked
flawlessly. I then started to wonder if it was some new
incompatibility introduced with Kaby Lake. I had tweaked the UEFI
settings on the new Kaby Lake board to enable VT-d/VT-x since I wanted
to run Linux as a host OS with Windows 10 running on top of qemu/KVM.
Upon resetting the UEFI settings to their defaults (VT-d/VT-x
disabled) the card worked without issue.

Maybe this will point you in the right direction, especially since you
mention that your using EXSi with PCIe passthrough, which requires the
use of VT-d/VT-x.

Whether the card itself has issues with VT-d/VT-x or it's a driver bug
I have yet to determine -- how I do that, no idea!

I've CC'd the list, which should include your reply too. See
http://vger.kernel.org/vger-lists.html#linux-media to subscribe to the
list.

Regards,
Adam

On Sun, Jun 18, 2017 at 6:45 PM, Thomas Kuehne  wrote:
> Hi Adam,
>
> interestingly, I have the same issue and you "fix" also works for me, at 
> least partly.
>
> I run the quad HD on a little 1RU server that has vmware's ESXi supervisor 
> installed, and the card is configured for PCI passthrough. The virtual 
> machine that makes use of this card runs tvheadend 4.2.2. Other than that, 
> the setup is similar to what you describe. (Ubuntu 16.04.2 LTS Kernel 4.8, 
> driver vb-demod-si2168-b40-01.fw version 4.0.11)
>
> Without the debug kernel option, I get the same load of errors, and the 
> tvheadend software is not able to tune.
> Adding debug level 5, I get a picture. So, I guess I am with you that the 
> additional latency induced by the debug option helped the driver to cope.
>
> Were you successful in solving the issue with your card? Any idea how we 
> might get this looked at? I haven't worked out how I can respond to your 
> thread on the mailing list (found it via a google search at the mail 
> archive). Maybe you can add my response to the thread?
>
> Best regards,
>
> Thomas


Re: HauppaugeTV-quadHD DVB-T mpeg risc op code errors

2017-04-16 Thread Adam Zegelin
Just a follow up on this. I had a bit more time to dig deeper into this today.

Enabling debug output for the cx23885 driver *fixes* the issue.

I added this to my kernel command line: cx23885.debug=8

With debug mode enabled, `w_scan` can find channels and TVheadend can
successfully tune to and stream TV over the network.

It's my understanding that the debug option is supposed to only
control the verbosity of debug messages and in no way alters the
behaviour of the driver.
>From a cursory look at cx23885-core.c, there are a few if (debug > x)
sections that do additional register/memory dumps.
Perhaps these additional dumps slow down the driver enough to uncover
a subtle timing-related issue?

Further narrowing it down:

debug=3 fail
debug=4 fail
debug=5 success

cx23885-core.c:1420:
if (debug > 4)
cx23885_tsport_reg_dump(port);


I'm more than happy to help diagnose this further.

- Adam

On Sun, Apr 9, 2017 at 1:25 PM, Adam Zegelin <a...@zegelin.com> wrote:
> Hi,
>
> I recently purchased a HauppaugeTV-quadHD DVB-T/T2/C tuner in Australia.
>
> I followed the guide on linuxtv.org available here:
> https://www.linuxtv.org/wiki/index.php/Hauppauge_WinTV-quadHD_(DVB-T/T2/C)
>
> I installed the dvb-demod-si2168-b40-01.fw firmware file.
>
> Device nodes for the card are present:
> /dev/dvb/adapter3
> /dev/dvb/adapter3/net0
> /dev/dvb/adapter3/dvr0
> /dev/dvb/adapter3/demux0
> /dev/dvb/adapter3/frontend0
> /dev/dvb/adapter2
> /dev/dvb/adapter2/net0
> /dev/dvb/adapter2/dvr0
> /dev/dvb/adapter2/demux0
> /dev/dvb/adapter2/frontend0
> /dev/dvb/adapter1
> /dev/dvb/adapter1/net0
> /dev/dvb/adapter1/dvr0
> /dev/dvb/adapter1/demux0
> /dev/dvb/adapter1/frontend0
> /dev/dvb/adapter0
> /dev/dvb/adapter0/net0
> /dev/dvb/adapter0/dvr0
> /dev/dvb/adapter0/demux0
> /dev/dvb/adapter0/frontend0
>
> I cannot get any dvb-t application to work. TvHeadend detects the
> adapters, but is unable to scan.
> w_scan fails too, for example:
> $ ./w_scan -c AU
> w_scan version 20170107 (compiled for DVB API 5.10)
> using settings for AUSTRALIA
> DVB aerial
> DVB-T AU
> scan type TERRESTRIAL, channellist 3
> output format vdr-2.0
> WARNING: could not guess your codepage. Falling back to 'UTF-8'
> output charset 'UTF-8', use -C  to override
> Info: using DVB adapter auto detection.
> /dev/dvb/adapter0/frontend0 -> TERRESTRIAL "Silicon Labs
> Si2168": very good :-))
>
> Using TERRESTRIAL frontend (adapter /dev/dvb/adapter0/frontend0)
> -_-_-_-_ Getting frontend capabilities-_-_-_-_
> Using DVB API 5.10
> frontend 'Silicon Labs Si2168' supports
> DVB-T2
> INVERSION_AUTO
> QAM_AUTO
> TRANSMISSION_MODE_AUTO
> GUARD_INTERVAL_AUTO
> HIERARCHY_AUTO
> FEC_AUTO
> BANDWIDTH_AUTO not supported, trying 6/7/8 MHz.
> FREQ (42.00MHz ... 870.00MHz)
> -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
> Scanning DVB-T...
> Scanning 7MHz frequencies...
> 177500: (time: 00:00.009) signal ok:QAM_AUTO f = 177500
> kHz I999B7C999D999T999G999Y999 (0:0:0)
> Info: no data from PAT after 2 seconds
> deleting (QAM_AUTO f = 177500 kHz I999B7C999D999T999G999Y999 (0:0:0))
> 177625: (time: 00:02.513) signal ok:QAM_AUTO f = 177625
> kHz I999B7C999D999T999G999Y999 (0:0:0)
> Info: no data from PAT after 2 seconds
> deleting (QAM_AUTO f = 177625 kHz I999B7C999D999T999G999Y999 (0:0:0))
> 184500: (time: 00:05.519) signal ok:QAM_AUTO f = 184500
> kHz I999B7C999D999T999G999Y999 (0:0:0)
> Info: no data from PAT after 2 seconds
> deleting (QAM_AUTO f = 184500 kHz I999B7C999D999T999G999Y999 (0:0:0))
> 184625: (time: 00:08.499) signal ok:QAM_AUTO f = 184625
> kHz I999B7C999D999T999G999Y999 (0:0:0)
> Info: no data from PAT after 2 seconds
> deleting (QAM_AUTO f = 184625 kHz I999B7C999D999T999G999Y999 (0:0:0))
>
>
> The `lspci` output for this card is:
> 01:00.0 PCI bridge: Pericom Semiconductor Device 2304 (rev 05)
> 02:01.0 PCI bridge: Pericom Semiconductor Device 2304 (rev 05)
> 02:02.0 PCI bridge: Pericom Semiconductor Device 2304 (rev 05)
> 03:00.0 Multimedia video controller: Conexant Systems, Inc. CX23885
> PCI Video and Audio Decoder (rev 03)
> 04:00.0 Multimedia video controller: Conexant Systems, Inc. CX23885
> PCI Video and Audio Decoder (rev 03)
>
> `dmesg` output for each of the CX23885 devices on boot is:
> [2.108823] tveeprom: Hauppauge model 166200, rev B5I6, serial# 4035886915
> [2.108827] tveeprom: MAC address is 00:0d:fe:8e:bf:43
> [2.108830] tveeprom: tuner model is SiLabs Si2157 (idx 186, type 4)
> [2.108833] tveeprom: TV standards ATSC/DVB Digital (eeprom 0x80

HauppaugeTV-quadHD DVB-T mpeg risc op code errors

2017-04-08 Thread Adam Zegelin
Hi,

I recently purchased a HauppaugeTV-quadHD DVB-T/T2/C tuner in Australia.

I followed the guide on linuxtv.org available here:
https://www.linuxtv.org/wiki/index.php/Hauppauge_WinTV-quadHD_(DVB-T/T2/C)

I installed the dvb-demod-si2168-b40-01.fw firmware file.

Device nodes for the card are present:
/dev/dvb/adapter3
/dev/dvb/adapter3/net0
/dev/dvb/adapter3/dvr0
/dev/dvb/adapter3/demux0
/dev/dvb/adapter3/frontend0
/dev/dvb/adapter2
/dev/dvb/adapter2/net0
/dev/dvb/adapter2/dvr0
/dev/dvb/adapter2/demux0
/dev/dvb/adapter2/frontend0
/dev/dvb/adapter1
/dev/dvb/adapter1/net0
/dev/dvb/adapter1/dvr0
/dev/dvb/adapter1/demux0
/dev/dvb/adapter1/frontend0
/dev/dvb/adapter0
/dev/dvb/adapter0/net0
/dev/dvb/adapter0/dvr0
/dev/dvb/adapter0/demux0
/dev/dvb/adapter0/frontend0

I cannot get any dvb-t application to work. TvHeadend detects the
adapters, but is unable to scan.
w_scan fails too, for example:
$ ./w_scan -c AU
w_scan version 20170107 (compiled for DVB API 5.10)
using settings for AUSTRALIA
DVB aerial
DVB-T AU
scan type TERRESTRIAL, channellist 3
output format vdr-2.0
WARNING: could not guess your codepage. Falling back to 'UTF-8'
output charset 'UTF-8', use -C  to override
Info: using DVB adapter auto detection.
/dev/dvb/adapter0/frontend0 -> TERRESTRIAL "Silicon Labs
Si2168": very good :-))

Using TERRESTRIAL frontend (adapter /dev/dvb/adapter0/frontend0)
-_-_-_-_ Getting frontend capabilities-_-_-_-_
Using DVB API 5.10
frontend 'Silicon Labs Si2168' supports
DVB-T2
INVERSION_AUTO
QAM_AUTO
TRANSMISSION_MODE_AUTO
GUARD_INTERVAL_AUTO
HIERARCHY_AUTO
FEC_AUTO
BANDWIDTH_AUTO not supported, trying 6/7/8 MHz.
FREQ (42.00MHz ... 870.00MHz)
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Scanning DVB-T...
Scanning 7MHz frequencies...
177500: (time: 00:00.009) signal ok:QAM_AUTO f = 177500
kHz I999B7C999D999T999G999Y999 (0:0:0)
Info: no data from PAT after 2 seconds
deleting (QAM_AUTO f = 177500 kHz I999B7C999D999T999G999Y999 (0:0:0))
177625: (time: 00:02.513) signal ok:QAM_AUTO f = 177625
kHz I999B7C999D999T999G999Y999 (0:0:0)
Info: no data from PAT after 2 seconds
deleting (QAM_AUTO f = 177625 kHz I999B7C999D999T999G999Y999 (0:0:0))
184500: (time: 00:05.519) signal ok:QAM_AUTO f = 184500
kHz I999B7C999D999T999G999Y999 (0:0:0)
Info: no data from PAT after 2 seconds
deleting (QAM_AUTO f = 184500 kHz I999B7C999D999T999G999Y999 (0:0:0))
184625: (time: 00:08.499) signal ok:QAM_AUTO f = 184625
kHz I999B7C999D999T999G999Y999 (0:0:0)
Info: no data from PAT after 2 seconds
deleting (QAM_AUTO f = 184625 kHz I999B7C999D999T999G999Y999 (0:0:0))


The `lspci` output for this card is:
01:00.0 PCI bridge: Pericom Semiconductor Device 2304 (rev 05)
02:01.0 PCI bridge: Pericom Semiconductor Device 2304 (rev 05)
02:02.0 PCI bridge: Pericom Semiconductor Device 2304 (rev 05)
03:00.0 Multimedia video controller: Conexant Systems, Inc. CX23885
PCI Video and Audio Decoder (rev 03)
04:00.0 Multimedia video controller: Conexant Systems, Inc. CX23885
PCI Video and Audio Decoder (rev 03)

`dmesg` output for each of the CX23885 devices on boot is:
[2.108823] tveeprom: Hauppauge model 166200, rev B5I6, serial# 4035886915
[2.108827] tveeprom: MAC address is 00:0d:fe:8e:bf:43
[2.108830] tveeprom: tuner model is SiLabs Si2157 (idx 186, type 4)
[2.108833] tveeprom: TV standards ATSC/DVB Digital (eeprom 0x80)
[2.108835] tveeprom: audio processor is CX23885 (idx 39)
[2.108836] tveeprom: decoder processor is CX23885 (idx 33)
[2.108838] tveeprom: has no radio, has IR receiver, has no IR transmitter
[2.108841] cx23885: cx23885[0]: warning: unknown hauppauge model #166200
[2.108842] cx23885: cx23885[0]: hauppauge eeprom: model=166200
[2.108846] cx23885: cx23885_dvb_register() allocating 1 frontend(s)
[2.108849] cx23885: cx23885[0]: cx23885 based dvb card
[2.118763] i2c i2c-4: Added multiplexed i2c bus 7
[2.118768] si2168 4-0064: Silicon Labs Si2168-B40 successfully identified
[2.118772] si2168 4-0064: firmware version: B 4.0.2
[2.122432] si2157 5-0060: Silicon Labs Si2147/2148/2157/2158
successfully attached
[2.122457] dvbdev: DVB: registering new adapter (cx23885[0])
[2.122464] cx23885 :03:00.0: DVB: registering adapter 0
frontend 0 (Silicon Labs Si2168)...
[2.123007] cx23885: cx23885_dvb_register() allocating 1 frontend(s)
[2.123010] cx23885: cx23885[0]: cx23885 based dvb card
[2.129982] i2c i2c-4: Added multiplexed i2c bus 8
[2.129987] si2168 4-0066: Silicon Labs Si2168-B40 successfully identified
[2.129990] si2168 4-0066: firmware version: B 4.0.2
[2.132024] si2157 5-0062: Silicon Labs Si2147/2148/2157/2158
successfully attached
[2.132043] dvbdev: DVB: registering new adapter (cx23885[0])
[2.132048] cx23885 :03:00.0: DVB: registering adapter 1
frontend 0 (Silicon Labs Si2168)...
[2.132503] cx23885: