Author Topic: Leadtek PVR2000  (Read 1503 times)

suv

  • Newbie
  • *
  • Posts: 5
    • View Profile
Leadtek PVR2000
« on: March 27, 2009, 07:07:34 pm »
Hi There,

I have a Leadtek PVR 2000 Analogue TV tuner CNXT LR6632 FM card. Can I use this card for Linuxmce ? I have heard that there are issues with audio. Can anyone help me out here ?

Thnx,
Suv

OldBob

  • Regular Poster
  • **
  • Posts: 16
    • View Profile
Re: Leadtek PVR2000
« Reply #1 on: March 28, 2009, 11:18:09 am »
suv

I also have this card.   I have not been able to get the audio to work from the tuner in LinuxMCE / Myth add in.   It does work with the onboard cable between the tuner card and the motherboard but is way out of sync due to myth's inbuilt delay.   Worse, once it starts (from Myth) the sound can't be turned off without a reboot.   I can't get anything out of the onboard mpeg encoder.   The good news is that I wanted to use it to capture from my cable box.   It does this provided the sound is added through the motherboard line in.   The on card sound inputs don't work.   I'm still trying and reading and will post again if I have success.

wjohnsaunders

  • First post!
  • Posts: 1
    • View Profile
Re: Leadtek PVR2000
« Reply #2 on: April 21, 2009, 08:11:35 am »
There is a bug in the cx88 driver when dealing with blackbird hardware. If you set the "always_analog" cx88xx module option to 1 it will pass the audio from the card input to the internal audio connector for connection to the motherboard, however it will overide the setting of EN_I2SOUT_ENABLE which controls audio output to the mpeg encoder so your mpeg will have no audio in it. However if you do not set "always_analog" then the "ctl" value passed into "set_audio_finish" function doesn't get written to the AUD_CTL register and the external ADC for S-video and composite inputs doesn't get enabled, result again is no audio.

The following patch against a 2.6.28 kernel provides working audio for the PVR2000 and hopefully other blackbird based mpeg encoder cards. The change is simple enough to apply by hand to other kernel versions. If anybody knows how to contact somebody with commit access at linuxtv.org then let me know, they don't appear to have a mechanism to report bugs much less accept patches.

The only remaining problem I have with this card is when switching between inputs. It seems that the mpeg encoder chip mostly "crashes" when you change inputs. If you close the device and reopen after changing inputs everything gets reset and it works, however this pushes responsibility for the driver bug back up to the applications which is not ideal. I am still fidling with the driver to see if I can force an mpeg encoder restart after the input switch. BTW this is all with MythTV, I am keen to try LinuxMCE but haven't had the time just yet. I have been using my PVR2000 to record cable via the compsite input and it has been working fine for a while with this patch.

diff -urN cx88-tvaudio.c cx88-tvaudio.c
--- cx88-tvaudio.c      2009-04-18 15:28:45.000000000 +1000
+++ cx88-tvaudio.c      2009-04-18 23:26:08.000000000 +1000
@@ -147,15 +147,16 @@
                cx_write(AUD_I2SINPUTCNTL, 4);
                cx_write(AUD_BAUDRATE, 1);
                /* 'pass-thru mode': this enables the i2s output to the mpeg enc
oder */
-               cx_set(AUD_CTL, EN_I2SOUT_ENABLE);
+               ctl |= EN_I2SOUT_ENABLE;
+               cx_write(AUD_CTL, ctl);
                cx_write(AUD_I2SOUTPUTCNTL, 1);
                cx_write(AUD_I2SCNTL, 0);
                /* cx_write(AUD_APB_IN_RATE_ADJ, 0); */
        }
        if ((always_analog) || (!(core->board.mpeg & CX88_MPEG_BLACKBIRD))) {
                ctl |= EN_DAC_ENABLE;
-               cx_write(AUD_CTL, ctl);
        }
+       cx_write(AUD_CTL, ctl);

        /* finish programming */
        cx_write(AUD_SOFT_RESET, 0x0000);