<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1256">
<TITLE>Message</TITLE>

<META content="MSHTML 6.00.2900.3429" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Tahoma size=2></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
  <DIV><FONT color=#0000ff><FONT color=#000000><FONT size=2><FONT 
  face=Verdana>On Wed, 2008-12-24 at 09:38 -0800, Tony Sarathchandra 
  wrote:&nbsp;<BR></FONT></FONT></FONT><FONT face=Verdana><FONT size=2><FONT 
  color=#660066>&gt;&nbsp;<BR>&gt; Hello,&nbsp;<BR>&gt; I'm attempting to get a 
  brand new HVR-1600 working on CentOS&nbsp;<BR>&gt; 5.2 
  (2.6.18-92.1.22.el5.centos.plus kernel). System is Dell 
  PowerEdge&nbsp;<BR>&gt; 2500SC with dual PIII CPUs. Prior to purchasing this 
  card I profusely&nbsp;<BR>&gt; read all the issues folks were having on this 
  list and others with the&nbsp;<BR>&gt; cx18 driver and decided to risk it, 
  verse going with a PVR-500/350 +&nbsp;<BR>&gt; separate HDTV card, and so here 
  I am. I'm reasonably proficient with&nbsp;<BR>&gt; Linux but not a sw 
  programmer.&nbsp;<BR>&gt;&nbsp;<BR>&gt; My current setup is a split MythTV 
  backend/frontend with the backend&nbsp;<BR>&gt; on the PE2500, frontend's 
  running Minimyth. I have a AverMedia (Bt878&nbsp;<BR>&gt; based) capture card 
  working reliably with NTSC from my cable provider&nbsp;<BR>&gt; (Coax in) on 
  the PE2500 backend. Here's what I've done to date to try <BR>&gt; and get this 
  to work and debug the issue. <BR>&gt; <BR>&gt; - Grabbed the latest V4L 
  distribution (v4l-dvb-94592e006b95) and <BR>&gt; compiled as per instructions 
  and installed. Had some initial compile <BR>&gt; issues, directories not found 
  etc which I've fixed. <BR></FONT><BR></FONT></FONT><FONT face=Verdana 
  color=#000000 size=2>Well, Hans has just got a lot of v4l2 infrastructure 
  changes pulled in <BR>just recently. I have not had time to test. You may want 
  to go back in <BR>time a little to: <BR><BR></FONT><A 
  href="http://linuxtv.org/hg/v4l-dvb/rev/f046a0bf05f8" target=_blank 
  rel=nofollow><FONT face=Verdana 
  size=2>http://linuxtv.org/hg/v4l-dvb/rev/f046a0bf05f8</FONT></A><FONT 
  face=Verdana color=#000000 size=2> <BR>or <BR></FONT><A 
  href="http://linuxtv.org/hg/v4l-dvb/rev/922aa9be8cd3" target=_blank 
  rel=nofollow><FONT face=Verdana 
  size=2>http://linuxtv.org/hg/v4l-dvb/rev/922aa9be8cd3</FONT></A><FONT 
  face=Verdana color=#000000 size=2> <BR><BR>just to eliminate big v4l2 
  infrastructure changes being the cause.&nbsp;<BR><SPAN 
  class=271280515-25122008><FONT face=Arial 
  color=#0000ff>&nbsp;</FONT></SPAN><BR><SPAN class=271280515-25122008><FONT 
  color=#0000ff><FONT face=Arial>[ Tony&gt;]&nbsp;&nbsp;Thanks Andy, I went back 
  to f046a0bf05f8</FONT><FONT face=Arial color=#000000 size=2> <FONT 
  color=#0000ff>and that seemed to have helped although I'm not certain that was 
  the issue. I have the card working now with MythTV. I changed multiple things 
  at the same time so not sure exactly what the issue was, but it seemed to have 
  worked. Here's what I did just for 
  reference;</FONT></FONT></FONT></SPAN></FONT></FONT></DIV><FONT 
  color=#0000ff><FONT face=Verdana color=#000000 size=2><SPAN 
  class=271280515-25122008><FONT color=#0000ff><FONT face=Arial color=#000000 
  size=2><FONT 
