This project is a demo of a USB camera door lock, supporting end-to-end (BK7258 device) to mobile app demonstrations. By default, it supports Shangyun for network transmission.
The difference between doorbell_4M and doorbell_8M is that the former does not support DVP cameras and does not support the on-board microphone.
The macros supporting 4M are configured on CPU1, The path is media/doorbell_4M/config/bk7258_cp1/config, and the macro configuration differences between the two projects are as follows:
project
marco
value
implication
doorbell_4M
CONFIG_MEDIA_PSRAM_SIZE_4M
Y
PSRAM is 4M
doorbell_8M
CONFIG_MEDIA_PSRAM_SIZE_4M
N
PSRAM is 8M
The allocation of PSRAM with different sizes is shown in the following table. The config file needs to be modified, with the file path as follows:
media/doorbell_4M/config/bk7258/config
media/doorbell_4M/config/bk7258_cp1/config
media/doorbell_4M/config/bk7258_cp2/config
project
doorbell_4M
doorbell_8M
CONFIG_PSRAM_MEM_SLAB_USER_SIZE
0
102400
CONFIG_PSRAM_MEM_SLAB_AUDIO_SIZE
51200
102400
CONFIG_PSRAM_MEM_SLAB_ENCODE_SIZE
946176
1433600
CONFIG_PSRAM_MEM_SLAB_DISPLAY_SIZE
2490368
5701632
CONFIG_PSRAM_HEAP_SIZE (CP0)
0x7D000
0x80000
CONFIG_PSRAM_HEAP_SIZE (CP1)
0x2F000
0x80000
The flow is as shown in the following diagram:
Figure 1. doorbell_4M decode process
Figure 2. doorbell_8M decode process
The main differences in the process are as shown in the following table:
project
decode process
doorbell_4M
Firstly, attempt to obtain the YUV image, and continue with the decoding only after the allocation is successful.
The LCD display triggers the next image capture process immediately after completion.
doorbell_8M
Directly decode, and upon failure to obtain the YUV image, immediately release the JPEG and wait for the next frame of JPEG.
Demo result: During runtime, UVC, LCD, and AUDIO will be activated. The LCD will display UVC and output JPEG (864X480) images that have been decoded and rotated 90 degrees before being displayed on the LCD (480X854),
After decoding, the YUV is encoded with H264 and transmitted to the mobile phone for display via WIFI (864X480).
Hint
If you do not have cloud account permissions, you can use debug mode to set the local area network TCP/UDP image transmission method.
For the media module, the biggest difference between the 4M and 8M configurations is the reduction in PSRAM size, which in turn reduces the number of internal buffer images, as shown in the following table:
project
YUV images
JPEG images
H264 images
doorbell_4M
3
4
4
doorbell_8M
5
4
8
To modify the project from 8M FLASH + 8M PSRAM to 4M FLASH + 4M PSRAM, follow the steps below:
Synchronize the modifications according to the patch. The patch’s commit title is “PSRAM configuration for image transmission-related buffers when the size is 4M.”
There are three commits in total, and the code directory and involved files are as shown in the following table: