Re: avermedia A306 / PCIe-minicard (laptop)

2013-09-26 Thread remi
Hello


The firmware got fixed, the module option, needs a file-name only, no path , lol
for once


Well, the driver says Firmware OK ,


I have seen the message of Mauro, he must be right a hundred percent,

'cause we seem to have the initialisations ok, but , for me at lease no data
coming out from the tuner ...

and it has GPIOs , that have to be used accordinly ...

No data meaning no reaction, and no tuning .

Otherwise I think we have video from the tuner ( snow ! )  and composite (
parasites )



I will as soon as i can, take macro photos heads/tails , and draw a schematic


With the datasheets i have (all ;) ) I will find out the GPIOs where they are
going ... :)


will keep you all informed of course .



Best regards



Rémi


###

               cx25840 2-0044: loaded v4l-cx23885-avcore-01.fw firmware (16382
bytes)
[    4.392762] tuner 1-0061: Tuner -1 found with type(s) Radio TV.
[    4.395040] xc2028 1-0061: creating new instance
[    4.395043] xc2028 1-0061: type set to XCeive xc2028/xc3028 tuner
[    4.395214] cx23885[0]: registered device video1 [v4l2]
[    4.395333] cx23885[0]: registered device vbi0
[    4.395519] cx23885[0]: registered ALSA audio device
[    4.395870] xc2028 1-0061: Loading 80 firmware images from xc3028-v27.fw,
type: xc2028 firmware, ver 2.7
[    4.598038] xc2028 1-0061: Loading firmware for type=BASE (1), id
.
[    5.762199] xc2028 1-0061: Loading firmware for type=(0), id
b700.
[    5.777471] SCODE (2000), id b700:
[    5.777474] xc2028 1-0061: Loading SCODE for type=MONO SCODE HAS_IF_4320
(60008000), id 8000.
[    5.923492] cx23885_dev_checkrevision() Hardware revision = 0xb0
[    5.923499] cx23885[0]/0: found at :05:00.0, rev: 2, irq: 18, latency: 0,
mmio: 0xd300






 Le 18 septembre 2013 à 16:44, Anca Emanuel anca.eman...@gmail.com a écrit :
 
 
 On Tue, Aug 20, 2013 at 5:44 PM, remi r...@remis.cc wrote:
  Hello
 
  FYI
 
  I digged into the firmware problem a little,
 
 
  xc3028L-v36.fw  gets loaded by default , and the errors are as you saw 
earlier
 
 
  forcing the /lib/firmware/xc3028-v27.fw :
 
  [ 3569.941404] xc2028 2-0061: Could not load firmware
  /lib/firmware/xc3028-v27.fw
 
 
  So i searched the original dell/windows driver :
 
 
  I have these files in there :
 
  root@medeb:/home/gpunk/.wine/drive_c/dell/drivers/R169070# ls -lR
  .:
  total 5468
  drwxr-xr-x 2 gpunk gpunk4096 août  20 13:24 Driver_X86
  -rwxr-xr-x 1 gpunk gpunk 5589827 sept. 12  2007 Setup.exe
  -rw-r--r-- 1 gpunk gpunk 197 oct.   9  2007 setup.iss
 
  ./Driver_X86:
  total 1448
  -rw-r--r-- 1 gpunk gpunk 114338 sept.  7  2007 A885VCap_ASUS_DELL_2.inf
  -rw-r--r-- 1 gpunk gpunk  15850 sept. 11  2007 a885vcap.cat
  -rw-r--r-- 1 gpunk gpunk 733824 sept.  7  2007 A885VCap.sys
  -rw-r--r-- 1 gpunk gpunk 147870 avril 20  2007 cpnotify.ax
  -rw-r--r-- 1 gpunk gpunk 376836 avril 20  2007 cx416enc.rom
  -rw-r--r-- 1 gpunk gpunk  65536 avril 20  2007 cxtvrate.dll
  -rw-r--r-- 1 gpunk gpunk  16382 avril 20  2007 merlinC.rom
 
 I think merlinC.rom is your xc3028-v27.fw
 
 Compare it to http://www.linuxtv.org/wiki/index.php/Xceive_XC3028/XC2028
 the file extracted there.
 
  root@medeb:/home/gpunk/.wine/drive_c/dell/drivers/R169070#
 
  root@medeb:/home/gpunk/.wine/drive_c/dell/drivers/R169070/Driver_X86# grep
  firmware *
  Fichier binaire A885VCap.sys concordant
  root@medeb:/home/gpunk/.wine/drive_c/dell/drivers/R169070/Driver_X86#
 
 
 
  I'll try to find a way to extract maybe the right firmware for what this 
card
  ,
 
  I'd love some help :)
 
 Mauro replied this
 http://www.spinics.net/lists/linux-media/msg25746.html to me in 2010.
 
 Then I removed the card from my PC.
 
 Some years later I tried again. This time I found this patch to give
 me some hints: http://www.spinics.net/lists/linux-media/msg43069.html
 After compiling several versions of the patch for the upstream kernel
 (try and hope type) I posted what works for me.
 
 Tutorial to make kernel patches: http://www.youtube.com/watch?v=LLBrBBImJt4
 Tutorial to set git send-email correctly for git: 
https://coderwall.com/p/dp-gka
 Tip for first kernel patch: send to your address first to spot any errors.
 Tip for linux-media patchwork to automatically get yours: use labels
 (search for discussion about this).
 
 I hope this helps.
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: avermedia A306 / PCIe-minicard (laptop) / CX23885

2013-09-17 Thread Steven Toth
 Hello

Hello Remi!

Thank you for looking at the Avercard with the CX23885 driver.


 Antti, redirected me toward you,

