From c3ce287fb5ea3349fc3b70d33523c4562ca885d0 Mon Sep 17 00:00:00 2001 From: tzz-radxa Date: Sun, 20 Sep 2026 17:29:36 +0800 Subject: [PATCH] docs(accessories): use single-line command for HDMI audio capture test Combine the video capture and audio recording steps into one 'bash -c' command so users can copy and run it directly, and align the Chinese and English versions. --- .../_hdmi-in-to-mipi-csi2-usage.mdx | 19 ++----------------- .../_hdmi-in-to-mipi-csi2-usage.mdx | 19 ++----------------- 2 files changed, 4 insertions(+), 34 deletions(-) diff --git a/docs/common/accessories/_hdmi-in-to-mipi-csi2-usage.mdx b/docs/common/accessories/_hdmi-in-to-mipi-csi2-usage.mdx index 83f8a17ee..e4fe28a04 100644 --- a/docs/common/accessories/_hdmi-in-to-mipi-csi2-usage.mdx +++ b/docs/common/accessories/_hdmi-in-to-mipi-csi2-usage.mdx @@ -115,25 +115,10 @@ rk628_csi_format_change: New format: 1920x1080p60.00 (2200x1125) 确认主板已连接耳机或音箱,并且 HDMI 输出设备的音频已经输出到 HDMI。 -以下命令在后台保持约 8 秒视频取流,同时录制 5 秒 WAV 文件。由于 RK628 的音频输出需要视频采集链路保持运行,录制期间不能停止视频取流。 +以下为单行命令,可直接复制执行:在后台保持约 8 秒视频取流,同时录制 5 秒 WAV 文件。由于 RK628 的音频输出需要视频采集链路保持运行,录制期间不能停止视频取流。
-  {`v4l2-ctl -d ${props.video_dev} \\
-  --set-fmt-video=width=1920,height=1080,pixelformat=NV12 \\
-  --stream-mmap=3 --stream-poll \\
-  --stream-count=480 --stream-to=/dev/null \\
-  >/dev/null 2>&1 &
-VIDEO_PID=$!
-
-sleep 1
-
-arecord \\
-  -D hw:CARD=${props.audio_capture_card},DEV=0 \\
-  -f S16_LE -r 48000 -c 2 \\
-  -d 5 -t wav \\
-  rk628-audio.wav
-
-wait "$VIDEO_PID"`}
+  {`bash -c 'v4l2-ctl -d ${props.video_dev} --set-fmt-video=width=1920,height=1080,pixelformat=NV12 --stream-mmap=3 --stream-poll --stream-count=480 --stream-to=/dev/null >/dev/null 2>&1 & video_pid=$!; sleep 1; arecord -D hw:CARD=${props.audio_capture_card},DEV=0 -f S16_LE -r 48000 -c 2 -d 5 -t wav rk628-audio.wav; wait "$video_pid"'`}
 
视频数据写入 `/dev/null`,不会生成视频文件。 diff --git a/i18n/en/docusaurus-plugin-content-docs/current/common/accessories/_hdmi-in-to-mipi-csi2-usage.mdx b/i18n/en/docusaurus-plugin-content-docs/current/common/accessories/_hdmi-in-to-mipi-csi2-usage.mdx index bfb7f003c..68325bc8c 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/common/accessories/_hdmi-in-to-mipi-csi2-usage.mdx +++ b/i18n/en/docusaurus-plugin-content-docs/current/common/accessories/_hdmi-in-to-mipi-csi2-usage.mdx @@ -115,25 +115,10 @@ If the picture is corrupted, power off the board, recheck the hardware connectio Make sure a headphone or speaker is connected to the board, and that the audio of the HDMI output device is routed to HDMI. -The following command keeps the video stream running in the background for about 8 seconds and records a 5-second WAV file. Because the RK628 audio output requires the video capture pipeline to keep running, the video stream must not be stopped while recording. +The following is a single-line command you can copy and run directly: it keeps the video stream running in the background for about 8 seconds while recording a 5-second WAV file. Because the RK628 audio output requires the video capture pipeline to keep running, the video stream must not be stopped while recording.
-  {`v4l2-ctl -d ${props.video_dev} \\
-  --set-fmt-video=width=1920,height=1080,pixelformat=NV12 \\
-  --stream-mmap=3 --stream-poll \\
-  --stream-count=480 --stream-to=/dev/null \\
-  >/dev/null 2>&1 &
-VIDEO_PID=$!
-
-sleep 1
-
-arecord \\
-  -D hw:CARD=${props.audio_capture_card},DEV=0 \\
-  -f S16_LE -r 48000 -c 2 \\
-  -d 5 -t wav \\
-  rk628-audio.wav
-
-wait "$VIDEO_PID"`}
+  {`bash -c 'v4l2-ctl -d ${props.video_dev} --set-fmt-video=width=1920,height=1080,pixelformat=NV12 --stream-mmap=3 --stream-poll --stream-count=480 --stream-to=/dev/null >/dev/null 2>&1 & video_pid=$!; sleep 1; arecord -D hw:CARD=${props.audio_capture_card},DEV=0 -f S16_LE -r 48000 -c 2 -d 5 -t wav rk628-audio.wav; wait "$video_pid"'`}
 
The video data is written to `/dev/null`, so no video file is generated.