Rockchip · AI & Linux Hub

Экран и звук

Руководство пользователя Rockchip Linux Rockit

Руководство пользователя Rockchip Linux Rockit — V0.0.1

· ArmSoM Editorial · Rockchip source documentation · 23 мин чтения

Основа — RK-YH-YF-960, V0.0.1 от 2022-08-17; сохранены все технические главы. Источник указывает RK3588 и Linux 5.10. Для применения на ArmSoM необходимо проверить конкретную плату, SDK/BSP, ядро и периферию; универсальная поддержка не заявляется. Тестовые команды и запись прошивки не выполнялись. Исходные списки параметров и комментарии сохранены в блоках кода.

Чип Ядро
RK3588 Linux 5.10

1. Расположение исходников

Репозиторий rockit находится в <SDK>/external/rockit.

2. Документация разработчика

Руководство Rockit: <SDK>/docs/Socs/RV1126_RV1109/Multimedia/Rockchip_Developer_Guide_Linux_Rockit_CN.pdf. Руководство Rockit: <SDK>/external/rockit/tgi/doc/Rockchip_Developer_Guide_Linux_Rockit_CN.pdf. Руководство MPI: <SDK>/external/rockit/mpi/doc/Rockchip_Developer_Guide_Linux_Rockit_CN.pdf. Частые вопросы по мультимедийным приложениям: <SDK>/external/rockit/mpi/doc/Rockchip_FAQ_MPI_CN.pdf.

3. Сборка Rockit

Выполните source buildroot/build/envsetup.sh и введите соответствующий номер. В каталоге buildroot запустите make menuconfig, найдите rockit и включите его конфигурацию. При необходимости включите также RGA и GPU. Исходник называет это графической конфигурацией ядра; здесь команда выполняется в Buildroot.

BR2_PACKAGE_ROCKIT=y

Выполните make rockit для сборки, затем пересоберите и запишите прошивку.

4. Основные модули

4.1 VENC Модуль

4.1.1 Описание

Модуль видеокодирования VENC поддерживает главным образом H264, H265, JPEG и MJPEG. Он кодирует несколько потоков в реальном времени независимо друг от друга; протоколы и профили потоков могут различаться. Во время кодирования модуль Region позволяет накладывать и закрывать области изображения.

4.1.2 Тестовые команды

rk_mpi_venc_test

4.1.3 Параметры

-i, --input=<str>            # Input file name
-o, --output=<str>           # Encoding output directory
-n, --loop_count=<int>       # Number of loop test, default value is 1
-w, --width=<int>            # The width of input image <required>
-h, --height=<int>           # The height of input image <required>
--vir_width=<int>            # Virtual width
--vir_height=<int>           # Virtual height
-f, --pixel_format=<int>     # The pixel format of input image, default value is
0 (0: NV12)
                             # For detailed format introduction, please refer to
<SDK>/external/rockit/mpi/sdk/include/rk_comm_video.h
                             # Definition of PIXEL_FORMAT_E, the same as the
following parameters
-C, --codec=<int>            # VENC encoder (8: h264, 9: mjpeg, 12: h265, 15:
jpeg, ...). Default value is 8
--channel_index=<int>        # VENC channel index, default value is 0
--enc_buf_cnt=<int>          # VENC encoding output buffer count, default value
is 8
--crop=<int>                 # Crop type (0: none, 1: crop_only, 2: crop_scale).
Default value is 0
-g,--gop_mode=<int>          # GOP mode (0/1: NORMALP 2: TSVC2 3: TSVC3 4: TSVC4
5: SMARTP). Default value is 0
-s,--snap_pic_cnt=<int>      # Frame rate of the output bitstream
--rotation=<int>             # Image rotation output (0: 0, 1: 90, 2: 180, 3:
270). Default value is 0
--compress_mode=<int>        # Set input compression mode (0: MODE_NONE, 1:
AFBC_16x16). Default value is 0
--rc_mode=<int>              # RC mode, default value is 1
                             # 0:NULL
                             # 1:H264CBR
                             # 2:H264VBR
                             # 3:H264AVBR
                             # 4:H264FIXQP
                             # 5:MJPEGCBR
                             # 6:MJPEGVBR
                             # 7:MJPEGFIXQP
                             # 8:H265CBR
                             # 9:H265VBR
                             # 10:H265AVBR
                             # 11:H265FIXQP