What exactly is your question?

 And

 If it's at the least at the same stage as the HC81 , I think it deserve's to
 be listed in cards.h

Possibly. Tell us again 1) what you have working reliably 2) what
isn't working but the driver is exposing and 3) what the driver is
exposing but has not been tested.

 So people will know right away, that this card has been identified by the V4L
 community, and dont have

Anyone working on that card would arrive here on the mailing list, I
don't think that's going to be an issue. I suggest you focus on
getting feature of the card working reliably, produce a patchset and
I'm sure it will get reviewed, refined then eventually merged.

Other comments below.

  +   [CX23885_BOARD_AVERMEDIA_A306] = {
  +.name   = AVerTV Hybrid Minicard PCIe A306,
  +.tuner_type = TUNER_XC2028,
  +.tuner_addr = 0x61, /* 0xc2  1 */
  +.tuner_bus  = 1,
  +.porta  = CX23885_ANALOG_VIDEO,
  +   .portb  = CX23885_MPEG_ENCODER,
  +.input  = {{
  +.type   = CX23885_VMUX_TELEVISION,
  +.vmux   = CX25840_VIN2_CH1 |
  +  CX25840_VIN5_CH2 |
  +  CX25840_NONE0_CH3 |
  +  CX25840_NONE1_CH3,
  +.amux   = CX25840_AUDIO8,
  +}, {
  +.type   = CX23885_VMUX_SVIDEO,
  +.vmux   = CX25840_VIN8_CH1 |
  +  CX25840_NONE_CH2 |
  +  CX25840_VIN7_CH3 |
  +  CX25840_SVIDEO_ON,
  +.amux   = CX25840_AUDIO6,
  +}, {
  +.type   = CX23885_VMUX_COMPONENT,
  +.vmux   = CX25840_VIN1_CH1 |
  +  CX25840_NONE_CH2 |
  +  CX25840_NONE0_CH3 |
  +  CX25840_NONE1_CH3,
  +.amux   = CX25840_AUDIO6,
  +}},
  +
  +   }

Does the card have a MPEG2 hardware compressor and is it functioning
properly? (/dev/video1)

Are both svideo and component inputs working correctly in tvtime?

What about audio inputs? Does the card have any audio inputs and is
the driver acting and exposing those features correctly?

If not then please remove any of these sections.

  +case CX23885_BOARD_AVERMEDIA_A306:
  +cx_clear(MC417_CTL, 1);
  +/* GPIO-0,1,2 setup direction as output */
  +cx_set(GP0_IO, 0x0007);
  +mdelay(10);
  +/* AF9013 demod reset */
  +cx_set(GP0_IO, 0x00010001);
  +mdelay(10);
  +cx_clear(GP0_IO, 0x00010001);
  +mdelay(10);
  +cx_set(GP0_IO, 0x00010001);
  +mdelay(10);
  +/* demod tune? */
  +cx_clear(GP0_IO, 0x00030003);
  +mdelay(10);
  +cx_set(GP0_IO, 0x00020002);
  +mdelay(10);
  +cx_set(GP0_IO, 0x00010001);
  +mdelay(10);
  +cx_clear(GP0_IO, 0x00020002);
  +/* XC3028L tuner reset */
  +cx_set(GP0_IO, 0x00040004);
  +cx_clear(GP0_IO, 0x00040004);
  +cx_set(GP0_IO, 0x00040004);
  +mdelay(60);
  +break;

You're setting and clearing the GPIO direction enable registers (upper
16 bits), this isn't a good idea.

If you want to drive a GPIO in a specific direction (lower 8 bits),
perhaps for a reset, instead do this:

/* AF9013 demod reset */
cx_set(GP0_IO, 0x00010001); /* Establish the direction of the GPIO and
it's signal level)
mdelay(10);
cx_clear(GP0_IO, 0x0001); /* change the signal level, drive to low */
mdelay(10);
cx_set(GP0_IO, 0x0001); /* back to high */
mdelay(10);

Repeat this example for other other 'demod tune' and 3028 resets you
are doing, don't toggle the upper 16bits, else you leave the GPIO
floating, a bad idea.

- Steve

-- 
Steven Toth - Kernel Labs
http://www.kernellabs.com
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: avermedia A306 / PCIe-minicard (laptop) / CX23885

2013-09-17 Thread remi
Hello :)

Thnx for the reply !


Well, I do not have the cables ... it's a laptop card, orginally for a Dell,

I am doing my tests on an Acer,


The Video0 dev , composite/s-video is showing an analog signal, i guess a
noise picture because not hooked-up,

but bottom half is sometimes green .

Analog scanning/reception = NULL , I might have to check again the antenna
connexion,


For the Mpeg, negative, it's a 9013 chip, I still have to discecte the 9015
driver and pull-out

the 9013 spcific data , iguess .


What I need the most, Is a big picture of the V4L API , like an organigram of
what is where ( initialising this or that,

handeling setups - and controls)


I code, but going thru others Code, is always like playing Maze ... :)
especially an API in a whole System Package...


But I am searching on my side :)


I there a dummy /test driver for PCIe cards I can study ?


Best regards


