themactep / thingino-firmware

Open-source firmware for Ingenic SoC IP cameras
https://thingino.com
MIT License
159 stars 50 forks source link

T31X gc4653 not working. encoder init FAIL #52

Closed marcipan73 closed 5 months ago

marcipan73 commented 6 months ago

I use precompiled image "thingino-t31x_gc4653_eth.bin"

[root@thingino-t31x ~]#  prudynt
[INFO:main.cpp]: PRUDYNT Video Daemon: Apr 17 2024 07:53:46_1ad8b2756e
[INFO:main.cpp]: Starting Prudynt Video Server.
[INFO:IMP.cpp]: LIBIMP Version IMP-1.1.6
[INFO:IMP.cpp]: SYSUTILS Version: SYSUTILS-1.1.6
[INFO:IMP.cpp]: CPU Information: T31-X
[INFO:IMP.cpp]: Sensor: gc4653
---- FPGA board is ready ----
  Board UID : 30AB6E51
  Board HW ID : 72000460
  Board rev.  : 5DE5A975
  Board date  : 20190326
-----------------------------
VBMCreatePool[335] poolid = 0 IMP_ALLOC failed size = 11059200
[ERROR:Encoder.cpp]: IMP_FrameSource_EnableChn() == -1
[ERROR:main.cpp]: Encoder initialization failed.

[root@thingino-t31x ~]# soc -m t31x

[root@thingino-t31x ~]# sensor all name: gc4653 chip_id: 0x4653 i2c_addr: 0x29 width: 2560 height: 1440 min_fps: 5 max_fps: 30 version: H20211211a

[root@thingino-t31x ~]# dmesg [ 0.000000] Initializing cgroup subsys cpu [ 0.000000] Initializing cgroup subsys cpuacct [ 0.000000] Linux version 3.10.14isvp_swan_1.0 (buildroot@buildroot) (buildroot-gcc-13.2.0) #1 PREEMPT Wed Apr 17 07:53:46 UTC 2024 [ 0.000000] bootconsole [early0] enabled [ 0.000000] CPU0 RESET ERROR PC:801A7F40 [ 0.000000] [<801a7f40>] 0x801a7f40 [ 0.000000] CPU0 revision is: 00d00100 (Ingenic Xburst) [ 0.000000] FPU revision is: 00b70000 [ 0.000000] cgu_get_rate, parent = 1392000000, rate = 0, m = 129, n = 255, reg val = 0x081000ff [ 0.000000] cgu_get_rate, parent = 1392000000, rate = 0, m = 129, n = 255, reg val = 0x081000ff [ 0.000000] CCLK:1392MHz L2CLK:696Mhz H0CLK:200MHz H2CLK:200Mhz PCLK:100Mhz [ 0.000000] Determined physical RAM map: [ 0.000000] memory: 003e1000 @ 00010000 (usable) [ 0.000000] memory: 0002f000 @ 003f1000 (usable after init) [ 0.000000] User-defined physical RAM map: [ 0.000000] memory: 06300000 @ 00000000 (usable) [ 0.000000] Zone ranges: [ 0.000000] Normal [mem 0x00000000-0x062fffff] [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x00000000-0x062fffff] [ 0.000000] On node 0 totalpages: 25344 [ 0.000000] free_area_init_node: node 0, pgdat 803eaaa0, node_mem_map 81000000 [ 0.000000] Normal zone: 198 pages used for memmap [ 0.000000] Normal zone: 0 pages reserved [ 0.000000] Normal zone: 25344 pages, LIFO batch:7 [ 0.000000] Primary instruction cache 32kB, 8-way, VIPT, linesize 32 bytes. [ 0.000000] Primary data cache 32kB, 8-way, VIPT, no aliases, linesize 32 bytes [ 0.000000] pls check processor_id[0x00d00100],sc_jz not support! [ 0.000000] MIPS secondary cache 128kB, 8-way, linesize 32 bytes. [ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768 [ 0.000000] pcpu-alloc: [0] 0 [ 0.000000] Built 1 zonelists in Zone order, mobility grouping off. Total pages: 25146 [ 0.000000] Kernel command line: mem=99M@0x0 rmem=29M@0x6300000 console=ttyS1,115200n8 panic=10 root=/dev/mtdblock3 rootfstype=squashfs init=/init mtdparts=jz_sfc:256k(boot),64k(env),1344k(kernel),4064k(rootfs),-(rootfs_data) [ 0.000000] PID hash table entries: 512 (order: -1, 2048 bytes) [ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes) [ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes) [ 0.000000] Memory: 95588k/101376k available (3294k kernel code, 5788k reserved, 674k data, 188k init, 0k highmem) [ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] Preemptible hierarchical RCU implementation. [ 0.000000] NR_IRQS:358 [ 0.000000] clockevents_config_and_register success. [ 0.000012] Calibrating delay loop... 1391.00 BogoMIPS (lpj=6955008) [ 0.087832] pid_max: default: 32768 minimum: 301 [ 0.092662] Mount-cache hash table entries: 512 [ 0.097564] Initializing cgroup subsys debug [ 0.101818] Initializing cgroup subsys freezer [ 0.107816] devtmpfs: initialized [ 0.112544] regulator-dummy: no parameters [ 0.116904] NET: Registered protocol family 16 [ 0.124985] set gpio strength: 32-2 [ 0.124996] set gpio strength: 33-2 [ 0.125001] set gpio strength: 34-2 [ 0.125007] set gpio strength: 35-2 [ 0.125012] set gpio strength: 36-2 [ 0.125018] set gpio strength: 37-2 [ 0.134886] bio: create slab at 0 [ 0.144295] jz-dma jz-dma: JZ SoC DMA initialized [ 0.150760] usbcore: registered new interface driver usbfs [ 0.156800] usbcore: registered new interface driver hub [ 0.162302] usbcore: registered new device driver usb [ 0.167827] (null): set:249 hold:250 dev=100000000 h=500 l=500 [ 0.175581] Switching to clocksource jz_clocksource [ 0.182712] dwc2 otg probe start [ 0.182746] jz-dwc2 jz-dwc2: cgu clk gate get error [ 0.187727] DWC IN OTG MODE [ 0.191422] dwc2 dwc2: Keep PHY ON [ 0.194792] dwc2 dwc2: Using Buffer DMA mode [ 0.199119] dwc2 dwc2: Core Release: 3.00a [ 0.203396] dwc2 dwc2: DesignWare USB2.0 High-Speed Host Controller [ 0.209689] dwc2 dwc2: new USB bus registered, assigned bus number 1 [ 0.217137] hub 1-0:1.0: USB hub found [ 0.220948] hub 1-0:1.0: 1 port detected [ 0.224940] dwc2 dwc2: DWC2 Host Initialized [ 0.229224] dwc2 otg probe success [ 0.229463] NET: Registered protocol family 2 [ 0.234313] TCP established hash table entries: 1024 (order: 1, 8192 bytes) [ 0.241420] TCP bind hash table entries: 1024 (order: 0, 4096 bytes) [ 0.247799] TCP: Hash tables configured (established 1024 bind 1024) [ 0.254338] TCP: reno registered [ 0.257531] UDP hash table entries: 256 (order: 0, 4096 bytes) [ 0.263494] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) [ 0.269968] NET: Registered protocol family 1 [ 0.274562] RPC: Registered named UNIX socket transport module. [ 0.280536] RPC: Registered udp transport module. [ 0.285258] RPC: Registered tcp transport module. [ 0.290026] RPC: Registered tcp NFSv4.1 backchannel transport module. [ 0.297070] freq_udelay_jiffys[0].max_num = 10 [ 0.301558] cpufreq udelay loops_per_jiffy [ 0.305916] dwc2 dwc2: ID PIN CHANGED! [ 0.309742] 12000 59956 59956 [ 0.312998] 24000 119913 119913 [ 0.316416] 60000 299784 299784 [ 0.319859] 120000 599569 599569 [ 0.323471] 200000 999282 999282 [ 0.326923] 300000 1498924 1498924 [ 0.330732] 600000 2997848 2997848 [ 0.334360] 792000 3957159 3957159 [ 0.338068] 1008000 5036385 5036385 [ 0.341896] 1200000 5995696 5995696 [ 0.355241] squashfs: version 4.0 (2009/01/31) Phillip Lougher [ 0.362347] jffs2: version 2.2. © 2001-2006 Red Hat, Inc. [ 0.368396] msgmni has been set to 186 [ 0.373426] io scheduler noop registered [ 0.377346] io scheduler cfq registered (default) [ 0.388892] jz-uart.1: ttyS1 at MMIO 0x10031000 (irq = 58) is a uart1 [ 0.396508] console [ttyS1] enabled, bootconsole disabled [ 0.408409] logger: created 256K log 'log_main' [ 0.415082] jz TCU driver register completed [ 0.420368] the id code = 204018, the flash name is XM25QH128C [ 0.426540] JZ SFC Controller for SFC channel 0 driver register [ 0.432784] 5 cmdlinepart partitions found on MTD device jz_sfc [ 0.438886] Creating 5 MTD partitions on "jz_sfc": [ 0.443872] 0x000000000000-0x000000040000 : "boot" [ 0.449858] 0x000000040000-0x000000050000 : "env" [ 0.455816] 0x000000050000-0x0000001a0000 : "kernel" [ 0.462045] 0x0000001a0000-0x000000598000 : "rootfs" [ 0.468196] 0x000000598000-0x000001000000 : "rootfs_data" [ 0.474857] SPI NOR MTD LOAD OK [ 0.478297] Bus Mode Reg after reset: 0x00020101, cnt=0 [ 0.487397] libphy: jz_mii_bus: probed [ 0.491670] =======>gmacdev = 0x840ee900<================ [ 0.497246] =========>gmacdev->MacBase = 0xb34b0000 DmaBase = 0xb34b1000 [ 0.504296] Bus Mode Reg after reset: 0x00020101, cnt=0 [ 0.511426] jz_mac jz_mac.0: JZ on-chip Ethernet MAC driver, Version 1.0 [ 0.518704] usbcore: registered new interface driver asix [ 0.524370] i2c /dev entries driver [ 0.528797] jz-wdt: watchdog initialized [ 0.533475] ipip: IPv4 over IPv4 tunneling driver [ 0.538874] TCP: cubic registered [ 0.543389] NET: Registered protocol family 10 [ 0.548762] NET: Registered protocol family 17 [ 0.554642] input: gpio-keys as /devices/platform/gpio-keys/input/input0 [ 0.562128] drivers/rtc/hctosys.c: unable to open rtc device (rtc0) [ 0.573044] VFS: Mounted root (squashfs filesystem) readonly on device 31:3. [ 0.583228] devtmpfs: mounted [ 0.586546] Freeing unused kernel memory: 188K (803f1000 - 80420000) [ 1.022884] jffs2: notice: (394) jffs2_build_xattr_subsystem: complete building xattr subsystem, 3 of xdatum (0 unchecked, 2 orphan) and 3 of xref (0 dead, 2 orphan) found. [ 2.252606] jzmmc_v1.2 jzmmc_v1.2.0: vmmc regulator missing [ 2.255185] jzmmc_v1.2 jzmmc_v1.2.0: register success! [ 2.255241] jzmmc_v1.2 jzmmc_v1.2.1: vmmc regulator missing [ 2.257893] jzmmc_v1.2 jzmmc_v1.2.1: register success! [ 2.500789] Bus Mode Reg after reset: 0x00020101, cnt=0 [ 2.750476] jzmmc_v1.2 jzmmc_v1.2.0: card inserted, state=0 [ 4.510616] libphy: 0:00 - Link is Up - 100/Full [ 5.710418] GPIO claim module (c) OpenIPC.org [ 5.743178] jz_codec_register: probe() successful! [ 5.743262] cgu_set_rate, parent = 1392000000, rate = 2048000, n = 10875, reg val = 0x01002a7b [ 5.743270] cgu_enable,cgu_i2s_spk reg val = 0x21002a7b [ 5.743287] cgu_set_rate, parent = 1392000000, rate = 2048000, n = 10875, reg val = 0x01002a7b [ 5.743295] cgu_enable,cgu_i2s_mic reg val = 0x21002a7b [ 6.150691] dma dma0chan24: Channel 24 have been requested.(phy id 7,type 0x06 desc a45fd000) [ 6.150977] dma dma0chan25: Channel 25 have been requested.(phy id 6,type 0x06 desc a498c000) [ 6.151294] dma dma0chan26: Channel 26 have been requested.(phy id 5,type 0x04 desc a4980000) [ 6.357990] @@@@ tx-isp-probe ok(version H20221206a), compiler date=Dec 6 2022 @@@@@ [ 6.413543] @@@@ avpu driver ok(version H20220825a) @@@@@ [ 7.361079] -----sensor_detect: 1057 ret = 0, v = 0x46 [ 7.361693] -----sensor_detect: 1065 ret = 0, v = 0x53 [ 7.361700] gc4653 chip found @ 0x29 (i2c0) [ 7.361700] sensor drv version H20211211a [ 7.565463] gc4653 stream on [ 7.779081] gc4653 stream off [ 519.354552] -----sensor_detect: 1057 ret = 0, v = 0x46 [ 519.355168] -----sensor_detect: 1065 ret = 0, v = 0x53 [ 519.355176] gc4653 chip found @ 0x29 (i2c0) [ 519.355176] sensor drv version H20211211a [ 519.547633] gc4653 stream on [ 519.593661] gc4653 stream off [ 542.295626] -----sensor_detect: 1057 ret = 0, v = 0x46 [ 542.296241] -----sensor_detect: 1065 ret = 0, v = 0x53 [ 542.296250] gc4653 chip found @ 0x29 (i2c0) [ 542.296250] sensor drv version H20211211a [ 542.488552] gc4653 stream on [ 542.534183] gc4653 stream off [ 563.816484] -----sensor_detect: 1057 ret = 0, v = 0x46 [ 563.817098] -----sensor_detect: 1065 ret = 0, v = 0x53 [ 563.817106] gc4653 chip found @ 0x29 (i2c0) [ 563.817106] sensor drv version H20211211a [ 564.009459] gc4653 stream on [ 564.055416] gc4653 stream off [ 581.407629] -----sensor_detect: 1057 ret = 0, v = 0x46 [ 581.408243] -----sensor_detect: 1065 ret = 0, v = 0x53 [ 581.408252] gc4653 chip found @ 0x29 (i2c0) [ 581.408252] sensor drv version H20211211a [ 581.600242] gc4653 stream on [ 581.645822] gc4653 stream off [ 940.179475] -----sensor_detect: 1057 ret = 0, v = 0x46 [ 940.180089] -----sensor_detect: 1065 ret = 0, v = 0x53 [ 940.180097] gc4653 chip found @ 0x29 (i2c0) [ 940.180097] sensor drv version H20211211a [ 940.372905] gc4653 stream on [ 940.418558] gc4653 stream off

[root@thingino-t31x ~]# lsmod Module Size Used by Tainted: G avpu 14384 0 sensor_gc4653_t31 13760 0 tx_isp_t31 827936 1 sensor_gc4653_t31 audio 61264 0 gpio 2016 0 vfat 8480 0 fat 46864 1 vfat jzmmc_v12 13296 0

[root@thingino-t31x ~]# ps ax PID USER COMMAND 1 root init 2 root [kthreadd] 3 root [ksoftirqd/0] 5 root [kworker/0:0H] 6 root [kworker/u2:0] 7 root [rcu_preempt] 8 root [rcu_bh] 9 root [rcu_sched] 10 root [watchdog/0] 11 root [khelper] 12 root [kdevtmpfs] 13 root [kworker/u2:1] 118 root [writeback] 120 root [bioset] 122 root [kblockd] 164 root [khubd] 195 root [kworker/0:1] 196 root [rpciod] 199 root [kworker/0:2] 204 root [kswapd0] 253 root [fsnotify_mark] 255 root [nfsiod] 263 root [crypto] 379 root [deferwq] 383 root [kworker/0:1H] 395 root [jffs2_gcd_mtd4] 442 root /sbin/syslogd -n -C64 -t 690 root /sbin/rngd -r /dev/urandom 767 root udhcpc -x hostname:thingino-t31x -S -T1 -t15 -R -b -O search -r 805 root /sbin/ntpd -n 816 root /usr/sbin/dropbear -k -K 300 -b /etc/issue.net -R 826 root /usr/sbin/httpd -f -c /etc/httpd.conf -r Authentication 836 root /sbin/crond -f -c /etc/crontabs 898 root [irq/37-isp-m0] 900 root [irq/38-isp-w02] 1045 root -sh 1047 root /sbin/watchdog -T 60 /dev/watchdog 7008 root /usr/sbin/httpd -f -c /etc/httpd.conf -r Authentication 7010 root {mjpeg.cgi} /bin/sh mjpeg.cgi 7075 root ps ax

if changed encoder resoluton 1920x1080 :

[root@thingino-t31x ~]# prudynt
[INFO:main.cpp]: PRUDYNT Video Daemon: Apr 17 2024 07:53:46_1ad8b2756e
[DEBUG:Logger.cpp]: Logger Init.
[INFO:main.cpp]: Starting Prudynt Video Server.
[INFO:IMP.cpp]: LIBIMP Version IMP-1.1.6
[INFO:IMP.cpp]: SYSUTILS Version: SYSUTILS-1.1.6
[INFO:IMP.cpp]: CPU Information: T31-X
[DEBUG:IMP.cpp]: OSD Pool Size set
[DEBUG:IMP.cpp]: ISP Opened!
[INFO:IMP.cpp]: Sensor: gc4653
[DEBUG:IMP.cpp]: Sensor Added
[DEBUG:IMP.cpp]: Sensor Enabled
---- FPGA board is ready ----
  Board UID : 30AB6E51
  Board HW ID : 72000460
  Board rev.  : 5DE5A975
  Board date  : 20190326
-----------------------------
[DEBUG:IMP.cpp]: System Initialized
[DEBUG:Encoder.cpp]: OSD enabled
[DEBUG:OSD.cpp]: OSD init begin
[DEBUG:OSD.cpp]: OSD init done
[DEBUG:main.cpp]: JPEG Channel enabled
[DEBUG:Encoder.hpp]: Create Sink: 0
set jpeg streamMngCtx suceess
[DEBUG:Encoder.cpp]: Encoder Start.
[DEBUG:RTSP.cpp]: Got VPS
[DEBUG:RTSP.cpp]: Got SPS (H265)
[DEBUG:RTSP.cpp]: Got PPS (H265)
[DEBUG:Encoder.hpp]: Destroy Sink: 0
[DEBUG:RTSP.cpp]: Got necessary NAL Units.
[INFO:RTSP.cpp]: stream 0 available at: rtsp://10.0.0.54/ch0
[DEBUG:IMPServerMediaSubsession.cpp]: Create Stream Source.
[DEBUG:IMPDeviceSource.cpp]: Device source construct
[DEBUG:Encoder.hpp]: Create Sink: 1
[DEBUG:IMPDeviceSource.cpp]: Device source destruct
[DEBUG:Encoder.hpp]: Destroy Sink: 1
[DEBUG:IMPServerMediaSubsession.cpp]: Create Stream Source.
[DEBUG:IMPDeviceSource.cpp]: Device source construct
[DEBUG:Encoder.hpp]: Create Sink: 2
Encoder_SetGopParam failed

image

stream start but no audio and bad stream image :(

image

marcipan73 commented 6 months ago

Memory FIX Kernel command line: mem=65536K@0x0 rmem=65536K@0x4000000

stream now working 2560x1440 :)

but no audio......

gtxaspec commented 5 months ago

@marcipan73 glad to hear you resolved the stream issue.

regarding audio, are you referring to audio output, or audio in via the rtsp stream?

kohalmi666 commented 5 months ago

I'm also marcipa73, just from a different login.

audio in via the rtsp stream from camrea mic. the RTSP stream it contains only the h265 video stream. it does not include the audio stream.

gtxaspec commented 5 months ago

audio input, via RTSP is not supported yet, but work is being done to add it to the streamer, stay tuned

gtxaspec commented 5 months ago

issue #54 created to improve environment handling with regards to rmem

themactep commented 5 months ago

is this still a thing? my t31x+gc4653 work fine. please close resolved issues.

gtxaspec commented 5 months ago

Working locally. Reopen if issues persistent. 😎