- -b,--bit_rate=<int>        # Bit rate in kbps (range for h264/h265: 3-200000,
range for jpeg/mjpeg: 5-800000, default value is 10*1024kb)
--gop_size=<int>             # Size of the GOP (range >= 1, default value: 60)
--full_range=<int>           # Set color range (0: limit color range, 1: full
color range), default value is 1
--slice_split=<int>          # Slice split testing (0: disabled, 1: enabled),
default value is 0

4.2 VPSS Модуль

4.2.1 Описание

Подсистема обработки видео VPSS (Video Process Sub-System) поддерживает обрезку, масштабирование, преобразование пиксельного формата, поворот на фиксированный угол, Cover/Coverex, зеркальное отражение/переворот, сжатие и распаковку.

4.2.2 Тестовая команда

rk_mpi_vpss_test

4.2.3 Параметры

-i,--input=<str>                  # Input file name, default value is NULL
-o,--output=<str>                 # Output file path, default value is NULL
-n,--loop_count=<int>             # Number of loop test, default value: 1
--video_proc_dev_type=<int>       # Device type for video processing (0: GPU, 1:
RGA), default value: 0
-g,--group_count=<int>            # Count of vpss groups, default value is 1
-c,--channel_count=<int>          # Number of vpss channels, default value is 1
--group_crop_en                   # vpss group cropping is enabled, default value
is 0
--channel_crop_en                 # vpss channel cropping is enabled, default
value is 0
--group_crop_ratio=<int>          # vpss group cropping ratio, range: 1-1000,
default value is 1000
--channel_crop_ratio=<int>        # vpss channel cropping ratio, range: 1-1000,
default value is 1000
-w, --src_width=<int>             # Width of the source bitmap <required>
-h, --src_height=<int>            # Height of the source bitmap <required>
--src_vir_width=<int>             # Virtual width of the source bitmap, default
value is 0
--src_vir_height=<int>            # Virtual height of the source bitmap, default
value is 0
-m, --src_compress=<int>          # Compression mode of the source bitmap,
default value is 0
-f, --src_format=<int>            # Pixel format of the source bitmap, default
value is  0 (NV12)
-W, --dst_width=<int>             # Width of the destination bitmap <required>
-H, --dst_height=<int>            # Height of the destination bitmap <required>
-M, --dst_compress=<int>          # Compression mode of the destination bitmap,
default value is  0
-F, --dst_format=<int>            # Pixel format of the destination bitmap,
default value is  0 (NV12)
-r, --rotation=<int>              # Fixed-angle rotation (0: 0, 1: 90, 2: 180, 3:
270)
--grp_rotation=<int>              # Fixed rotation angle for the vpss group,
default value is  0 (0: 0, 1: 90, 2: 180, 3: 270)
-R, --rotation_ex=<int>           # Arbitrary rotation angle, default value is 0

-a, --attach_mb_pool=<int>        # Whether to use a shared memory pool, default
value is 0 (0: RK_FALSE, 1: RK_TRUE)
--chn_mode=<int>                  # Channel mode, default value is 0 (0: USER, 1:
AUTO, 2: PASS-THOUGH)
-d, --chn_depth=<int>             # Depth of channel output, default value: 8
--mirror=<int>                    # Image mirror operation, default value: 0
--flip=<int>                      # Image flip operation (0: disabled, 1:
enabled)
--src_chn_rate=<int>              # Source bitmap channel frame rate control,
default value is -1
--dst_chn_rate=<int>              # Destination bitmap channel frame rate
control, default value is -1
--src_grp_rate=<int>              # Source bitmap vpss group frame rate control,
default value is -1
--dst_grp_rate=<int>              # Destination bitmap vpss group frame rate
control, default value is -1

4.3 ADEC Модуль

4.3.1 Описание

Модуль аудиодекодирования ADEC поддерживает g711a, g711u, g722, g726 и другие форматы, а также внешние зарегистрированные декодеры.

4.3.2 Тестовая команда

rk_mpi_adec_test

4.3.3 Параметры