Rémi.


 Le 17 septembre 2013 à 15:38, Steven Toth st...@kernellabs.com a écrit :


  Hello

 Hello Remi!

 Thank you for looking at the Avercard with the CX23885 driver.

 
  Antti, redirected me toward you,

 What exactly is your question?

  And
 
  If it's at the least at the same stage as the HC81 , I think it deserve's
  to
  be listed in cards.h

 Possibly. Tell us again 1) what you have working reliably 2) what
 isn't working but the driver is exposing and 3) what the driver is
 exposing but has not been tested.

  So people will know right away, that this card has been identified by the
  V4L
  community, and dont have

 Anyone working on that card would arrive here on the mailing list, I
 don't think that's going to be an issue. I suggest you focus on
 getting feature of the card working reliably, produce a patchset and
 I'm sure it will get reviewed, refined then eventually merged.

 Other comments below.

   +       [CX23885_BOARD_AVERMEDIA_A306] = {
   +                .name           = AVerTV Hybrid Minicard PCIe A306,
   +                .tuner_type     = TUNER_XC2028,
   +                .tuner_addr     = 0x61, /* 0xc2  1 */
   +                .tuner_bus      = 1,
   +                .porta          = CX23885_ANALOG_VIDEO,
   +               .portb          = CX23885_MPEG_ENCODER,
   +                .input          = {{
   +                        .type   = CX23885_VMUX_TELEVISION,
   +                        .vmux   = CX25840_VIN2_CH1 |
   +                                  CX25840_VIN5_CH2 |
   +                                  CX25840_NONE0_CH3 |
   +                                  CX25840_NONE1_CH3,
   +                        .amux   = CX25840_AUDIO8,
   +                }, {
   +                        .type   = CX23885_VMUX_SVIDEO,
   +                        .vmux   = CX25840_VIN8_CH1 |
   +                                  CX25840_NONE_CH2 |
   +                                  CX25840_VIN7_CH3 |
   +                                  CX25840_SVIDEO_ON,
   +                        .amux   = CX25840_AUDIO6,
   +                }, {
   +                        .type   = CX23885_VMUX_COMPONENT,
   +                        .vmux   = CX25840_VIN1_CH1 |
   +                                  CX25840_NONE_CH2 |
   +                                  CX25840_NONE0_CH3 |
   +                                  CX25840_NONE1_CH3,
   +                        .amux   = CX25840_AUDIO6,
   +                }},
   +
   +       }

 Does the card have a MPEG2 hardware compressor and is it functioning
 properly? (/dev/video1)

 Are both svideo and component inputs working correctly in tvtime?

 What about audio inputs? Does the card have any audio inputs and is
 the driver acting and exposing those features correctly?

 If not then please remove any of these sections.

   +        case CX23885_BOARD_AVERMEDIA_A306:
   +                cx_clear(MC417_CTL, 1);
   +                /* GPIO-0,1,2 setup direction as output */
   +                cx_set(GP0_IO, 0x0007);
   +                mdelay(10);
   +                /* AF9013 demod reset */
   +                cx_set(GP0_IO, 0x00010001);
   +                mdelay(10);
   +                cx_clear(GP0_IO, 0x00010001);
   +                mdelay(10);
   +                cx_set(GP0_IO, 0x00010001);
   +                mdelay(10);
   +                /* demod tune? */
   +                cx_clear(GP0_IO, 0x00030003);
   +                mdelay(10);
   +                cx_set(GP0_IO, 0x00020002);
   +                mdelay(10);
   +                cx_set(GP0_IO, 0x00010001);
   +                mdelay(10);
   +                cx_clear(GP0_IO, 0x00020002);
   +                /* XC3028L tuner reset */
   +                cx_set(GP0_IO, 0x00040004);
   +                cx_clear(GP0_IO, 0x00040004);
   +                cx_set(GP0_IO, 0x00040004);
   +                mdelay(60);
   +                break;

 You're setting and clearing the GPIO direction enable registers (upper
 16 bits), this isn't a good idea.

 If you want to drive a GPIO in a specific direction 

Re: avermedia A306 / PCIe-minicard (laptop) / CX23885

2013-09-17 Thread Steven Toth
 Hello :)

 Thnx for the reply !

You are welcome.

 Well, I do not have the cables ... it's a laptop card, orginally for a Dell,

 I am doing my tests on an Acer,

So you don't have a valid signal to test your changes with?

 The Video0 dev , composite/s-video is showing an analog signal, i guess a
 noise picture because not hooked-up,

Hmm. Possibly, or possible the video decoder and video patch is not configured.


 but bottom half is sometimes green .

So you haven't seen ANY stable video from any analog input?

 Analog scanning/reception = NULL , I might have to check again the antenna
 connexion,

OK.

 For the Mpeg, negative, it's a 9013 chip, I still have to discecte the 9015
 driver and pull-out

 the 9013 spcific data , iguess .

OK. No mpeg either.

So you don't have anything working so far, that's my reading of your
current state.

 What I need the most, Is a big picture of the V4L API , like an organigram of
 what is where ( initialising this or that,

linuxtv.org


 handeling setups - and controls)

V4L2 Specification at linuxtv.org

 I there a dummy /test driver for PCIe cards I can study ?

CX23885 is a good place to start. It's fully functional and matches
the hardware you have to experiment with.

- Steve

-- 
Steven Toth - Kernel Labs
http://www.kernellabs.com
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: avermedia A306 / PCIe-minicard (laptop)

2013-09-11 Thread remi
I agree, but at least we have video, we can at least use a composite webcam , or
a camcorder / vcr  ...

my self, i used video capture cards this way since the 90's , a lot faster than
USB webcams ...


For the 9013, do you think it's a matter of porting the existing USB code to
PCIe/I2C ?

I see a driver with 9015 that includes it,


(As I said, here we have af9013 as one stanalone CHIP ...)

If you know of a good reading, i'll be more than glad to go thru it , I paused
this project
because I dont want to play Maze ( :) ) in the sources, I do program, even in
assembly,

but didnt read alot about dvb/v4l api architecture ...


I CC the mailing list , if anybody else can orient me also  :)



