2015-06-02 22:03:56

by Andrey Utkin

[permalink] [raw]
Subject: tw5864 driver development, help needed

Hi! I am working on making a Linux driver for TW5864-based video&audio
capture and encoding PCI boards. The driver is to be submitted for
inclusion to Linux upstream.
The following two links are links to boards available for buying:
http://www.provideo.com.tw/web/DVR%20Card_TW-310.htm
http://www.provideo.com.tw/web/DVR%20Card_TW-320.htm
We possess one 8-port board and we try to make it play.

http://whdd.org/tw5864/TW-3XX_Linux.rar - this is reference driver
code. Overwhelmingly complicated IMO.
http://whdd.org/tw5864/tw5864b1-ds.pdf - Datasheet.
http://whdd.org/tw5864/TW5864_datasheet_0.6d.pdf - Another datasheet.
These two differ in some minor points.
https://github.com/krieger-od/linux - my work in progress on this, in
drivers/staging/media/tw5864 directory. Derived from
drivers/media/pci/tw68 (which is raw video capture card), defined
reasonable part of registers, now trying to make device produce video
capture and encoding interrupts, but cannot get any interrupts except
GPIO and timer ones. This is currently the critical blocking issue in
development.
I hope that somebody experienced with similar boards would have
quesswork on how to proceed.
My work-on-progress code is dirty, so if you would agree to check that
only if it will be cleaned up, please let me know.

I am willing to pay for productive help.

--
Bluecherry developer.


2015-07-03 14:23:17

by Andrey Utkin

[permalink] [raw]
Subject: Re: tw5864 driver development, help needed

On Wed, Jun 3, 2015 at 1:03 AM, Andrey Utkin
<[email protected]> wrote:
> Hi! I am working on making a Linux driver for TW5864-based video&audio
> capture and encoding PCI boards. The driver is to be submitted for
> inclusion to Linux upstream.
> The following two links are links to boards available for buying:
> http://www.provideo.com.tw/web/DVR%20Card_TW-310.htm
> http://www.provideo.com.tw/web/DVR%20Card_TW-320.htm
> We possess one 8-port board and we try to make it play.
>
> http://whdd.org/tw5864/TW-3XX_Linux.rar - this is reference driver
> code. Overwhelmingly complicated IMO.
> http://whdd.org/tw5864/tw5864b1-ds.pdf - Datasheet.
> http://whdd.org/tw5864/TW5864_datasheet_0.6d.pdf - Another datasheet.
> These two differ in some minor points.
> https://github.com/krieger-od/linux - my work in progress on this, in
> drivers/staging/media/tw5864 directory. Derived from
> drivers/media/pci/tw68 (which is raw video capture card), defined
> reasonable part of registers, now trying to make device produce video
> capture and encoding interrupts, but cannot get any interrupts except
> GPIO and timer ones. This is currently the critical blocking issue in
> development.
> I hope that somebody experienced with similar boards would have
> quesswork on how to proceed.
> My work-on-progress code is dirty, so if you would agree to check that
> only if it will be cleaned up, please let me know.
>
> I am willing to pay for productive help.
>
> --
> Bluecherry developer.


Up... we are moving much slower than we expected, desperately needing help.

Running reference driver with Ubuntu 9 (with kernel 2.6.28.10) with
16-port card shows that the
reference driver fails to work with it correctly. Also that driver is
not complete, it requires your userland counterpart for usable
operation, which is far from being acceptable in production.

Currently what stops us with our driver is that "H264 encoding done"
interrupt doesn't repeat, and CRC checksums mismatch for the first
(and last) time this interrupt happens.
We do our best to mimic what the reference driver does, but we might
miss some point.

I suspect that my initialization of video inputs or board clock
configuration is insufficient or inconsistent with what device needs.

Our work in progress is located in
https://github.com/krieger-od/linux, directory
drivers/staging/media/tw5864

This is another request for expert help.
The time is very important for us now.

Thanks in advance and sorry for distraction.

--
Bluecherry developer.

2015-07-08 17:10:00

by Andrey Utkin

[permalink] [raw]
Subject: Re: tw5864 driver development, help needed

On Fri, Jul 3, 2015 at 5:23 PM, Andrey Utkin
<[email protected]> wrote:
> Up... we are moving much slower than we expected, desperately needing help.
>
> Running reference driver with Ubuntu 9 (with kernel 2.6.28.10) with
> 16-port card shows that the
> reference driver fails to work with it correctly. Also that driver is
> not complete, it requires your userland counterpart for usable
> operation, which is far from being acceptable in production.
>
> Currently what stops us with our driver is that "H264 encoding done"
> interrupt doesn't repeat, and CRC checksums mismatch for the first
> (and last) time this interrupt happens.
> We do our best to mimic what the reference driver does, but we might
> miss some point.
>
> I suspect that my initialization of video inputs or board clock
> configuration is insufficient or inconsistent with what device needs.
>
> Our work in progress is located in
> https://github.com/krieger-od/linux, directory
> drivers/staging/media/tw5864
>
> This is another request for expert help.
> The time is very important for us now.
>
> Thanks in advance and sorry for distraction.

Thanks for all who contacted us! Now we know we can count on you.
Just a small update so that you know the status of the project (and so
that you won't proceed looking into the last described issue, if this
is the case). We have interrupts repeating, and CRC checksums
matching. Now we are working on formatting of h264 stream (the frames
are returned without any headers, and reference driver has header
generation deeply and tightly bound to other code, so this will take
some time.
The latest state of this work in progress is in
github.com/krieger-od/linux.git , branch "brutal".

--
Bluecherry developer.

2015-07-14 15:42:54

by Andrey Utkin

[permalink] [raw]
Subject: Re: tw5864 driver development, help needed

An update with a request for help.

Asking for help with h264 headers generation. Both copying headers
from similar videos and porting headers generation code from reference
driver don't work for me (ref driver is weird and very complicated, so
porting involved importing of lots of code, but still in my case the
generated header differs from the one produced by reference driver,
and resulting files are not decodable).
Wireshark seems not able to dissect raw h264 files, so that I could
compare headers bitfield-wise.
I have dumped 64 first encoded frames as they appear from hardware, so
that you could look at it.
This is archive: http://lizard.bluecherry.net/~autkin/vlc.tar.gz and
this is contents list of archive
http://lizard.bluecherry.net/~autkin/vlc.contents

Only one camera is attached to this multi-channel video grabber and
encoder, and i don't know which chip has it (4, 5, 6 or 7).
The produced frames should have the same settings as this file:
http://lizard.bluecherry.net/~autkin/test_main.h264
This is PAL D1, 720x576.
Thanks in advance for any help. At last, the ability to look at
visualization of those h264 streams would be great.

--
Bluecherry developer.