Manouchehri / smi2021

smi2021 v4l2 kernel driver
25 stars 13 forks source link

Unable to capture on 4 channel card #5

Closed Manouchehri closed 9 years ago

Manouchehri commented 9 years ago

I'm unable to get any output from VLC, here's the dmesg log.

[19642.761348] usb 4-1.1: new high-speed USB device number 18 using ehci-pci
[19642.912276] usb 4-1.1: Looking for: smi2021_3f.bin
[19642.912306] usb 4-1.1: Looking for: smi2021_3e.bin
[19642.912322] usb 4-1.1: Looking for: smi2021_3c.bin
[19642.912354] usb 4-1.1: Found firmware for 0x003c
[19642.928175] usbcore: registered new interface driver smi2021
[19643.086639] usb 4-1.1: USB disconnect, device number 18
[19643.271638] usb 4-1.1: new high-speed USB device number 19 using ehci-pci
[19643.378912] smi2021 4-1.1:1.0: driver version 0.1-, V4L2 device registered as video1
[19649.678269] smi2021 4-1.1:1.0: queue_setup: buffer count 4, each 696960 bytes
[19649.685196] smi2021 4-1.1:1.0: allocating urbs...
[19649.685269] smi2021 4-1.1:1.0: 16 urbs of 30720 bytes, allocated

I can confirm it's a problem with the 4 channel version, as it works fine with my single channel card.

mastervolkov commented 9 years ago

Can you test with "mplayer tv:// -tv driver=v4l2:device=/dev/video0 -vo png -frames 40" "mplayer tv:// -tv driver=v4l2:device=/dev/video1 -vo png -frames 40" "mplayer tv:// -tv driver=v4l2:device=/dev/video2 -vo png -frames 40" "mplayer tv:// -tv driver=v4l2:device=/dev/video3 -vo png -frames 40"

And reboot system and unplug/plug device - BUT not touch video input cabel (for paranoid clean experiment) after each test?