Regards



 Le 11 septembre 2013 à 14:46, Antti Palosaari cr...@iki.fi a écrit :


 Hello
 I think you didn't get it working as I didn't saw af9013 attached?


 Antti

 On 09/11/2013 03:27 PM, remi wrote:
  Hi Antti
 
 
  I hope you'r doing ok, I had zero answers for my work ... :p
 
 
  Are you on vacation ? :)
 
 
  Is there anything else I can do to have this card supported / my little
  patch
  assimilated  ? :)
 
  I can really go further and have even the complete wiring/ PCB   reverse
  engeneered if I get some attention :)
 
 
  Or do I have to contact directly the maintainer of the XC3028 or the CX23885
  ...
  ?
 
 
  Best regards
 
 
  Le 19 août 2013 à 17:18, Antti Palosaari cr...@iki.fi a écrit :
 
 
  On 08/19/2013 05:18 PM, remi wrote:
  Hello
 
  I have this card since months,
 
  http://www.avermedia.com/avertv/Product/ProductDetail.aspx?Id=376SI=true
 
  I have finally retested it with the cx23885 driver : card=39
 
 
 
  If I could do anything to identify : [    2.414734] cx23885[0]: i2c scan:
  found
  device @ 0x66  [???]
 
  Or hookup the xc5000 etc
 
  I'll be more than glad .
 
 
 
 
  ps: i opened it up a while ago,i saw an af9013 chip ? dvb-tuner looks like
  maybe the device @ 0x66 i2c
 
  I will double check , and re-write-down all the chips , i think 3 .
 
  You have to identify all the chips, for DVB-T there is tuner missing.
 
  USB-interface: cx23885
  DVB-T demodulator: AF9013
  RF-tuner: ?
 
  If there is existing driver for used RF-tuner it comes nice hacking
  project for some newcomer.
 
  It is just tweaking and hacking to find out all settings. AF9013 driver
  also needs likely some changes, currently it is used only for devices
  having AF9015 with integrated AF9013, or AF9015 dual devices having
  AF9015 + external AF9013 providing second tuner.
 
  I have bought quite similar AverMedia A301 ages back as I was looking
  for that AF9013 model, but maybe I have bought just wrong one... :)
 
 
  regards
  Antti
 
 
  --
  http://palosaari.fi/
  --
  To unsubscribe from this list: send the line unsubscribe linux-media in
  the body of a message to majord...@vger.kernel.org
  More majordomo info at  http://vger.kernel.org/majordomo-info.html


 --
 http://palosaari.fi/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: avermedia A306 / PCIe-minicard (laptop)

2013-09-11 Thread Antti Palosaari

Hello
I don't know anything about CX23885 analog stuff. My interest in that 
case comes from AF9013 (digitial TV). I think it is Steven Toth 
st...@linuxtv.org who is mostly responsible as he has done that 
driver. Resend your patches to linux-media mailing list and Cc Steven.


regards
Antti


On 09/11/2013 04:10 PM, remi wrote:

I agree, but at least we have video, we can at least use a composite webcam , or
a camcorder / vcr  ...

my self, i used video capture cards this way since the 90's , a lot faster than
USB webcams ...


For the 9013, do you think it's a matter of porting the existing USB code to
PCIe/I2C ?

I see a driver with 9015 that includes it,


(As I said, here we have af9013 as one stanalone CHIP ...)

If you know of a good reading, i'll be more than glad to go thru it , I paused
this project
because I dont want to play Maze ( :) ) in the sources, I do program, even in
assembly,

but didnt read alot about dvb/v4l api architecture ...


I CC the mailing list , if anybody else can orient me also  :)



Regards




Le 11 septembre 2013 à 14:46, Antti Palosaari cr...@iki.fi a écrit :


Hello
I think you didn't get it working as I didn't saw af9013 attached?


Antti

On 09/11/2013 03:27 PM, remi wrote:

Hi Antti


I hope you'r doing ok, I had zero answers for my work ... :p


Are you on vacation ? :)


Is there anything else I can do to have this card supported / my little
patch
assimilated  ? :)

I can really go further and have even the complete wiring/ PCB   reverse
engeneered if I get some attention :)


Or do I have to contact directly the maintainer of the XC3028 or the CX23885
...
?


Best regards



Le 19 août 2013 à 17:18, Antti Palosaari cr...@iki.fi a écrit :


On 08/19/2013 05:18 PM, remi wrote:

Hello

I have this card since months,

http://www.avermedia.com/avertv/Product/ProductDetail.aspx?Id=376SI=true

I have finally retested it with the cx23885 driver : card=39



If I could do anything to identify : [2.414734] cx23885[0]: i2c scan:
found
device @ 0x66  [???]

Or hookup the xc5000 etc

I'll be more than glad .






ps: i opened it up a while ago,i saw an af9013 chip ? dvb-tuner looks like
maybe the device @ 0x66 i2c

I will double check , and re-write-down all the chips , i think 3 .


You have to identify all the chips, for DVB-T there is tuner missing.

USB-interface: cx23885
DVB-T demodulator: AF9013
RF-tuner: ?

If there is existing driver for used RF-tuner it comes nice hacking
project for some newcomer.

It is just tweaking and hacking to find out all settings. AF9013 driver
also needs likely some changes, currently it is used only for devices
having AF9015 with integrated AF9013, or AF9015 dual devices having
AF9015 + external AF9013 providing second tuner.

I have bought quite similar AverMedia A301 ages back as I was looking
for that AF9013 model, but maybe I have bought just wrong one... :)


regards
Antti


--
http://palosaari.fi/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



--
http://palosaari.fi/



--
http://palosaari.fi/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: avermedia A306 / PCIe-minicard (laptop) / CX23885

2013-08-23 Thread remi
I resubmit with the proper keyword , sorry for the pollution .

Signed-off-by: Rémi PUTHOMME-ESSAISSI r...@remis.cc

Hello

I suggest this patch,