-i, --input=<str>             # Input file name, e.g., (./*.mp3) <required>
-C, --codec=<str>             # Codec, e.g., (mp2/g711a/g711u/g726) <required>
--input_ch=<int>              # Number of input stream channels <required>
--input_rate=<int>            # Sample rate of the input stream <required>
-o, --output=<str>            # Output file name, e.g., (./*.pcm), no default
value
-n, --loop_count=<int>        # Number of loop test, default value is 1
-c, --channel_count=<int>     # Number of adec channels, default value is 1
--dec_mode=<int>              # Audio stream decoding mode (0: pack mode, 1:
stream mode), default value is 0
--query_stat=<int>            # Query adec statistics information (0: query, 1:
do not query), default value is 0
--clr_buf=<int>               # Clear channel buffer (0: disabled, 1: enabled),
default value is 0

4.4 AENC Модуль

4.4.1 Описание

Модуль аудиокодирования AENC поддерживает g711a, g711u, g722, g726 и другие форматы, а также внешние зарегистрированные кодеры.

4.4.2 Тестовая команда

rk_mpi_aenc_test

4.4.3 Параметры

-i, --input=<str>             # Input file name, e.g., (./*.mp3) <required>
-C, --codec=<str>             # Codec, e.g., (mp3/aac/flac/mp2/g722/g726)
<required>
--input_ch=<int>              # Number of input stream channels <required>
--input_rate=<int>            # Sample rate of the input stream <required>
--input_format=<int>          # Input format of the input stream <required>
-o, --output=<str>            # Output file name, e.g., (./*.pcm), no default
value
-n, --loop_count=<int>        # Number of loop test, default value is 1
-c, --channel_count=<int>     # Number of aenc channels, default value is 1
--frame_size=<int>            # Size of the transmitted frame, default value is
1024

4.5 AO Модуль

4.5.1 Описание

Модуль аудиовывода AO управляет звуковым интерфейсом SoC Rockchip для вывода аудио.

4.5.2 Тестовая команда

rk_mpi_ao_test

4.5.3 Параметры

-i, --input=<str>             # Input file name, e.g., (./*.pcm) <required>
--input_ch=<int>              # Number of input channels <required>
--input_rate=<int>            # Sample rate of the input data <required>
--device_ch=<int>             # Number of channels of the sound card, default
value is 2
--device_rate=<int>           # Sample rate of the sound card, default value is
48000
-o, --output=<str>            # Output file name, e.g., (

./ao), no default value
-n, --loop_count=<int>        # Number of loop test, default value is 1
-c, --channel_count=<int>     # Number of ao channels, default value is 1
--bit=<int>                   # Bit width of the sound card, valid values is (8,
16, 24), default value: 16
--sound_card_name=<str>       # Name of the opened sound card, default value is
NULL
--set_volume=<int>            # Volume setting, valid range is (0, 100), default
value is 100
--set_mute=<int>              # Mute setting, 1 represents mute, 0 represents
unmute, default value is 0
--set_track_mode=<int>        # Set channel mode, default value is 0
                              # 0: normal (left and right channels are normal)
                              # 1: both_left (Date of left and right channels are
both from left channel)
                              # 2: both_right (Date of left and right channels
are both from right channel)
                              # 3: exchange (left and right channel data
exchange)
                              # 4: mix (left and right channel data mixed output)
                              # 5: left_mute (left channel is muted)
                              # 6: right_mute (right channel is muted)
                              # 7: both_mute (both left and right channels are
muted)
--get_volume=<int>            # Query volume, 0 represents no query, 1 represents
query, default value is 0
--get_mute=<int>              # Query mute status when setting mute, 1 represents
mute, 0 represents unmute, default value is 0
--get_track_mode=<int>        # Query channel mode, default value is 0
--query_stat=<int>            # Query ao statistics information, default value is
0
--pause_resume=<int>          # Pause and resume functionality, 1 represents
pause playback for 1 second, 0 represents no pause, default value is 0
--save_file=<int>             # Test ao and save file, if enabled, it must be set
as an output file, 0 represents disabled, 1 represents enabled, default value is
0
--query_file_stat=<int>       # Query file status, 0 represents no query, 1
represents query, default value is 0
--get_attr=<int>              # Get device attributes, 0 represents no getting, 1
represents getting, default value is 0

4.6 AI Модуль

4.6.1 Описание

Модуль аудиоввода AI управляет звуковым интерфейсом SoC Rockchip для ввода аудио.

4.6.2 Тестовые команды

rk_mpi_ai_test

4.6.3 Параметры