color=#0000ff></FONT></FONT></FONT></SPAN></FONT></FONT></BLOCKQUOTE>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><FONT color=#0000ff><FONT 
  face=Verdana color=#000000><SPAN class=271280515-25122008><FONT 
  color=#0000ff><FONT color=#000000>
  <DIV><FONT face=Arial><FONT size=2><SPAN class=271280515-25122008><FONT 
  color=#0000ff>[ Tony&gt;]&nbsp;- Went back to&nbsp;&nbsp;f046a0bf05f8 build as 
  mentioned;</FONT></SPAN></FONT></FONT></DIV>
  <DIV><SPAN class=271280515-25122008></SPAN></FONT></FONT><FONT 
  color=#0000ff><FONT size=2><FONT face=Arial><SPAN class=271280515-25122008>[ 
  Tony&gt;]&nbsp;- Made sure <FONT size=2>"Enable drivers not supported by this 
  kernel" at compile time was enabled as I'm 
  on&nbsp;2.6.18-92.1.22.el5.centos.plus kernel, this seemed 
  to&nbsp;</FONT>&nbsp;helped with the unload soft kernel lockups, although I 
  did have this occur once after still;</SPAN></FONT></FONT></FONT></DIV>
  <DIV><SPAN class=271280515-25122008></SPAN><FONT face=Arial><FONT 
  color=#0000ff><FONT size=2><SPAN class=271280515-25122008>[ Tony&gt;]&nbsp;- 
  Made sure bttv driver was blacklisted so cx18 gets a chance to load 
  first;</SPAN></FONT></FONT></FONT></DIV>
  <DIV><SPAN class=271280515-25122008></SPAN></SPAN><SPAN 
  class=271280515-25122008><FONT face=Arial color=#0000ff size=2>[ 
  Tony&gt;]&nbsp;-&nbsp;Made sure I omitted some memory intensive programs at 
  startup, the system usually runs low on memory&nbsp;with only&nbsp;512MB 
  available, so want to make sure this was not the issue;</FONT></SPAN></DIV>
  <DIV><SPAN class=271280515-25122008>&nbsp;</SPAN><BR></FONT><FONT 
  color=#660066><FONT face=Verdana size=2>&gt; - Downloaded the HVR firmware to 
  /lib/firmware which seems to load <BR>&gt; correctly. <BR>&gt; <BR>&gt; - 
  Following a reboot everything with respect to the cx18 driver seems <BR>&gt; 
  to load fine, I have some debug captures of this here; <BR>&gt; <BR>&gt; 
  </FONT><A href="http://thinkspace.ath.cx/stuff/hvr-1600_debug.txt" 
  target=_blank rel=nofollow><FONT face=Verdana 
  size=2>http://thinkspace.ath.cx/stuff/hvr-1600_debug.txt</FONT></A><FONT 
  face=Verdana size=2> <BR>&gt; With more debugging turned on; <BR>&gt; 
  </FONT><A href="http://thinkspace.ath.cx/stuff/hvr-1600_debug2.txt" 
  target=_blank rel=nofollow><FONT face=Verdana 
  size=2>http://thinkspace.ath.cx/stuff/hvr-1600_debug2.txt</FONT></A><FONT 
  face=Verdana size=2> <BR>&gt; The bttv driver (/dev/video0) and associated 
  modules for that are <BR>&gt; loaded prior to the cx18 module which becomes 
  /dev/video1 <BR></FONT></FONT><BR><FONT face=Verdana color=#000000 size=2>This 
  does not look fine: <BR><BR>cx18-0: i2c hardware 0x00000004 (cs5345) not found 
  for cmd 0x4008646d! <BR><BR>The CS5345 does baseband audio digitzation and 
  multiplexing for SVideo <BR>and Composite inputs, so you don't need it for 
  Tuner inputs, but it <BR>indicates something is wrong. I2C or V4L 
  infrastructure related maybe? <BR></DIV><SPAN class=271280515-25122008><FONT 
  face=Arial color=#0000ff></FONT></SPAN></FONT></FONT>
  <DIV><FONT color=#0000ff><FONT face=Verdana color=#000000 size=2><SPAN 
  class=271280515-25122008><FONT face=Arial color=#0000ff>[ 
  Tony&gt;]&nbsp;&nbsp;Yes, good catch, I saw this error a few times before but 
  thought it had stopped appearing.</FONT></SPAN><BR><BR><BR></FONT><FONT 
  face=Verdana><FONT size=2><FONT color=#660066>&gt; <BR>&gt; - The issues is 
  after everything seemly going fine, I get no signal <BR>&gt; from the 
  /dev/video1. Testing via xawtv, mplayer and mythtv all reveal <BR>&gt; a blank 
  red or green screen. Almost as if the input on the HVR-1600 is <BR>&gt; set to 
  composite 1 or 2 but it not as far as I can tell! 
  <BR></FONT><BR></FONT></FONT><FONT face=Verdana color=#000000 size=2>(Refer to 
  the output of /sbin/modinfo cx18 ) <BR><BR>Debug with "high volume" "dma" 
  "api" and "irq" debugging. Make sure <BR>interrupts are happening and buffers 
  are going back and forth between <BR>driver and firmware. If you debug the 
  "file" operations, you can also <BR>see if the application is reading buffers. 
  <BR><BR></FONT><FONT color=#660066><FONT face=Verdana size=2>&gt; - Switching 
  the coax cable to connect to the ATSC, I'm able to tune in <BR>&gt; 
  successfully to some QAM-256 channels, so the driver is working to <BR>&gt; 
  some degree. Here some photos of the card, it’s the MCE version with 
  <BR>&gt; the built in FM tuner. <BR>&gt; <BR>&gt; </FONT><A 
  href="http://thinkspace.ath.cx/stuff/15-116-009-04.jpg" target=_blank 
  rel=nofollow><FONT face=Verdana 
  size=2>http://thinkspace.ath.cx/stuff/15-116-009-04.jpg</FONT></A><FONT 
  face=Verdana size=2> <BR>&gt; </FONT><A 
  href="http://thinkspace.ath.cx/stuff/15-116-009-05.jpg" target=_blank 
  rel=nofollow><FONT face=Verdana 
  size=2>http://thinkspace.ath.cx/stuff/15-116-009-05.jpg</FONT></A><FONT 
  face=Verdana size=2> <BR>&gt; <BR>&gt; - After having read of the I2C bus 
  issues I placed the card in a 3.3V <BR>&gt; 64bit PCI slot that should be PCI 
  2.3 compliant. The PE2500 has both <BR>&gt; 5V and 3.3V 64bit PCI slots. Have 
  some hardware details here, card <BR>&gt; seems to be detected fine. <BR>&gt; 
  <BR>&gt; </FONT><A href="http://thinkspace.ath.cx/stuff/HVR-1600_details.txt" 
  target=_blank rel=nofollow><FONT face=Verdana 
  size=2>http://thinkspace.ath.cx/stuff/HVR-1600_details.txt</FONT></A><FONT 
  face=Verdana size=2> <BR></FONT></FONT><BR><FONT face=Verdana color=#000000 
  size=2>The I2C stuff should be fixed. I2C problems were really a symptom of 
  <BR>PCI bus errors. Now the cx18 driver checks and retries writes (up to 10 
  <BR>times) to the CX23418 until it's sure the proper values were written to 
  <BR>the CX23418 registers or memory across the PCI bus. <BR><SPAN 
  class=271280515-25122008><FONT face=Arial 
  color=#0000ff></FONT></SPAN></FONT></FONT></DIV>
  <DIV><FONT color=#0000ff><FONT face=Verdana color=#000000 size=2><SPAN 
  class=271280515-25122008><FONT face=Arial color=#0000ff>[ 
  Tony&gt;]&nbsp;&nbsp;Thanks, I moved the card back to a 5V PCI slot and it's 
  working there too. May be good to update the wiki at some point with this 
  info. :-)</FONT></SPAN><BR><BR></FONT><FONT color=#660066><FONT face=Verdana 
  size=2>&gt; - After having read here that for the PVR-500 sometimes the bttv 
  <BR>&gt; drivers causes tuner detection to not work (Tuner not detected), and 
  <BR>&gt; since the cx18 is based on this code, I tried blacklisting the bttv 
  <BR>&gt; and snd_bt87x drivers at startup, and this did end up giving me an 
  <BR>&gt; error during cx18 load. <BR>&gt; <BR>&gt; </FONT><A 
  href="http://www.mythtv.org/wiki/index.php/Hauppauge_PVR-500" target=_blank 
  rel=nofollow><FONT face=Verdana 
  size=2>http://www.mythtv.org/wiki/index.php/Hauppauge_PVR-500</FONT></A><FONT 
  face=Verdana size=2> <BR>&gt; <BR>&gt; - Here is the current cx18 dmesg error 
  with debug=32, <BR>&gt; </FONT><A 
  href="http://thinkspace.ath.cx/stuff/hvr-1600_debug3.txt" target=_blank 
  rel=nofollow><FONT face=Verdana 
  size=2>http://thinkspace.ath.cx/stuff/hvr-1600_debug3.txt</FONT></A><FONT 
  face=Verdana size=2> <BR></FONT></FONT><BR><FONT face=Verdana 
  color=#000000><FONT size=2>Your vmalloc memory address space fragmented (or 
  was leaked) with driver <BR>unloads and reloads. The cx18 driver doesn't leak 
  vmalloc space <BR>(anymore!), but it does need one for 64 MB segment for PCI 
  MMIO mapping, <BR>and the another several hundred for buffers of 4 to 32 kB of 
  real memory <BR>for captures. <BR><BR>You should up your available vmalloc 
  address space with a 'vmalloc=xxxM' <BR>kernel command line. Make it about 
  128M larger than what /proc/meminfo <BR>reports for your total vmalloc space. 
  <BR><BR>Alternately you can use the 'enc_yuv_bufs=0 enc_idx_bufs=0 
  <BR>enc_pcm_bufs=0' cx18 module options to temporarily reduce the buffer 
  <BR>needs for streams you aren't using.&nbsp;<SPAN 
  class=271280515-25122008><FONT face=Arial 
  color=#0000ff>&nbsp;</FONT></SPAN></FONT></FONT></FONT></DIV>
  <DIV><FONT color=#0000ff><FONT face=Verdana color=#000000><FONT size=2><SPAN 
  class=271280515-25122008><FONT face=Arial 
  color=#0000ff></FONT></SPAN><BR><SPAN class=271280515-25122008><FONT 
  face=Arial color=#0000ff>[ Tony&gt;]&nbsp;I didn't try increasing the vmalloc 
  size as it was already at 507896kB&nbsp;and the system only has 512MB total. I 
  tried reducing the buffers as you indicated but it worked in both cases after 
  I had done all the above changes mentioned. I currently have the buffers set 
  to their default values.&nbsp; </FONT></SPAN></FONT></FONT></FONT><FONT 
  color=#0000ff><FONT face=Verdana color=#000000><FONT size=2><SPAN 
  class=271280515-25122008><FONT face=Arial color=#0000ff>I have meminfo output 
  here just for reference <A 
  href="http://thinkspace.ath.cx/stuff/hvr-1600_meminfo.txt">http://thinkspace.ath.cx/stuff/hvr-1600_meminfo.txt</A>&nbsp;</FONT></SPAN><BR><BR><BR></FONT></FONT><FONT 
  color=#660066><FONT face=Verdana size=2>&gt; - Also modprobe -r of the cx18 
  module at any points ends up with a <BR>&gt; kernel soft lockup as below which 
  is only recoverable via a reboot. <BR>&gt; <BR>&gt; </FONT><A 
  href="http://thinkspace.ath.cx/stuff/Kernel_lockup_bug.txt" target=_blank 
  rel=nofollow><FONT face=Verdana 
  size=2>http://thinkspace.ath.cx/stuff/Kernel_lockup_bug.txt</FONT></A><FONT 
  face=Verdana size=2> <BR>&gt; Was there some problem with the build process 
  perhaps? <BR></FONT></FONT><BR><FONT face=Verdana color=#000000 
  size=2>Perhaps. It could also be problems with the new infrastructure changes. 
  <BR>In which case Hans would be interested if you can narrow it down to that 
  <BR>or not. <BR><SPAN class=271280515-25122008><FONT face=Arial 
  color=#0000ff>[ Tony&gt;]&nbsp;Perhaps, although I think it was most likely 
  something at my end as &nbsp;I'm still unable to get "mplayer /dev/video0" to 
  spit out anything other than a green screen but it works in MythTV.&nbsp; I 
  suspected the card is not tuned correctly my default but I was unable to build 
  the v4l2-apps tools&nbsp;initially with some build problems with Qt header 
  files. I did finally get this to compile correctly after messing around with 
  Qt directories.</FONT></SPAN></FONT></DIV>
  <DIV><FONT face=Verdana color=#000000><SPAN 
  class=271280515-25122008></SPAN><BR><FONT size=2><SPAN 
  class=271280515-25122008><FONT face=Arial color=#0000ff>[ Tony&gt;] I have the 
  "./v4l2-dbg -d /dev/video0 --log-status" output here, &nbsp;<A 
  href="http://thinkspace.ath.cx/stuff/hvr-1600_v4l2-dbg.txt">http://thinkspace.ath.cx/stuff/hvr-1600_v4l2-dbg.txt</A>&nbsp; 
  Everything seems to be okay as far as I can 
  tell.</FONT></SPAN><BR><BR></FONT></FONT><FONT face=Verdana color=#660066 
  size=2>&gt;From what I can read in the lockup messages, the cx18 driver was 
  trying <BR></FONT><FONT face=Verdana color=#000000 size=2>to unload and when 
  calling v4l2 and i2c infrastructure functions, <BR>something hung up for 10 
  seconds. (Maybe waiting on a lock that <BR>something in your kernel never 
  released?) <BR><BR>Regards, <BR>Andy <BR><SPAN class=271280515-25122008><FONT 
  face=Arial color=#0000ff>[ Tony&gt;]&nbsp;Thanks for all your help once more 
  Andy and for your hard work on getting the driver to where it is. Only 
  remaining (known) issue I have is the initial jitter/studder when tuning in to 
  a channel for the very first time, but this is a minor annoyance, as normally 
  my backend runs 24x7 and is rarely restarted. Again the performance of the 
  HVR-1600 is very good with the latest driver and I'm impressed.&nbsp; Picture 
  quality is better than my old Bt878 Avermedia card and CPU utilization on my 
  dual 933Mhz Coppermine PIII backend is &lt;4% on a single CPU while watching 
  live TV. My old Bt878 averaged 60-70% on a single CPU as reference. I'm glad I 
  went with the HVR-1600 vs a more mature older dual card solution in the end, 
  took me all of about 2 days from unwrapping the box to have it operational 
  with MythTV! at least for analog NTSC. :-)) I now have the option to mess 
  around with ATSC/DVB later...</FONT></SPAN><BR><BR></FONT><FONT face=Verdana 
  color=#660066 size=2>&gt; I'm kind of running out of ideas on what else I can 
  do to further <BR>&gt; diagnose this issue, any help or pointers would be 
  greatly <BR>&gt; appreciated. <BR>&gt; <BR>&gt; Many thanks, <BR>&gt; <BR>&gt; 
  Tony </FONT></FONT></DIV>
  <BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
    <BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
      <DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
      <DIV><FONT color=#0000ff 
size=2></FONT>&nbsp;</DIV></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>