For v4l/cx23885.h
    v4l/cx23885-video.c
and v4l/cx23885-cards.c

Status,

AVerMedia A306 MiniCard Hybrid DVB-T  / 14f1:8852 (rev 02) Subsystem: 1461:c139

Is beeing regognized and loaded by the driver, by it's PCI ID ,

The correct firmwares are loaded fully notably by the Xceive 3028 .

I'm testing the mpeg side, not fully yet (firmware) .

The full dmesg output, with all relevant drivers set debug=1 , is atteched to
the email .

I do not have all the cables to test (it's a laptop ..:) )
so testing is more than welcome.

Best regards

Rémi PUTHOMME-ESSAISSI .



root@medeb:~/v4l# diff -u  media_build/v4l/cx23885-cards.c
media_build.remi/v4l/cx23885-cards.c
--- media_build/v4l/cx23885-cards.c     2012-12-28 00:04:05.0 +0100
+++ media_build.remi/v4l/cx23885-cards.c        2013-08-21 14:15:54.173195979
+0200
@@ -604,8 +604,39 @@
                                  CX25840_NONE0_CH3 |
                                  CX25840_NONE1_CH3,
                        .amux   = CX25840_AUDIO6,
-               } },
-       }
+               }}
+        },
+       [CX23885_BOARD_AVERMEDIA_A306] = {
+                .name           = AVerTV Hybrid Minicard PCIe A306,
+                .tuner_type     = TUNER_XC2028,
+                .tuner_addr     = 0x61, /* 0xc2  1 */
+                .tuner_bus      = 1,
+                .porta          = CX23885_ANALOG_VIDEO,
+               .portb          = CX23885_MPEG_ENCODER,
+                .input          = {{
+                        .type   = CX23885_VMUX_TELEVISION,
+                        .vmux   = CX25840_VIN2_CH1 |
+                                  CX25840_VIN5_CH2 |
+                                  CX25840_NONE0_CH3 |
+                                  CX25840_NONE1_CH3,
+                        .amux   = CX25840_AUDIO8,
+                }, {
+                        .type   = CX23885_VMUX_SVIDEO,
+                        .vmux   = CX25840_VIN8_CH1 |
+                                  CX25840_NONE_CH2 |
+                                  CX25840_VIN7_CH3 |
+                                  CX25840_SVIDEO_ON,
+                        .amux   = CX25840_AUDIO6,
+                }, {
+                        .type   = CX23885_VMUX_COMPONENT,
+                        .vmux   = CX25840_VIN1_CH1 |
+                                  CX25840_NONE_CH2 |
+                                  CX25840_NONE0_CH3 |
+                                  CX25840_NONE1_CH3,
+                        .amux   = CX25840_AUDIO6,
+                }},
+
+       }       
 };
 const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards);
 
@@ -841,7 +872,12 @@
                .subvendor = 0x1461,
                .subdevice = 0xd939,
                .card      = CX23885_BOARD_AVERMEDIA_HC81R,
-       },
+       }, {
+                .subvendor = 0x1461,
+                .subdevice = 0xc139,
+                .card      = CX23885_BOARD_AVERMEDIA_A306,
+        },
+       
 };
 const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids);
 
@@ -1069,6 +1105,10 @@
                /* XC3028L Reset Command */
                bitmask = 1  2;
                break;
+       case CX23885_BOARD_AVERMEDIA_A306:
+                /* XC3028L Reset Command */
+                bitmask = 1  2;
+                break;
        }
 
        if (bitmask) {
@@ -1394,6 +1434,34 @@
                cx_set(GP0_IO, 0x00040004);
                mdelay(60);
                break;
+        case CX23885_BOARD_AVERMEDIA_A306:
+                cx_clear(MC417_CTL, 1);
+                /* GPIO-0,1,2 setup direction as output */
+                cx_set(GP0_IO, 0x0007);
+                mdelay(10);
+                /* AF9013 demod reset */
+                cx_set(GP0_IO, 0x00010001);
+                mdelay(10);
+                cx_clear(GP0_IO, 0x00010001);
+                mdelay(10);
+                cx_set(GP0_IO, 0x00010001);
+                mdelay(10);
+                /* demod tune? */
+                cx_clear(GP0_IO, 0x00030003);
+                mdelay(10);
+                cx_set(GP0_IO, 0x00020002);
+                mdelay(10);
+                cx_set(GP0_IO, 0x00010001);
+                mdelay(10);
+                cx_clear(GP0_IO, 0x00020002);
+                /* XC3028L tuner reset */
+                cx_set(GP0_IO, 0x00040004);
+                cx_clear(GP0_IO, 0x00040004);
+                cx_set(GP0_IO, 0x00040004);
+                mdelay(60);
+                break;
+
+
        }
 }
 
@@ -1623,6 +1691,21 @@
                ts2-ts_clk_en_val = 0x1; /* Enable TS_CLK */
                ts2-src_sel_val     = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
                break;