--device_rate=<int>           # Sample rate of the sound card <required>
--device_ch=<int>             # Number of channels of the sound card <required>
--out_ch=<int>                # Number of channels for output data <required>
--out_rate=<int>              # Sample rate for output data <required>
-o, --output=<str>            # Name of the output file, e.g., (./ai), default
value is NULL
-n, --loop_count=<int>        # Number of loop test, default value is 1
-c, --channel_count=<int>     # Count of adec channels, default value is 1
--bit=<int>                   # Bit width of the sound card, 8, 16, 24 are
optional, default value is 16
--sound_card_name=<str>       # Name of the opened sound card, no default value

4.7 MB Модуль

4.7.1 Описание

Реализует общий интерфейс памяти, управление памятью и пулами памяти.

4.7.2 Тестовые команды

rk_mpi_mb_test

4.7.3 Параметры

-n, --loop=<int>          # Number of loops, default value is 1
-c, --mb_count=<int>      # Count of MBs, default value is 1
-s, --mb_size=<int>       # Size of MBs, default value is 4MB
-p, --pool_count=<int>    # Count of pools, default value is 1
-a, --pre_alloc=<int>     # Whether to pre-allocate, default value is 0 (0: no,
1: yes)
-r, --remap_mode=<int>    # Remap mode, default value is 2 (0: none, 256: no
cache, 512: cached)
-t, --alloc_type=<int>    # Allocation type, default value is 0 (0: DMA, 1:
malloc)

4.8 VGS Модуль

4.8.1 Описание

Подсистема видеографики VGS (Video Graphics Sub-System) выполняет масштабирование и поворот входного изображения, наложение OSD и COVER, рисование линий и другие операции.

4.8.2 Тестовые команды

rk_mpi_vgs_test

4.8.3 Параметры

-i, --input=<str>         # Input file name, e.g., (/userdata/1080p.nv12)
<required>
-o, --output=<str>        # Output file path, e.g., (/userdata/vgs/), no default
value
-n, --loop_count=<int>    # Number of test loops, default value is 1
-j, --job_number=<int>    # Job ID corresponding to vgs, default value is 1
-t, --task_number=<int>   # Number of tasks per job, default value is 1
--osd_file=<str>          # Path of OSD file, e.g., (/userdata/vgs/), no default
value
--task_type=<int>         # Task type corresponding to vgs, range is (1,6) (1:
scale, 2: rotate, 3: draw_line, 4: cover, 5: osd, 6: mosaic)
--task_mode=<int>         # Task mode, default value is 1 (1: each job has only
one task type, 2: all task types are on one job)
--task_array_size=<int>   # Size of array task, range is (1,100), default value
is 1
--angle=<int>             # Rotation angle, default value is 1 (0: 0, 1: 90, 2:
180, 3: 270)
--src_width=<int>         # Width of source bitmap, e.g., (1920) <required>
--src_height=<int>        # Height of source bitmap, e.g., (1080) <required>
--src_vir_width=<int>     # Virtual width of source bitmap, e.g., (1920)
--src_vir_height=<int>    # Virtual height of source bitmap, e.g., (1080)
--src_compress=<int>      # Compression mode of the source bitmap, default value
is 0
--src_format=<int>        # Pixel format of the source bitmap, default value is 0
(0 is NV12)
--dst_width=<int>         # Destination bitmap width, e.g., (1920) <required>
--dst_height=<int>        # Destination bitmap height, e.g., (1080) <required>
--dst_compress=<int>      # Compression format of the destination bitmap, default
value is 0
--dst_format=<int>        # Pixel format of the destination bitmap, default value
is 0 (0 is NV12)
--osd_width=<int>         # Width of OSD, e.g., (1920) <required on OSD>
--osd_height=<int>        # Height of OSD, e.g., (1080) <required on OSD>
--osd_compress=<int>      # Compression mode of OSD, default value is 0
--osd_format=<int>        # Pixel format of OSD, default value is 0 (0 is NV12)
--crop_x=<int>            # X-coordinate of the cropped ratio rectangle, default
value is 0
--crop_y=<int>            # Y-coordinate of the cropped ratio rectangle, default
value is 0
--crop_w=<int>            # Width of the cropped ratio rectangle, default value
is 0
--crop_h=<int>            # Height of the cropped ratio rectangle, default value
is 0

4.9 VDEC Модуль

4.9.1 Описание

VDEC предоставляет интерфейс MPI для управления аппаратным видеодекодером и реализует декодирование видео.

4.9.2 Тестовые команды