P.S.: You know, but a repeated - in 4 channel device video0 - is 3 input (as in 2 channel) - in these step can bee many error case... P.S.2: These info from internet and source - i don;t have 4 channel device ... :(

mastervolkov commented 9 years ago

Please, let me know finish experiment - i can send you pull request with simple device registry dump and patch for user space tool for registry dump. And you can compare that dump and set same registry for test.

Manouchehri commented 9 years ago

I can give you access to a machine via SSH (with x2go) if you're interested in trying it out. Wasn't able to get any useful debugging info aside from that dmesg log.

mateakos1 commented 9 years ago

I also have the 4 input version (with the 3f firmware from the windows driver). The best I can get is grayscale image, when I open it in VLC using PAL, or 625 line 50 Hz (or possibly some others) as video standard. If I try to open it with PAL M standard, or some others, I get kernel panic. This is the backtrace with line numbers (I have set a breakpoint on panic):

#0  panic (fmt=0xffffffff819a3467 "Fatal exception in interrupt") at kernel/panic.c:97
#1  0xffffffff81006026 in oops_end (flags=70, regs=0xffff88003e277bf8, signr=9) at arch/x86/kernel/dumpstack.c:246
#2  0xffffffff817ceb0c in no_context (regs=0xffff88003e277bf8, error_code=<optimized out>, address=18446683600578740224, signal=<optimized out>, si_code=<optimized out>) at arch/x86/mm/fault.c:724
#3  0xffffffff817cebc6 in __bad_area_nosemaphore (regs=0xffff88003e277bf8, error_code=2, address=18446683600578740224, si_code=196609) at arch/x86/mm/fault.c:804
#4  0xffffffff817ced2d in bad_area_nosemaphore (regs=<optimized out>, error_code=<optimized out>, address=<optimized out>) at arch/x86/mm/fault.c:811
#5  0xffffffff810417c0 in __do_page_fault (regs=0xffffffff81e32940 <panic_lock>, error_code=<optimized out>, address=0) at arch/x86/mm/fault.c:1176
#6  0xffffffff81041c6c in do_page_fault (regs=<optimized out>, error_code=<optimized out>) at arch/x86/mm/fault.c:1297
#7  <signal handler called>
#8  0xffffffff8130217d in memcpy () at arch/x86/lib/memcpy_64.S:69
#9  0xffffffff81551165 in copy_video_block (smi2021=0xffff880000095000, p=0xffff88002eff5cac "\200:\200<\200<\200<\200<\200;\200;\200<\200;\200<\200;\200;\200:\200;\200<\200<\200=\200<\200;\200:\200:\200<\200?\200L\200^\200n\200r\200i\200[\200L\200B\200=\200?\200@\200A\200C\200C\200C\200E\200D\200D\200B\200A\200A\200A\200@\200B\200A\200B\200B\200F\200G\200G\200G\200F\200F\200E\200D\200D\200G\200I\200J\200J\200J\200J\200M\200Q\200S\200T\200S\200Q\200P\200O\200N\200P\200P\200P\200O\200L\200K\200M\200L\200L\200L\200O\200P\200P\200S\200U\200T\200T\200T\200T\200U\200V\200Z\200`\200h\200t\200y"..., size=1020) at drivers/media/usb/smi2021/smi2021_main.c:505
#10 0xffffffff81551623 in parse_video (size=<optimized out>, p=<optimized out>, smi2021=<optimized out>) at drivers/media/usb/smi2021/smi2021_main.c:557
#11 process_packet (size=<optimized out>, p=<optimized out>, smi2021=<optimized out>) at drivers/media/usb/smi2021/smi2021_main.c:625
#12 smi2021_iso_cb (ip=<optimized out>) at drivers/media/usb/smi2021/smi2021_main.c:660
#13 0xffffffff814bb904 in __usb_hcd_giveback_urb (urb=0xffff880038ea8c00) at drivers/usb/core/hcd.c:1685
#14 0xffffffff814bba16 in usb_giveback_urb_bh (param=<optimized out>) at drivers/usb/core/hcd.c:1712
#15 0xffffffff81050e76 in tasklet_hi_action (a=<optimized out>) at kernel/softirq.c:537
#16 0xffffffff8105112d in __do_softirq () at kernel/softirq.c:269
#17 0xffffffff810512d9 in run_ksoftirqd (cpu=<optimized out>) at kernel/softirq.c:658
#18 0xffffffff8106bfbf in smpboot_thread_fn (data=0xffffc9000084fffc) at kernel/smpboot.c:161
#19 0xffffffff810687b4 in kthread (_create=0xffff88003e008c80) at kernel/kthread.c:207
#20 <signal handler called>
#21 0x0000000000000000 in irq_stack_union ()
#22 0x0000000000000000 in ?? ()

I'm new to git, and kernel development, but I help gladly if I can. Additional info: the libusb based userspace tool from google code (somagic-capture) works in color with this adapter, but with some glitches, seems like synchronization issues. vlcsnap-2015-05-30-15h00m13s791

mastervolkov commented 9 years ago

some glitches, seems like synchronization issues

New processing algorithm created for fix that and for optimization too. Can you write full command for reproduce kernel panic?

P.S. can you attach yours firmware "3f" ?

mateakos1 commented 9 years ago

The attached picture contains the setting, which causes the instant kernel panic for me. 2015-06-01-20 28 39 If I select PAL standard, then no instant kernel panic, but when I disconnect, and reconnect the analog signal several times (or switch the source to NTSC, PAL, NTSC,...) while the capture is running, it causes the same panic message. Switching the source to NTSC is the easier method, it causes panic most of the times at the first try. Summary: PAL M = instant kernel panic PAL = good (grayscale), but erratic or wrong input signal causes kernel panic

I extracted the firmware from this driver: http://www.mediafire.com/download/6x9k5yben5amk0h/4+Chanel+Capture.zip

Manouchehri commented 9 years ago

@mateakos1 This is a bit off-topic, but is that image an electron scanning microscope that you're using or just a video of one?

mastervolkov commented 9 years ago

Added some debug to dmesg instead kernel panic. Work in progress, but You can test and send result.

mateakos1 commented 9 years ago

@mastervolkov Tested it, now if I select wrong standard (PAL M), it does not panic, but it causes very high CPU usage and corrupt output even on the right standard (PAL). dmesg is full of

[  208.486659] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=1020, line=246, odd=1, buf->pos=769356, new buf->pos=770376
[  208.486663] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=24, line=246, odd=1, buf->pos=770376, new buf->pos=770400
[  208.486665] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=988, line=247, odd=1, buf->pos=770400, new buf->pos=771388
[  208.486668] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=452, line=247, odd=1, buf->pos=771388, new buf->pos=771840
[  208.486670] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=560, line=248, odd=1, buf->pos=771840, new buf->pos=772400
[  208.486672] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=880, line=248, odd=1, buf->pos=772400, new buf->pos=773280
[  208.486675] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=132, line=249, odd=1, buf->pos=773280, new buf->pos=773412
[  208.486677] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=1020, line=249, odd=1, buf->pos=773412, new buf->pos=774432
[  208.486679] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=288, line=249, odd=1, buf->pos=774432, new buf->pos=774720
[  208.486681] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=724, line=250, odd=1, buf->pos=774720, new buf->pos=775444
[  208.486684] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=716, line=250, odd=1, buf->pos=775444, new buf->pos=776160
[  208.486686] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=296, line=251, odd=1, buf->pos=776160, new buf->pos=776456
[  208.486688] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=1020, line=251, odd=1, buf->pos=776456, new buf->pos=777476
[  208.486690] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=124, line=251, odd=1, buf->pos=777476, new buf->pos=777600
[  208.486693] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=888, line=252, odd=1, buf->pos=777600, new buf->pos=778488
[  208.486695] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=552, line=252, odd=1, buf->pos=778488, new buf->pos=779040
[  208.486697] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=460, line=253, odd=1, buf->pos=779040, new buf->pos=779500
[  208.486700] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=980, line=253, odd=1, buf->pos=779500, new buf->pos=780480
[  208.486702] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=32, line=254, odd=1, buf->pos=780480, new buf->pos=780512
[  208.486704] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=1020, line=254, odd=1, buf->pos=780512, new buf->pos=781532
[  208.486707] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=388, line=254, odd=1, buf->pos=781532, new buf->pos=781920
[  208.486709] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=624, line=255, odd=1, buf->pos=781920, new buf->pos=782544
[  208.486711] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=816, line=255, odd=1, buf->pos=782544, new buf->pos=783360
[  208.486713] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=196, line=256, odd=1, buf->pos=783360, new buf->pos=783556
[  208.486716] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=1020, line=256, odd=1, buf->pos=783556, new buf->pos=784576
[  208.486718] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=224, line=256, odd=1, buf->pos=784576, new buf->pos=784800
[  208.486720] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=788, line=257, odd=1, buf->pos=784800, new buf->pos=785588
[  208.486723] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=652, line=257, odd=1, buf->pos=785588, new buf->pos=786240
[  208.486725] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=360, line=258, odd=1, buf->pos=786240, new buf->pos=786600
[  208.486727] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=1020, line=258, odd=1, buf->pos=786600, new buf->pos=787620
[  208.486730] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=60, line=258, odd=1, buf->pos=787620, new buf->pos=787680
[  208.486732] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=952, line=259, odd=1, buf->pos=787680, new buf->pos=788632
[  208.486734] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=488, line=259, odd=1, buf->pos=788632, new buf->pos=789120
[  208.486736] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=524, line=260, odd=1, buf->pos=789120, new buf->pos=789644
[  208.486739] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=916, line=260, odd=1, buf->pos=789644, new buf->pos=790560
[  208.486741] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=96, line=261, odd=1, buf->pos=790560, new buf->pos=790656
[  208.486743] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=1020, line=261, odd=1, buf->pos=790656, new buf->pos=791676
[  208.486746] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=324, line=261, odd=1, buf->pos=791676, new buf->pos=792000
[  208.486748] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=688, line=262, odd=1, buf->pos=792000, new buf->pos=792688
[  208.486750] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=752, line=262, odd=1, buf->pos=792688, new buf->pos=793440
[  208.486753] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=260, line=263, odd=1, buf->pos=793440, new buf->pos=793700
[  208.486755] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=1020, line=263, odd=1, buf->pos=793700, new buf->pos=794720
[  208.486757] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=160, line=263, odd=1, buf->pos=794720, new buf->pos=794880
[  208.486760] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=852, line=264, odd=1, buf->pos=794880, new buf->pos=795732
[  208.486762] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=588, line=264, odd=1, buf->pos=795732, new buf->pos=796320
[  208.486764] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=424, line=265, odd=1, buf->pos=796320, new buf->pos=796744
[  208.486767] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=1016, line=265, odd=1, buf->pos=796744, new buf->pos=797760
[  208.486915] systemd-journald[125]: /dev/kmsg buffer overrun, some messages lost.
[  208.487704] smi2021 2-1.2:1.0: killing 16 urbs...
[  208.491705] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=768, line=12, odd=0, buf->pos=17952, new buf->pos=18720
[  208.491709] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=244, line=13, odd=0, buf->pos=18720, new buf->pos=18964
[  208.491712] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=1020, line=13, odd=0, buf->pos=18964, new buf->pos=19984
[  208.491714] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=176, line=13, odd=0, buf->pos=19984, new buf->pos=20160
[  208.491716] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=836, line=14, odd=0, buf->pos=20160, new buf->pos=20996
[  208.491719] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=604, line=14, odd=0, buf->pos=20996, new buf->pos=21600
[  208.491721] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=408, line=15, odd=0, buf->pos=21600, new buf->pos=22008
[  208.491723] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=1020, line=15, odd=0, buf->pos=22008, new buf->pos=23028
[  208.491726] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=12, line=15, odd=0, buf->pos=23028, new buf->pos=23040
[  208.491728] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=1000, line=16, odd=0, buf->pos=23040, new buf->pos=24040
[  208.491730] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=440, line=16, odd=0, buf->pos=24040, new buf->pos=24480
[  208.491732] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=572, line=17, odd=0, buf->pos=24480, new buf->pos=25052
[  208.491735] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=868, line=17, odd=0, buf->pos=25052, new buf->pos=25920
[  208.491737] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=144, line=18, odd=0, buf->pos=25920, new buf->pos=26064
[  208.491739] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=1020, line=18, odd=0, buf->pos=26064, new buf->pos=27084
[  208.491742] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=276, line=18, odd=0, buf->pos=27084, new buf->pos=27360
[  208.491744] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=736, line=19, odd=0, buf->pos=27360, new buf->pos=28096
[  208.491746] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=704, line=19, odd=0, buf->pos=28096, new buf->pos=28800
[  208.491749] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=308, line=20, odd=0, buf->pos=28800, new buf->pos=29108
[  208.491751] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=1020, line=20, odd=0, buf->pos=29108, new buf->pos=30128
[  208.491753] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=112, line=20, odd=0, buf->pos=30128, new buf->pos=30240
[  208.491756] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=900, line=21, odd=0, buf->pos=30240, new buf->pos=31140
[  208.491758] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=540, line=21, odd=0, buf->pos=31140, new buf->pos=31680
[  208.491760] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=472, line=22, odd=0, buf->pos=31680, new buf->pos=32152
[  208.491763] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=968, line=22, odd=0, buf->pos=32152, new buf->pos=33120
[  208.491765] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=44, line=23, odd=0, buf->pos=33120, new buf->pos=33164
[  208.491768] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=1020, line=23, odd=0, buf->pos=33164, new buf->pos=34184
[  208.491771] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=376, line=23, odd=0, buf->pos=34184, new buf->pos=34560
[  208.491774] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=636, line=24, odd=0, buf->pos=34560, new buf->pos=35196
[  208.491777] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=804, line=24, odd=0, buf->pos=35196, new buf->pos=36000
[  208.491780] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=208, line=25, odd=0, buf->pos=36000, new buf->pos=36208
[  208.491782] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=1020, line=25, odd=0, buf->pos=36208, new buf->pos=37228
[  208.491785] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=212, line=25, odd=0, buf->pos=37228, new buf->pos=37440
[  208.491787] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=800, line=26, odd=0, buf->pos=37440, new buf->pos=38240
[  208.491789] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=640, line=26, odd=0, buf->pos=38240, new buf->pos=38880
[  208.491792] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=372, line=27, odd=0, buf->pos=38880, new buf->pos=39252
[  208.491794] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=1020, line=27, odd=0, buf->pos=39252, new buf->pos=40272
[  208.491797] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=48, line=27, odd=0, buf->pos=40272, new buf->pos=40320
[  208.491799] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=964, line=28, odd=0, buf->pos=40320, new buf->pos=41284
[  208.491801] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=476, line=28, odd=0, buf->pos=41284, new buf->pos=41760
[  208.491803] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=536, line=29, odd=0, buf->pos=41760, new buf->pos=42296
[  208.491806] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=904, line=29, odd=0, buf->pos=42296, new buf->pos=43200
[  208.491808] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=108, line=30, odd=0, buf->pos=43200, new buf->pos=43308
[  208.491811] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=1020, line=30, odd=0, buf->pos=43308, new buf->pos=44328
[  208.491813] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=312, line=30, odd=0, buf->pos=44328, new buf->pos=44640
[  208.491816] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=700, line=31, odd=0, buf->pos=44640, new buf->pos=45340
[  208.491818] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=740, line=31, odd=0, buf->pos=45340, new buf->pos=46080
[  208.491820] smi2021 2-1.2:1.0:  Failed copy to user buff: len_copy=272, line=32, odd=0, buf->pos=46080, new buf->pos=46352
[  208.491981] systemd-journald[125]: /dev/kmsg buffer overrun, some messages lost.
[  208.515432] smi2021 2-1.2:1.0: all urbs killed
[  208.515704] smi2021 2-1.2:1.0: clear_queue called
[  208.515709] smi2021 2-1.2:1.0: buffer [ffff880071c2e800/3] aborted
[  208.515712] smi2021 2-1.2:1.0: buffer [ffff880071c2b000/0] aborted
[  208.515715] smi2021 2-1.2:1.0: buffer [ffff880071c28800/2] aborted
[  208.515718] smi2021 2-1.2:1.0: returning from clear_queue
[  208.515720] smi2021 2-1.2:1.0: streaming stopped

@Manouchehri the signal source is a Nokia N900 with an underwater background image, it should be colorfull

mateakos1 commented 9 years ago

About the grayscale image, I'v read at the beginning of the SAA7113 datasheet, that the chip features "Four analog inputs, internal analog source selectors, e.g. 4 × CVBS or 2 × Y/C or (1 × Y/C and 2 × CVBS)" Is it possible, that semohow the chip is configured to separate Y and C signals, and that is why it's grayscale (because it interprets the CVBS signal on the Y input as luminance, and receives nothing on the C input)?

jonjonarnearne commented 9 years ago

@mateakos1: Off topic, but what is that tv output control applet on your N900? I have the N900 myself, but I haven't seen the option to change aspect ratio before.

mateakos1 commented 9 years ago

@jonjonarnearne the name in the application manager: "TV out control desktop widget" the name of the package: "maemo-tvout-control" (I don't know, from which repository, extras or extras-testing or extras-devel.)

Manouchehri commented 9 years ago

I noticed that @kerpz seems to be able to use the 4-channel card, as he mentioned it in kerpz/smi2021@23f1053cf3ca.

jonjonarnearne commented 9 years ago

Hi @mateakos1, Don't know if this will help you, but can you confirm with lsmod that you have loaded the saa7115 module? You can also just check for this line in your dmesg log: saa7115 8-004a: gm7113c found @ 0x94 (smi2021) If you don't see that line, the saa7115 module is missing.

I managed to compile and install the smi2021 module, but forgot to compile the saa7115 module. This caused the driver to only output a black/white picture.

mastervolkov commented 9 years ago

Small addition: saa7115 do output only in debug mode. If you not seen saa7115 8-004a: gm7113c found @ 0x94 (smi2021), try load saa7115 with debug: modprobe saa7115 debug=1

mateakos1 commented 9 years ago

Hi @jonjonarnearne, saa7115 is loaded. When it's loaded with debug=1 parameter, it outputs a suspicious line in dmesg, while connecting the digitizer.

saa7115 8-004a: chip 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 @ 0x94 is unknown.
jonjonarnearne commented 9 years ago

This indicates that your kernel is to old. I wrote some patches for the saa7115 driver to recognize the gm7113c chip for the smi2021 driver, but I don't remeber what kernel version got these patches.

On Thu, Aug 13, 2015 at 5:18 PM, mateakos1 notifications@github.com wrote:

Hi @jonjonarnearne https://github.com/jonjonarnearne, saa7115 is loaded. When it's loaded with debug=1 parameter, it outputs a suspicious line in dmesg, while connecting the digitizer.

saa7115 8-004a: chip 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 @ 0x94 is unknown.

— Reply to this email directly or view it on GitHub https://github.com/Manouchehri/smi2021/issues/5#issuecomment-130726883.

Jonarne http://jonarne.no

mateakos1 commented 9 years ago

I'm using 4.0.5-gentoo.

jonjonarnearne commented 9 years ago

Hm, It could be that your device have a different saa7113 clone, that is reporting another id.

I don't remeber what my chip identifies as, but I'm in the middle of a kernel compile, so I can't check it now.

On Thu, Aug 13, 2015 at 5:34 PM, mateakos1 notifications@github.com wrote:

I'm using 4.0.5-gentoo.

— Reply to this email directly or view it on GitHub https://github.com/Manouchehri/smi2021/issues/5#issuecomment-130731692.

Jonarne http://jonarne.no

jonjonarnearne commented 9 years ago

Check this: https://github.com/Manouchehri/smi2021/issues/15#issuecomment-130751839

On Thu, Aug 13, 2015 at 5:48 PM, Jon Arne Jørgensen < jonjon.arnearne@gmail.com> wrote:

Hm, It could be that your device have a different saa7113 clone, that is reporting another id.

I don't remeber what my chip identifies as, but I'm in the middle of a kernel compile, so I can't check it now.

On Thu, Aug 13, 2015 at 5:34 PM, mateakos1 notifications@github.com wrote:

I'm using 4.0.5-gentoo.

— Reply to this email directly or view it on GitHub https://github.com/Manouchehri/smi2021/issues/5#issuecomment-130731692.

Jonarne http://jonarne.no

Jonarne http://jonarne.no

mateakos1 commented 9 years ago

I modified the saa7115 module to use gm7113c if the chip is unknown. Now I can get colour image, but the problem with the buffer copy stays the same. And a synchronization line is still visible on the top, as on the grayscale image attached earlier.

jonjonarnearne commented 9 years ago

That is good.

The driver is trying to do as little processing as possible on the raw video from the saa7115 clone - (the chip responsible for the digitization). This is to avoid missing frames and lines while processing. I believe that the code responsible for processing the raw video-data has some assumptions about the format of this data, and your device needs a little stricter parsing and checking before passing that data on to VLC.

The userspace libusb parser is a lot stricter than the version in the smi2021 driver.

On Thu, Aug 13, 2015 at 7:24 PM, mateakos1 notifications@github.com wrote:

I modified the saa7115 module to use gm7113c if the chip is unknown. Now I can get colour image, but the problem with the buffer copy stay's the same.

— Reply to this email directly or view it on GitHub https://github.com/Manouchehri/smi2021/issues/5#issuecomment-130769468.

Jonarne http://jonarne.no

mastervolkov commented 9 years ago

Please, recheck in new staging comit change - patch saa7115 not needed now, if you use smi2021 with forceasgm=1 option.

mastervolkov commented 9 years ago

Is something has changed in current new fix from master?

mastervolkov commented 9 years ago

That problem solved (capturing work on 4ch input device). Other problem can be in #17