+
+        case CX23885_BOARD_AVERMEDIA_A306:
+                /* Defaults for VID B */
+                ts1-gen_ctrl_val  = 0x4; /* Parallel */
+                ts1-ts_clk_en_val = 0x1; /* 

Re: avermedia A306 / PCIe-minicard (laptop)

2013-08-20 Thread remi
Hello

I have just putdown my screwdrivers :)


Yes it was three ICs


on the bottom-side , no heatsinks (digital reception, that's why i guess) , is
an AF9013-N1

on the top-side, with a heatsink : CX23885-13Z , PCIe A/V controler

on the top-side, with heat-sink + radio-isolation (aluminum box) XC3028ACQ ,
so the analog reception .

 
Its all on a PCIe bus, the reason why i baught it ... :)



To resume :


AF9013-N1

CX23885-13Z

XC3028ACQ


the drivers while scanning


gpunk@medeb:~/Bureau$ dmesg |grep i2c
[    2.363784] cx23885[0]: i2c scan: found device @ 0xa0  [eeprom]
[    2.384721] cx23885[0]: i2c scan: found device @ 0xc2 
[tuner/mt2131/tda8275/xc5000/xc3028]
[    2.391502] cx23885[0]: i2c scan: found device @ 0x66  [???]
[    2.392339] cx23885[0]: i2c scan: found device @ 0x88  [cx25837]
[    2.392831] cx23885[0]: i2c scan: found device @ 0x98  [flatiron]
[    5.306751] i2c /dev entries driver
gpunk@medeb:~/Bureau$


 4.560428] xc2028 2-0061: xc2028_get_reg 0008 called
[    4.560989] xc2028 2-0061: Device is Xceive 0 version 0.0, firmware version
0.0
[    4.560990] xc2028 2-0061: Incorrect readback of firmware version.
[ *    4.561184] xc2028 2-0061: Read invalid device hardware information - tuner
hung?
[ *    4.561386] xc2028 2-0061: 0.0      0.0
[ *    4.674072] xc2028 2-0061: divisor= 00 00 64 00 (freq=400.000)
[    4.697830] cx23885_dev_checkrevision() Hardware revision = 0xb0
[    4.698029] cx23885[0]/0: found at :05:00.0, rev: 2, irq: 18, latency: 0,
mmio: 0xd300

* -- I bypassed the goto fail to start debugging a little bit the
tuner-xc2028.c/ko ... lines 869
...



The firmware doesnt get all loaded .
gpunk@medeb:~/Bureau$  uname -a
Linux medeb 3.11.0-rc6remi #1 SMP PREEMPT Mon Aug 19 13:30:04 CEST 2013 i686
GNU/Linux
gpunk@medeb:~/Bureau$


With yesterday's tarball from linuxtv.org / media-build git .



Best regards

Rémi




 Le 19 août 2013 à 17:18, Antti Palosaari cr...@iki.fi a écrit :


 On 08/19/2013 05:18 PM, remi wrote:
  Hello
 
  I have this card since months,
 
  http://www.avermedia.com/avertv/Product/ProductDetail.aspx?Id=376SI=true
 
  I have finally retested it with the cx23885 driver : card=39
 
 
 
  If I could do anything to identify : [    2.414734] cx23885[0]: i2c scan:
  found
  device @ 0x66  [???]
 
  Or hookup the xc5000 etc
 
  I'll be more than glad .
 


 
  ps: i opened it up a while ago,i saw an af9013 chip ? dvb-tuner looks like
  maybe the device @ 0x66 i2c
 
  I will double check , and re-write-down all the chips , i think 3 .

 You have to identify all the chips, for DVB-T there is tuner missing.

 USB-interface: cx23885
 DVB-T demodulator: AF9013
 RF-tuner: ?

 If there is existing driver for used RF-tuner it comes nice hacking
 project for some newcomer.

 It is just tweaking and hacking to find out all settings. AF9013 driver
 also needs likely some changes, currently it is used only for devices
 having AF9015 with integrated AF9013, or AF9015 dual devices having
 AF9015 + external AF9013 providing second tuner.

 I have bought quite similar AverMedia A301 ages back as I was looking
 for that AF9013 model, but maybe I have bought just wrong one... :)


 regards
 Antti


 --
 http://palosaari.fi/
 --
 To unsubscribe from this list: send the line unsubscribe linux-media in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: avermedia A306 / PCIe-minicard (laptop)

2013-08-20 Thread remi
Hello

FYI

I digged into the firmware problem a little,


xc3028L-v36.fw  gets loaded by default , and the errors are as you saw earlier


forcing the /lib/firmware/xc3028-v27.fw : 

[ 3569.941404] xc2028 2-0061: Could not load firmware
/lib/firmware/xc3028-v27.fw


So i searched the original dell/windows driver :


I have these files in there :

root@medeb:/home/gpunk/.wine/drive_c/dell/drivers/R169070# ls -lR
.:
total 5468
drwxr-xr-x 2 gpunk gpunk    4096 août  20 13:24 Driver_X86
-rwxr-xr-x 1 gpunk gpunk 5589827 sept. 12  2007 Setup.exe
-rw-r--r-- 1 gpunk gpunk     197 oct.   9  2007 setup.iss

./Driver_X86:
total 1448
-rw-r--r-- 1 gpunk gpunk 114338 sept.  7  2007 A885VCap_ASUS_DELL_2.inf
-rw-r--r-- 1 gpunk gpunk  15850 sept. 11  2007 a885vcap.cat
-rw-r--r-- 1 gpunk gpunk 733824 sept.  7  2007 A885VCap.sys
-rw-r--r-- 1 gpunk gpunk 147870 avril 20  2007 cpnotify.ax
-rw-r--r-- 1 gpunk gpunk 376836 avril 20  2007 cx416enc.rom
-rw-r--r-- 1 gpunk gpunk  65536 avril 20  2007 cxtvrate.dll
-rw-r--r-- 1 gpunk gpunk  16382 avril 20  2007 merlinC.rom
root@medeb:/home/gpunk/.wine/drive_c/dell/drivers/R169070#

root@medeb:/home/gpunk/.wine/drive_c/dell/drivers/R169070/Driver_X86# grep
firmware *
Fichier binaire A885VCap.sys concordant
root@medeb:/home/gpunk/.wine/drive_c/dell/drivers/R169070/Driver_X86#



I'll try to find a way to extract maybe the right firmware for what this card
,

I'd love some help :)

Good news there are ALOT of infos on how to initialize the card in the .INF , so

many problems, i think, are partially solved (I need to implement them )

I'll send a copy of theses to anyone who wishes,

Or see
http://www.dell.com/support/drivers/us/en/04/DriverDetails?driverId=R169070     
 :)

Regards

Rémi





 Le 20 août 2013 à 12:32, remi r...@remis.cc a écrit :


 Hello

 I have just putdown my screwdrivers :)


 Yes it was three ICs


 on the bottom-side , no heatsinks (digital reception, that's why i guess) , is
 an AF9013-N1

 on the top-side, with a heatsink : CX23885-13Z , PCIe A/V controler

 on the top-side, with heat-sink + radio-isolation (aluminum box) XC3028ACQ ,
 so the analog reception .

  
 Its all on a PCIe bus, the reason why i baught it ... :)



 To resume :


 AF9013-N1

 CX23885-13Z

 XC3028ACQ


 the drivers while scanning


 gpunk@medeb:~/Bureau$ dmesg |grep i2c
 [    2.363784] cx23885[0]: i2c scan: found device @ 0xa0  [eeprom]
 [    2.384721] cx23885[0]: i2c scan: found device @ 0xc2 
 [tuner/mt2131/tda8275/xc5000/xc3028]
 [    2.391502] cx23885[0]: i2c scan: found device @ 0x66  [???]
 [    2.392339] cx23885[0]: i2c scan: found device @ 0x88  [cx25837]
 [    2.392831] cx23885[0]: i2c scan: found device @ 0x98  [flatiron]
 [    5.306751] i2c /dev entries driver
 gpunk@medeb:~/Bureau$


  4.560428] xc2028 2-0061: xc2028_get_reg 0008 called
 [    4.560989] xc2028 2-0061: Device is Xceive 0 version 0.0, firmware version
 0.0
 [    4.560990] xc2028 2-0061: Incorrect readback of firmware version.
 [ *    4.561184] xc2028 2-0061: Read invalid device hardware information -
 tuner
 hung?
 [ *    4.561386] xc2028 2-0061: 0.0      0.0
 [ *    4.674072] xc2028 2-0061: divisor= 00 00 64 00 (freq=400.000)
 [    4.697830] cx23885_dev_checkrevision() Hardware revision = 0xb0
 [    4.698029] cx23885[0]/0: found at :05:00.0, rev: 2, irq: 18, latency:
 0,
 mmio: 0xd300

 * -- I bypassed the goto fail to start debugging a little bit the
 tuner-xc2028.c/ko ... lines 869
 ...



 The firmware doesnt get all loaded .
 gpunk@medeb:~/Bureau$  uname -a
 Linux medeb 3.11.0-rc6remi #1 SMP PREEMPT Mon Aug 19 13:30:04 CEST 2013 i686
 GNU/Linux
 gpunk@medeb:~/Bureau$


 With yesterday's tarball from linuxtv.org / media-build git .



 Best regards

 Rémi




  Le 19 août 2013 à 17:18, Antti Palosaari cr...@iki.fi a écrit :
 
 
  On 08/19/2013 05:18 PM, remi wrote:
   Hello
  
   I have this card since months,
  
   http://www.avermedia.com/avertv/Product/ProductDetail.aspx?Id=376SI=true
  
   I have finally retested it with the cx23885 driver : card=39
  
  
  
   If I could do anything to identify : [    2.414734] cx23885[0]: i2c scan:
   found
   device @ 0x66  [???]
  
   Or hookup the xc5000 etc
  
   I'll be more than glad .
  
 
 
  
   ps: i opened it up a while ago,i saw an af9013 chip ? dvb-tuner looks like
   maybe the device @ 0x66 i2c
  
   I will double check , and re-write-down all the chips , i think 3 .
 
  You have to identify all the chips, for DVB-T there is tuner missing.
 
  USB-interface: cx23885
  DVB-T demodulator: AF9013
  RF-tuner: ?
 
  If there is existing driver for used RF-tuner it comes nice hacking
  project for some newcomer.
 
  It is just tweaking and hacking to find out all settings. AF9013 driver
  also needs likely some changes, currently it is used only for devices
  having AF9015 with integrated AF9013, or AF9015 dual devices having
  AF9015 + external AF9013 providing second tuner.
 
  I have bought quite similar AverMedia A301 ages back as I was looking
  

Re: avermedia A306 / PCIe-minicard (laptop)

2013-08-20 Thread remi
Hello

Seeing that card=39 worked, and, that the A306 doesnt use the LowPower version
of the XC3028 , HC81 is an expressCard == lowpower

A306 is the PCIe minicard version == not LowPower ,


I decided to clone the HC81 entries in cx23885-video.c, cx23885.h ,
cx23885-cards.c

And intruct it to load then the xc3028-v27.fw instead,

Seems to me alot better , see below ,

And I added so, the card=40 in the definitions ...

I dont think submiting a patch for this woth it yet ...

as none of the tuners get created ,

For the analog video composite/s-video, i'll be able to test it when i find the
right cable .



root@medeb:~/v4l/media_build/v4l# grep A306 *
cx23885-cards.c:        [CX23885_BOARD_AVERMEDIA_A306] = {
cx23885-cards.c:                .name           = AVerTV Hybrid Minicard PCIe
A306,
cx23885-cards.c:                .card      = CX23885_BOARD_AVERMEDIA_A306,
cx23885-cards.c:        case CX23885_BOARD_AVERMEDIA_A306:
cx23885-cards.c:        case CX23885_BOARD_AVERMEDIA_A306:
cx23885-cards.c:        case CX23885_BOARD_AVERMEDIA_A306:
cx23885-cards.c:        case CX23885_BOARD_AVERMEDIA_A306:
cx23885.h:#define CX23885_BOARD_AVERMEDIA_A306          40
cx23885-video.c:                (dev-board == CX23885_BOARD_AVERMEDIA_A306)) {
cx23885-video.c:                        if (dev-board ==
CX23885_BOARD_AVERMEDIA_A306) {




                        if (dev-board == CX23885_BOARD_AVERMEDIA_HC81R) {
                                struct xc2028_ctrl ctrl = {
                                        .fname = xc3028L-v36.fw,
                                        .max_len = 64
                                };
                                struct v4l2_priv_tun_config cfg = {
                                        .tuner = dev-tuner_type,
                                        .priv = ctrl
                                };
                                v4l2_subdev_call(sd, tuner, s_config, cfg);
                        }
                        if (dev-board == CX23885_BOARD_AVERMEDIA_A306) {
                                struct xc2028_ctrl ctrl = {
                                     /* .fname = xc3028L-v36.fw, */
                                        .fname = xc3028-v27.fw,
                                        .max_len = 64
                                };
                                struct v4l2_priv_tun_config cfg = {
                                        .tuner = dev-tuner_type,
                                        .priv = ctrl
                                };
                                v4l2_subdev_call(sd, tuner, s_config, cfg);
                        }