rk_mpi_vdec_test

4.9.3 Параметры

-i, --input=<str>             # Input file name <required>
-o, --output=<str>            # Decoding output directory
-C, --codec=<int>             # Input stream decoder (8: h264, 9: mjpeg, 12:
h265, ...) <required in StreamMode>
-n, --loop_count=<int>        # Number of loop test, default value is 1
-w, --width=<int>             # Width of input source <required in StreamMode>
-h, --height=<int>            # Height of input source <required in StreamMode>
--channel_index=<int>         # VDEC channel index, default value is 0
-c, --channel_count=<int>     # Count of VDEC channels, default value is 1
--dec_mode=<int>              # VDEC decoding mode, options values are (0:
StreamMode, 1: FrameMode), default value is 0
--dec_buf_cnt=<int>           # Count of VDEC decoding output buffer, default
value is 8
--compress_mode=<int>         # VDEC compression mode, default value is 0 (0:
NONE, 1: AFBC_16X16)
--en_mbpool=<int>             # Enable mb pool, default value is 0
--pixfmt=<int>                # JPEG output pixel mode, default value is 0 (0:
YUV420SP)
--en_dei=<int>                # Enable deinterlace, default value is 0
--en_colmv=<int>              # Enable colmv, default value is 1

4.10 TDE Модуль

4.10.1 Описание

TDE (Two Dimensional Engine) использует аппаратный RGA для быстрого перемещения, заливки цветом, поворота, масштабирования и преобразования формата растровых изображений, наложения с альфа-каналом и операций ColorKey.

4.10.2 Тестовые команды

rk_mpi_tde_test

4.10.3 Параметры

-i, --input=<str>         # Input file name, e.g., (/userdata/1080p.nv12)
<required>
-w, --src_width=<int>     # Width of source bitmap <required>
-h, --src_height=<int>    # Height of source bitmap <required>
--src_vir_width=<int>     # Virtual width of source bitmap
--src_vir_height=<int>    # Virtual height of source bitmap
--src_compress=<int>      # Compression mode of the source bitmap
-W, --dst_width=<int>     # Width of destination bitmap <required>
-H, --dst_height=<int>    # Height of destination bitmap <required>
--dst_compress=<int>      # Compression mode of the destination bitmap
-o, --output=<str>        # Path of output file, e.g., (/userdata/tde/), no
default value
--background=<str>        # Background file, e.g., (/userdata/tde/xxx.bin), no
default value
-n, --loop_count=<int>    # Number of loop test, default value is 1
-p, --operation=<int>     # Operation type, default value is 0
                          # 0: quick copy,
                          # 1: quick resize,
                          # 2: quick fill,
                          # 3: rotation,
                          # 4: mirror and flip,
                          # 5: colorkey
--src_rect_x=<int>        # X-coordinate of the source bitmap operation area,
default value is 0
--src_rect_y=<int>        # Y-coordinate of the source bitmap operation area,
default value is 0
--src_rect_w=<int>        # Width of the source bitmap operation area, default
value is src_width
--src_rect_h=<int>        # Height of the source bitmap operation area, default
value is src_height
--dst_rect_x=<int>        # X-coordinate of the destination bitmap operation
area, default value is 0
--dst_rect_y=<int>        # Y-coordinate of the destination bitmap operation
area, default value is 0
--dst_rect_w=<int>        # Width of the destination bitmap operation area,
default value is dst_width
--dst_rect_h=<int>        # Height of the destination bitmap operation area,
default value is dst_height
--performace=<int>        # Performance test mode, default value is 0
--proc_time=<int>         # Processing time, default value is 800
--colorkey=<int>          # Colorkey value, default value is 0
-c, --fill color=<int>    # Fill color, default value is 0
-r, --rotation=<int>      # Rotation angle, default value is 0 (0: 0, 1: 90, 2:
180, 3: 270)
-m, --mirror=<int>        # Mirror or flip, default value is 0 (0: none, 1: flip,
2: mirror, 3: both)

4.11 VO Модуль

4.11.1 Описание

Модуль видеовывода VO управляет выводом, поддерживает несколько VOP и несколько слоёв. Он включает устройства и каналы вывода, передаёт видеоданные или данные интерфейса UI в выходные каналы.

4.11.2 Тестовые команды

rk_mpi_vo_test

4.11.3 Параметры

