Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

41.25 fps from sensor sc223a (sc5239s) #1324

Closed
RoboSchmied opened this issue Feb 23, 2024 · 22 comments
Closed

41.25 fps from sensor sc223a (sc5239s) #1324

RoboSchmied opened this issue Feb 23, 2024 · 22 comments

Comments

@RoboSchmied
Copy link
Contributor

RoboSchmied commented Feb 23, 2024

You can get 41.24 fps on gk7205v210 with sensor sc5239s (which openipc labels sc223a), not only 30 fps.

Set fps: 45 in /etc/majestic.yaml and Isp_FrameRate=45 in /etc/sensors/sc223a_i2c_1080p.ini.
majestic output:

05:26:22  <       majestic> [    puts]                               linear mode
[Func]:cmos_fps_set [Line]:288 [Info]:Not support Fps: 45.000000
05:26:22  <       majestic> [    puts]                               === Smart SC223A_1080P_30FPS_10BIT_LINE_Init_OK!===
05:26:22  <       majestic> [     sdk] log_venc_chn@1256             H.264 1920x1080 45fps 6000Kbit  90 GOP

Majestic says it can Not support Fps: 45, but it is running faster than only with fps: 30 settings.

So should this be the new default for sc223a, even if the value you set (45 fps) is not exactly what you will get from sensor (41.24 fps) ?

The video looks more fluently. The frames are unique. No double frames are produced.

Can someone owning a sc223a please confirm the frame rate after changing the 2 lines?
Thank you.

@jimsmt
Copy link
Contributor

jimsmt commented Feb 28, 2024

https://smartsens.oss-cn-beijing.aliyuncs.com/web/products/SC223A_V3.0.pdf
The sensor's physic limit is 30fps, I doubt that you really got 41.24 fps

@RoboSchmied RoboSchmied changed the title 41.25 fps from sensor sc223a 41.25 fps from sensor sc223a (sc5239s) Feb 28, 2024
@RoboSchmied
Copy link
Contributor Author

RoboSchmied commented Feb 28, 2024

Thank you for the info.
Actually I bought a sensor advertised as sc5239s (4MP) which OpenIPC recognizes as sc223a (2MP). And with the driver of sensor sc223a it can bring 41.24 fps.

OK, so I think the sensor distinction has to be corrected before changing any values for the wrong sensor.

@themactep
Copy link
Collaborator

Do you have a datasheet on your sensor? Read its hardware ID to confirm the model.

@themactep
Copy link
Collaborator

SC5239s would be a 5MP sensor, not 4MP. First digit denotes the resolution. If you were sold it as a 4MP, that should raise question if it is a legitimate hardware and if it is a 2MP SC223a instead.

@RoboSchmied
Copy link
Contributor Author

If you were sold it as a 4MP, that should raise question if it is a legitimate hardware and if it is a 2MP SC223a instead

I bought the sensor here: aliexpress.
It is advertised as 4MP. The stock firmware offers the 4MP mode and it brings 4MP.

It is definitely not only 2 MP.

@themactep
Copy link
Collaborator

Very reassuring. You know what? I have a bridge to sell you.

@themactep
Copy link
Collaborator

@RoboSchmied
Copy link
Contributor Author

Very reassuring.

Sorry, I would not doubt your expertise.

I have a bridge to sell you.

How much? ;)

https://www.smartsenstech.com/en/mproducts_list?products_label=sc

Thank you. I was unaware of the sensor labeling.

Do you have a datasheet on your sensor?

No.

Read its hardware ID to confirm the model.

Ok, I will try now.

@RoboSchmied
Copy link
Contributor Author

RoboSchmied commented Feb 28, 2024

Read its hardware ID to confirm the model.

How do I get the hardware ID?
Here is the ipctool output:

root@openipc-gk7205v210:~# ipctool 
---
chip:
  vendor: Goke
  model: 7205V210
  id: 24662c1050a059e3
board:
  vendor: OpenIPC
  version: 2.4.01.19
ethernet:
  mac: "da:3c:1a:69:b2:bc"
  u-mdio-phyaddr: 1
  phy-id: 0x20669906
  d-mdio-phyaddr: 0