[32653.087693] cx23885 driver version 0.0.3 loaded
[32653.088091] CORE cx23885[0]: subsystem: 1461:c139, board: AVerTV Hybrid
Minicard PCIe A306 [card=40,autodetected]
[32653.318339] cx23885[0]: scan bus 0:
[32653.329792] cx23885[0]: i2c scan: found device @ 0xa0  [eeprom]
[32653.336716] cx23885[0]: scan bus 1:
[32653.350543] cx23885[0]: i2c scan: found device @ 0xc2 
[tuner/mt2131/tda8275/xc5000/xc3028]
[32653.355042] cx23885[0]: scan bus 2:
[32653.357050] cx23885[0]: i2c scan: found device @ 0x66  [???]
[32653.357699] cx23885[0]: i2c scan: found device @ 0x88  [cx25837]
[32653.358011] cx23885[0]: i2c scan: found device @ 0x98  [flatiron]
[32653.391211] cx25840 3-0044: cx23885 A/V decoder found @ 0x88 (cx23885[0])
[32654.031992] cx25840 3-0044: loaded v4l-cx23885-avcore-01.fw firmware (16382
bytes)
[32654.049675] tuner 2-0061: Tuner -1 found with type(s) Radio TV.
[32654.051827] xc2028: Xcv2028/3028 init called!
[32654.051830] xc2028 2-0061: creating new instance
[32654.051832] xc2028 2-0061: type set to XCeive xc2028/xc3028 tuner
[32654.051834] xc2028 2-0061: xc2028_set_config called
[32654.051963] cx23885[0]: registered device video0 [v4l2]
[32654.052165] cx23885[0]: registered device vbi0
[32654.052329] cx23885[0]: registered ALSA audio device
[32654.052593] xc2028 2-0061: request_firmware_nowait(): OK
[32654.052596] xc2028 2-0061: load_all_firmwares called
[32654.052598] xc2028 2-0061: Loading 80 firmware images from xc3028-v27.fw,
type: xc2028 firmware, ver 2.7
[32654.052606] xc2028 2-0061: Reading firmware type BASE F8MHZ (3), id 0,
size=8718.
[32654.052614] xc2028 2-0061: Reading firmware type BASE F8MHZ MTS (7), id 0,
size=8712.
[32654.052623] xc2028 2-0061: Reading firmware type BASE FM (401), id 0,
size=8562.
[32654.052631] xc2028 2-0061: Reading firmware type BASE FM INPUT1 (c01), id 0,
size=8576.
[32654.052640] xc2028 2-0061: Reading firmware type BASE (1), id 0, size=8706.
[32654.052647] xc2028 2-0061: Reading firmware type BASE MTS (5), id 0,
size=8682.
[32654.052652] xc2028 2-0061: Reading firmware type (0), id 10007, size=161.
[32654.052654] xc2028 2-0061: Reading firmware type MTS (4), id 10007,
size=169.
[32654.052657] xc2028 2-0061: Reading firmware type (0), id 20007, size=161.
[32654.052659] xc2028 2-0061: Reading firmware type MTS (4), id 20007,
size=169.
[32654.052661] xc2028 

Re: avermedia A306 / PCIe-minicard (laptop)

2013-08-19 Thread Antti Palosaari

On 08/19/2013 05:18 PM, remi wrote:

Hello

I have this card since months,

http://www.avermedia.com/avertv/Product/ProductDetail.aspx?Id=376SI=true

I have finally retested it with the cx23885 driver : card=39



If I could do anything to identify : [2.414734] cx23885[0]: i2c scan: found
device @ 0x66  [???]

Or hookup the xc5000 etc

I'll be more than glad .






ps: i opened it up a while ago,i saw an af9013 chip ? dvb-tuner looks like
maybe the device @ 0x66 i2c

I will double check , and re-write-down all the chips , i think 3 .


You have to identify all the chips, for DVB-T there is tuner missing.

USB-interface: cx23885
DVB-T demodulator: AF9013
RF-tuner: ?

If there is existing driver for used RF-tuner it comes nice hacking 
project for some newcomer.


It is just tweaking and hacking to find out all settings. AF9013 driver 
also needs likely some changes, currently it is used only for devices 
having AF9015 with integrated AF9013, or AF9015 dual devices having 
AF9015 + external AF9013 providing second tuner.


I have bought quite similar AverMedia A301 ages back as I was looking 
for that AF9013 model, but maybe I have bought just wrong one... :)



regards
Antti


--
http://palosaari.fi/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html