-i, --input=<str>         # Input configuration file <required>
-d, --device_id=<int>     # VOP ID, e.g., (0/1), default value is 0
-l, --layer_id=<int>      # Layer ID, e.g., (0/2/4/6), default value is 0
--wbc_enable=<int>        # Enable WBC, e.g., (0), default value is 0
--wbc_bind=<int>          # Enable WBC binding, default value is 1 (0: disable,
1: enable)
--ui=<int>                # UI, e.g., (0), default value is 0
--loopCount=<int>         # Number of loops, e.g., (0), default value is 10
--ui_alpha=<int>          # ui_alpha, e.g., (0), default value is 0
-w, --Windows=<int>       # Number of windows, e.g., [1-64], default value is 4,
maximum value is 63
--ConnectorType=<int>     # Connected type, e.g., (0: HDMI 1: EDP 2: VGA)
<required>
--layer_mode=<int>        # Layer type, e.g., (0: CURSOR 1: UI 2: Video)
<required>
--display_mode=<int>      # Display mode, e.g., (12/14), default value is 12 (12
represents 1080P60) <required>
--display0_mode=<int>     # Display mode, e.g., (12/14), default value is 12 (12
represents 1080P60) <required>
--disp_frmrt=<int>        # Display frame rate, default value is 25
--disp_frmrt_ratio=<int>  # Display frame rate ratio, e.g., (32, 16, 8, 4, 2, 1),
default value is 1
--aspect_mode=<int>       # Screen aspect ratio, e.g., (1: ratio is no change 2:
set ratio manually), default value is 1
--border_lpx=<int>        # Border attribute lpx, default value is 2
--border_rpx=<int>        # Border attribute rpx, default value is 2
--border_tpx=<int>        # Border attribute tpx, default value is 2
--border_bpx=<int>        # Border attribute bpx, default value is 2
--disp_x=<int>            # disp_x, default value is 0
--disp_y=<int>            # disp_y, default value is 0
--video_format=<int>      # Pixel format of video (0: ARGB8888 1: ABGR888 2:
RGB888 3: BGR888 4: RK_FMT_YUV420SP), default value is 4 (4 for RGB888)
--disp_width=<int>        # Destination width, e.g., (1920) <required>
--disp_height=<int>       # Destination height, e.g., (1080) <required>
--image0_width=<int>      # Width of image0, e.g., (1920) <required>
--image0_height=<int>     # Height of image0, e.g., (1080) <required>
--image1_width=<int>      # Width of image1, e.g., (1024) <required>
--image1_height=<int>     # Height of image1, e.g., (768) <required

>
--disp0_width=<int>       # Width of destination bitmap, e.g., (1920) <required>
--disp0_height=<int>      # Height of destination bitmap, e.g., (1080) <required>
--disp1_width=<int>       # Width of destination bitmap, e.g., (1024) <required>
--disp1_height=<int>      # Height of destination bitmap, e.g., (768) <required>
--image_width=<int>       # Width of destination bitmap, e.g., (1920) <required>
--image_height=<int>      # Height of destination bitmap, e.g., (1080) <required>
--wbc_width=<int>         # Width of destination bitmap, e.g., (1920) <required>
--wbc_height=<int>        # Height of destination bitmap, e.g., (1080) <required>
--wbc_compress=<int>      # WBC compression mode, default value is 0
--wbc_format=<int>        # WBC pixel format, e.g., (0: ARGB8888 1: ABGR888 2:
RGB888 3: BGR888), default value is 0
--wbc_type=<int>          # WBC operation type, e.g., (0: dev 1: video), default
value is 1
--wbc_id=<int>            # WBC operation ID, default value is 0
--voplay=<str>            # Video playback test, default value is 0 (0: RK_FALSE,
1: RK_TRUE)
--bBorder=<str>           # Enable Border, default value is 0 (0: RK_FALSE, 1:
RK_TRUE)
--wbc_auto=<str>          # WBC auto bind, default value is 1 (0: RK_FALSE, 1:
RK_TRUE)
--screen0_chn=<int>       # Number of channels for screen0, default value is 16
--chn_display=<int>       # Channel display mode, e.g., (0: normal 1: pause 2:
step 3: speed), default value is 0
--screen1_chn=<int>       # Number of channels for screen1, default value is 4
--screen0_rows=<int>      # Rows and columns for displaying screen0, default
value is 4 (4x4)
--screen1_rows=<int>      # Rows and columns for displaying screen1, default
value is 3 (3x3)
--en_wbc=<int>            # Enable WBC, default value is 0
--en_chnPriority=<int>    # Enable channel priority, default value is 0
--wbc_src=<int>           # WBC source, default value is 1
--double_screen=<int>     # Enable double screen, default value is 1 (0: FALSE,
1: TRUE)
--Homologous=<int>        # Homologous display, default value is 0

4.12 AVS Модуль

4.12.1 Описание

Модуль AVS (Any View Stitching) сшивает панораму из нескольких изображений и выводит её в заданной проекции.

4.12.2 Тестовые команды

rk_mpi_avs_test

4.12.3 Параметры

-m, --test_mode=<int>                # Test mode, default value is 0
                                     # 0: avs module. 8xEquirectangular,
6xRectilinear.
                                     # 1: avs module. 6xNoBlend_Hor,
6xNoBlend_Ver, 4xNoBlend_Qr.
                                     # 2: vi -> avs -> vo. 6xEquirectangular.)
-n, --loop_count=<int>               # Number of test loops, default value is 100
-c, --link_compress_mode=<int>       # Compression mode, default value is 1 (0:
Uncompress, 1: AFBC)
-p, --avs_pipe_sync=<int>            # Enable AVS pipe sync, default value is 0
(0: Disable)
--params_sources=<int>               # Parameters used for panoramic stitching
through mesh or calib, default value is 0 (0: mesh, 1: calib)
--connector_type=<int>               # Connector type, default value is 3 (0:
HDMI0, 3: MIPI)

4.13 VI Модуль

4.13.1 Описание

Модуль видеоввода VI принимает данные через MIPI Rx (включая MIPI и LVDS), BT.1120, BT.656, BT.601, DC и другие интерфейсы. Полученные данные сохраняются в заданной области памяти.

4.13.2 Тестовые команды

rk_mpi_vi_test

4.13.3 Параметры

-w, --width=<int>         # Set the width of capture channel, default value is 0
<required>
-h, --height=<int>        # Set the height of capture channel, default value is 0
<required>
-d, --dev=<int>           # Set device ID, default value is 0
-p, --pipe=<int>          # Set pipe ID, default value is 0
-c, --channel=<int>       # Set channel ID, default value is 1
-l, --loopcount=<int>     # Set capture frame count (default value is 100)
-C, --compressmode=<int>  # Set capture compression mode, default value is 0 (0:
MODE_NONE, 1: AFBC_16x16)
-o, --output=<int>        # Save output file, which is saved as
/data/test_<devid>_<pipeid>_<channelid>.bin, default value is 0 (0: no save, 1:
save)
-m, --mode=<int>          # Test mode, default value is 1
                          # 0: vi get&release frame
                          # 1: vi bind one venc (h264)
                          # 2: vi bind two venc (h264)
                          # 3: vi bind vpss bind venc
                          # 4: vi bind vo (only support 356x now)
-t, --memorytype=<int>    # Set buffer memory type, default value is 4 <required>
                          # 1: mmap (hdmiin/bt1120/sensor input)
                          # 2: userptr (invalid)
                          # 3: overlay (invalid)
                          # 4: dma (sensor)
-n, --name=<str>          # Set entity name, no default value (rv1126 sensor:
rkispp_m_bypass rkispp_scale0 rkispp_scale1 rkispp_scale2; rv1126
hdmiin/bt1120/sensor: /dev/videox such as /dev/video19 /dev/video20) <required>;
rk356x hdmiin/bt1120/sensor: /dev/videox such as /dev/video0 /dev/video1)
-D, --depth=<int>         # Channel output depth, default value is {u32BufCount
(not bind) or 0 (bind venc/vpss/...)}
-f, --format=<int>        # Set format, default value is 0
                          # 0: RK_FMT_YUV420SP
                          # 10: RK_FMT_YUV422_UYVY1310
                          # 80: RK_FMT_RGB_BAYER_SBGGR_12BPP
--src_rate=<int>          # Source bitmap frame rate, default value is -1 (-1:
not control; other: 1-max_fps<isp_out_fps>)
--dst_rate=<int>          # Destination bitmap frame rate, default value is -1
(-1: not control; other: 1-src_fps<src_rate>)
-U, --user_pic=<int>      # Enable using user-specified picture as vi input
--rgn_type=<int>          # rgn type (0: overlay, 1: overlayEx, 2: cover, 3:
coverEx, 4: mosaic, 5: mosaicEx)
--rgn_cnt=<int>           # rgn count, default value is 1, maximum value is 8
--en_rgn=<int>            # Enable region, default value is 0
--get_connect_info=<int>  # Get connection information, default value is 0
--get_edid=<int>          # Get edid, default value is 0
--set_edid=<int>          # Set edid default value is 0

4.14 RGN Модуль

4.14.1 Описание

Для отображения номера канала, времени и других сведений на видео накладывают OSD; при необходимости области закрывают цветными блоками. Такие OSD и закрывающие блоки называются регионами. Модуль REGION централизованно управляет этими ресурсами.

4.14.2 Тестовая команда

rk_mpi_rgn_test

4.14.3 Параметры

-i, --input_raw_name=<str>    # The file name of input raw data, default value is
RK_NULL
--input_bmp_name=<str>        # The file name of input bmp data <required>
-o, --output_name=<str>       # The file name of output stream, default value is
RK_NULL
-r, --rgn_count=<int>         # Number of rgn handles, default value is 1
-p, --operation=<int>         # Rgn operation, default value is 0 (0: overlay, 1:
cover, 2: mosaic, 3: line)
-x, --rect_x=<int>            # Starting x-coordinate of rgn area, default value
is 0
-y, --rect_y=<int>            # Starting y-coordinate of rgn area, default value
is 0
-w, --bmp_w=<int>             # Width of bmp, default value is 0 <required>
-h, --bmp_h=<int>             # Height of bmp, default value is 0 <required>
-W, --raw_w=<int>             # Raw width, default value is 0 <required>
-H, --raw_h=<int>             # Raw height, default value is 0 <required>
-F, --raw_fmt=<int>           # Raw pixel format, default value is 0 (0: NV12)
-f, --format=<int>            # Bmp pixel format, default value is 65557 (65546:
ARGB1555, 65557: BGRA5551)
--mod=<int>                   # Additional module, default value is 4 (4: VENC,
6: VPSS)
--cover_type=<int>            # Cover type, default value is 0 (0: rect, 1: quad)

4.15 SYS Модуль

4.15.1 Описание

Модуль управления системой реализует общие интерфейсы RK MPI, системные функции и управление большими блоками физической памяти.

4.15.2 Тестовая команда

rk_mpi_sys_test

4.15.3 Параметр

-n, --loop_count=<int>        # Number of loop test, default value is 1
--device_id=<int>             # ID of the module device, default value is 0
--src_channel_id=<int>        # Source module channel ID, default value is 0
--dst_channel_count=<int>     # Count of destination module channels, default
value is 1

Расхождения и проверка источников

  • Китайский источник содержит 18 страниц, английский 20; оба охватывают 15 модулей. Английский явно добавляет <SDK> к путям; китайские /external и /docs относятся к дереву SDK.
  • Английский уточняет VPSS --flip: 0 выключено, 1 включено; AO --query_stat: по умолчанию 0. Уточнения сохранены, но требуют проверки по SDK.
  • AENC --channel_count: китайский пишет adec, английский aenc. Для AI оба пишут adec. VGS --dst_width: китайский называет исходную ширину, английский — целевую. В китайском описании AO ошибочно упомянут ввод, хотя модуль выполняет вывод.
  • Неустранённые противоречия обоих источников: MB --remap_mode по умолчанию 2, но варианты 0/256/512; VO --Windows показывает [1-64], но максимум 63; --video_format задаёт 4 как RK_FMT_YUV420SP, а описание значения по умолчанию 4 называет RGB888. Значения сохранены без догадок.
  • Сохранены написания --performace, --fill color, PASS-THOUGH, RK_FMT_YUV422_UYVY1310. Китайское moscaiEx соответствует английскому mosaicEx. Английский выводит - -b,--bit_rate, китайский -b,--bit_rate. Перед использованием проверяйте справку программы и исходники SDK.
  • В описании ADEC есть g722, а в списке примеров codec его нет. AENC приводит mp3 как вход и pcm как выход; эти примеры не определяют реальное направление кодека. Оба источника называют --snap_pic_cnt частотой кадров — проверьте реализацию. Исходник называет Buildroot menuconfig конфигурацией ядра; здесь команда выполняется в Buildroot.

Другие статьи по теме → · Учебные маршруты →