rom:
- type: nor
  block: 64K
  partitions:
    - name: boot
      size: 0x40000
      sha1: deca8aff
    - name: env
      size: 0x10000
      sha1: 6b5302d6
      contains:
        - name: uboot-env
          offset: 0x0
    - name: kernel
      size: 0x200000
      sha1: 381b79bd
    - name: rootfs
      size: 0x500000
      sha1: b323395a
    - name: rootfs_data
      size: 0xb0000
      path: /overlay,jffs2,rw
  size: 8M
  addr-mode: 3-byte
ram:
  total: 64M
  media: 24M
firmware:
  kernel: "4.9.37 (Fri Jan 19 23:35:21 CET 2024)"
  toolchain: buildroot-gcc-12.3.0
  main-app: wfb_tx
sensors:
- vendor: SmartSens
  model: SC223A
  control:
    bus: 0
    type: i2c
    addr: 0x60
  data:
    type: MIPI
    input-data-type: DATA_TYPE_RAW_10BIT
    lane-id:
      - 0
      - 1
    image: 1920x1080
  clock: 37.125MHz

Here some dmesg output:

<0>FUNC:parse_sensor_clock line:125  SNS: is [sc223a]!
<0>FUNC:parse_sensor_bus_type line:88  SNS is [sc223a]  !
<0>==== online_flag=0, cmos_yuv_flag=0, sensor=sc223a, chip=gk7205v200, board=demo====

@themactep
Copy link
Collaborator

@RoboSchmied
Copy link
Contributor Author

RoboSchmied commented Feb 28, 2024

https://github.com/themactep/openipc-wiki/blob/master/hardware/components/sensor/detection.md

Thank you.

Here my results:

root@openipc-gk7205v210:~# i2cdetect -l
i2c-1	i2c       	goke-i2c                        	I2C adapter
i2c-2	i2c       	goke-i2c                        	I2C adapter
i2c-0	i2c       	goke-i2c                        	I2C adapter
root@openipc-gk7205v210:~# i2cdetect -yr 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: 30 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
root@openipc-gk7205v210:~# i2cget -yf 0 0x30 0xf0
0x00
root@openipc-gk7205v210:~# i2cget -yf 0 0x30 0xf1
0x00
root@openipc-gk7205v210:~# i2cdetect -yr 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
root@openipc-gk7205v210:~# i2cdetect -yr 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
root@openipc-gk7205v210:~# ls /sys/bus/i2c/devices/ 
0-0036  1-0036  i2c-0   i2c-1   i2c-2
root@openipc-gk7205v210:~# cat /sys/bus/i2c/devices/0-0036/name 
sensor_i2c
root@openipc-gk7205v210:~# cat /sys/bus/i2c/devices/1-0036/name 
sensor_i2c

root@openipc-gk7205v210:~# ipctool i2cdetect
       0  1  2  3  4  5  6  7   8  9  a  b  c  d  e  f
    : xx xx xx xx xx xx xx xx  xx xx xx xx xx xx xx xx  |  
  10: xx xx xx xx xx xx xx xx  xx xx xx xx xx xx xx xx  |  
  20: xx xx xx xx xx xx xx xx  xx xx xx xx xx xx xx xx  |  
  30: xx xx xx xx xx xx xx xx  xx xx xx xx xx xx xx xx  |  
  40: xx xx xx xx xx xx xx xx  xx xx xx xx xx xx xx xx  |  
  50: xx xx xx xx xx xx xx xx  xx xx xx xx xx xx xx xx  |  
  60: 60 61 xx xx xx xx xx xx  xx xx xx xx xx xx xx xx  |  
  70: xx xx xx xx xx xx xx xx  xx xx xx xx xx xx xx xx  |  
  80: xx xx xx xx xx xx xx xx  xx xx xx xx xx xx xx xx  |  
  90: xx xx xx xx xx xx xx xx  xx xx xx xx xx xx xx xx  |  
  a0: xx xx xx xx xx xx xx xx  xx xx xx xx xx xx xx xx  |  
  b0: xx xx xx xx xx xx xx xx  xx xx xx xx xx xx xx xx  |  
  c0: xx xx xx xx xx xx xx xx  xx xx xx xx xx xx xx xx  |  
  d0: xx xx xx xx xx xx xx xx  xx xx xx xx xx xx xx xx  |  
  e0: xx xx xx xx xx xx xx xx  xx xx xx xx xx xx xx xx  |  
  f0: xx xx xx xx xx xx xx xx  xx xx xx xx xx xx xx 
root@openipc-gk7205v210:~# ipctool i2cdump 0x60 0xf0 0xf2
       0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
  f0: 00 00 
root@openipc-gk7205v210:~# ipctool i2cdump 0x61 0xf0 0xf2
       0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
  f0: 00 00

@themactep
Copy link
Collaborator

Now you need values from registers 0x3107 and 0x3108 at address 0x30. These are the most common with Smartsens sensors.

@RoboSchmied
Copy link
Contributor Author

Now you need values from registers 0x3107 and 0x3108 at address 0x30.

root@openipc-gk7205v210:~# ipctool i2cdump 0x30 0x3107 0x3108
       0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
FFFFFFFF  
root@openipc-gk7205v210:~# ipctool i2cdump 0x60 0x3107 0x3108
       0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
CB  

@themactep
Copy link
Collaborator

ipctool is kinda stupid and does not include the last region in the sequence. Use 0x3107 0x3109 range.

@RoboSchmied
Copy link
Contributor Author

# here some more registers:
root@openipc-gk7205v210:~# ipctool i2cdump 0x60 0x3100 0x310F
       0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
3100: 00 12 00 08 01 12 05 CB  3E 01 00 00 00 00 00

@themactep
Copy link
Collaborator

SC223A 0x60 0x3107:0xCB 0x3108:0x3E 30 1920x1080

@themactep
Copy link
Collaborator

Alas, you got tricked by the seller.

@RoboSchmied
Copy link
Contributor Author

RoboSchmied commented Feb 28, 2024

Alas, you got tricked by the seller.

Maybe, but:
There are 2 main arguments that speak against the it is sensor sc223a - theory:

  • This system (with stock fw) can give a 4MP stream(2560x1440) that looks very sharp (no double pixel).
  • The sensor can do 41,24 fps with sc223a driver (which is said to be impossible for sc223a).

@themactep
Why is it important to know if it is the sc223a or not:

  • I changed settings (fps) in the repo for sc223a driver because it worked for my sensor. If I do not have the real sc223a, my merged repo changes may break compatibility for the real sc223a sensor in OpenIPC. This is what I want to avoid and which I (maybe) have to undo after clarification.

@themactep
Copy link
Collaborator

You have the device ID. I don't know what alternative evidence you are looking for, but I usually try to not getting involved in religious debates and debates with whitneses of SC5239S. That is a pink unicorn sensor even the manufacturer is not aware of. Google the name, you will get all kind of grifters advertizing it with parameters from 3mp to 5mp and mysteriously shapeshifting sizes.

It is the new black to upscale resolution from a shitty 2mp sensor to 2k output, or whatever the soc can handle. E.g. Cinnado D1 2K camera is equipped with SC2336 sensor. Same for dozens of other cameras on the market. Beacause marketing, and people are stupid gullible

The fps you get is from isp, not the sensor.

@RoboSchmied
Copy link
Contributor Author

RoboSchmied commented Feb 29, 2024

The fps you get is from isp, not the sensor.

Here you can see a capture of the stream clearly showing 41 unique frames per second with high-resolution-timer in vid, confirmed by @widgetii.

Nothing religious, pure data. ;)

@jimsmt
Copy link
Contributor

jimsmt commented Feb 29, 2024

There's possibility that it's SC233A which is capable of 1080p@60fps

@RoboSchmied
Copy link
Contributor Author

RoboSchmied commented Mar 1, 2024

Thank you all for helping.

Here we got the proof that chip ID cb3e is not unique.
3 Sensors (in openipc) are using it.

  • sc223a
  • sc233a
  • sc2239p

At the moment, ipctool recognizes all 3 sensors as sc223a.

This issue will be resolved here: OpenIPC/ipctool#112

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants