Camera preview on HDMI

Hi, from the Thundercomm stock firmware, is there a possibility to preview the camera over the HDMI?

Hey wcliew,

As far as I know, there’s no pre-baked solution for doing this.

Rob.

Hi Rob,

Do you know of some methods?

From the HAL3_test, we’re able to write the video frame into files, if we’re able to write the frame to frame buffer, wouldn’t it able to preview over HDMI? but from the example code, there is no code describe the operation of HDMI.

I think there is no pre-baked solution.

So either going down the Android route for quick testing, or writing a HAL3 based viewer for the yocto distribution is needed.

Can you run something like ffmpeg/ffplay or VLC on yocto? If so, you should be able to write the frames to a pipe or named pipe and playback from the pipe.

How about on Debian 20.07? Is the OV8856 camera works on it?

Also on the AOSP, can I use camera?

So let’s pause for a second.

There are two kernel flavours.
The Qcom downstream one that Thundercom ships, it supports HAL3 and has required proprietary userspace components to work. It should be able to display camera output using something a standard Android Camera application.

The other variant is the Upstream based kernel that Linaro maintains for 96boards. It is no support for cameras on the db845c at the moment, although I am working on this and if you want to have a look at what I’m doing I attached a current branch below. This camera API supported by this work is not HAL3 since it is Android specific, but instead V4L2.

https://git.linaro.org/people/robert.foss/linux.git/log/?h=camss_sdm845_cleanup_v4

Hi, any idea on the possibility to use gst-launch to make preview of camera on the HDMI?

Hi Robert,

Thanks for info, looking forward for the release.

Great work!

I was writing up instructions for someone else, and thought you might be interested as well.

I’m currently uploading the rootfs image, and it will take ~2hrs before the upload completes. So don’t download it this very second.

#### URLs
linux -- https://git.linaro.org/people/robert.foss/linux.git/log/?h=camss_sdm845_rebase_v3
libcamera -- https://github.com/andrey-konovalov/libcamera
build_db845c.sh -- https://allg.one/XgLr
.config -- https://allg.one/V9xd
boot.img -- https://people.linaro.org/~robert.foss/boot_db845c_camss_sdm845_rebase_v3.img
rootfs.img -- https://people.linaro.org/~robert.foss/linaro-buster-alip-dragonboard-845c-124.img_repacked_5g


#### Kernel & boot.img
## Alternative #1  Use prebaked boot.img
wget https://people.linaro.org/~robert.foss/boot_db845c_camss_sdm845_rebase_v3.img -O boot.img
flashboot flash boot boot.img

## Alternative #2  Build the kernel yourself
git clone https://git.linaro.org/people/robert.foss/linux.git --branch=camss_sdm845_rebase_v3
cd linux
wget https://allg.one/V9xd -O .config

wget https://allg.one/XgLr -O build_db845c.sh
chmod +x build_db845c.sh
./build_db845c.sh
fastboot flash boot tmp/boot_db845c.img


#### Rootfs & libcamera
## Alternative #1  Use prebaked rootfs
wget https://people.linaro.org/~robert.foss/linaro-buster-alip-dragonboard-845c-124.img_repacked_5g -O rootfs.img
fastboot flash rootfs rootfs.img


## Alternative #2  Set up your own rootfs to run libcamera/qcam
# Before building linaro, set up your favorite rootfs
git clone https://github.com/andrey-konovalov/libcamera --branch=software-debayer-20200905
cd libcamera
meson setup build -Dpipelines=simple -Dtest=false -Dtracing=disabled --prefix=/usr
sudo ninja -C build install

#### Testing libcamera
## List devices
cam -l

## Open qcam viewer with the ov8856 sensor
qcam -c /base/soc@0/cci@ac4a000/i2c-bus@0/camera@10
1 Like

Hi Rob,

I tried to flash the boot img and rootfs img, but the system does not boot up.

I used bootloader dragonboard-845c-bootloader-ufs-linux-50:

here are the log:

[ 10.455453] hub 1-0:1.0: USB hub found
[ 10.459271] hub 1-0:1.0: 4 ports detected
[ 10.463549] xhci_hcd 0000:01:00.0: xHCI Host Controller
[ 10.468841] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus numb
er 2
[ 10.476308] xhci_hcd 0000:01:00.0: Host supports USB 3.0 SuperSpeed
[ 10.481077] random: fast init done
[ 10.482688] usb usb2: We don’t know the algorithms for LPM for this host, di
sabling LPM.
[ 10.494952] hub 2-0:1.0: USB hub found
[ 10.498762] hub 2-0:1.0: 4 ports detected
[ 10.503581] qcom-pcie 1c08000.pci: Adding to iommu group 11
[ 10.509459] qcom-pcie 1c08000.pci: supply vdda not found, using dummy regula
tor
[ 10.516870] qcom-pcie 1c08000.pci: supply vddpe-3v3 not found, using dummy r
egulator
[ 10.524746] qcom-pcie 1c08000.pci: host bridge /soc@0/pci@1c08000 ranges:
[ 10.531611] qcom-pcie 1c08000.pci: IO 0x0040200000…0x00402fffff -> 0x
0040200000
[ 10.539602] qcom-pcie 1c08000.pci: MEM 0x0040300000…0x005fffffff -> 0x
0040300000
[ 10.838361] usb 2-3: new SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[ 11.241158] ax88179_178a 2-3:1.0 eth0: register ‘ax88179_178a’ at usb-0000:0
1:00.0-3, ASIX AX88179 USB 3.0 Gigabit Ethernet, 00:0e:c6:81:79:01
[ 11.670822] qcom-pcie 1c08000.pci: Phy link never came up
[ 11.676924] Bluetooth: hci0: command 0xfc00 tx timeout
[ 11.677925] qcom-pcie 1c08000.pci: cannot initialize host
[ 11.687717] qcom-pcie: probe of 1c08000.pci failed with error -110
[ 11.695237] bam-dma-engine 17184000.dma: Adding to iommu group 3
[ 11.704481] msm ae00000.mdss: bound ae01000.mdp (ops dpu_ops)
[ 11.710344] msm_dsi ae94000.dsi: supply gdsc not found, using dummy regulato
r
[ 11.717848] msm ae00000.mdss: bound ae94000.dsi (ops dsi_ops)
[ 11.723900] adreno 5000000.gpu: supply vdd not found, using dummy regulator
[ 11.730953] adreno 5000000.gpu: supply vddcx not found, using dummy regulato
r
[ 11.738233] msm ae00000.mdss: [drm:msm_gpu_init] A630: using IOMMU
[ 11.745693] platform 506a000.gmu: Adding to iommu group 12
[ 11.751586] msm ae00000.mdss: bound 5000000.gpu (ops a3xx_ops)
[ 11.757546] msm_dpu ae01000.mdp: [drm:msm_ioremap] ERROR failed to get mem
ory resource: vbif_nrt
[ 11.766588] msm_dpu ae01000.mdp: [drm:msm_ioremap] ERROR failed to get mem
ory resource: regdma
[ 11.775479] [drm:dpu_kms_hw_init:886] dpu hardware revision:0x40000000
[ 11.782225] lt9611 10-003b: bridge attach
[ 11.787121] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 11.795490] [drm] Initialized msm 1.5.0 20130625 for ae00000.mdss on minor 0
[ 11.802726] msm ae00000.mdss: Direct firmware load for qcom/a630_sqe.fw fail
ed with error -2
[ 11.811242] msm ae00000.mdss: Falling back to sysfs fallback for: qcom/a630_
sqe.fw
[ 70.621679] remoteproc remoteproc2: powering up remoteproc-cdsp
[ 70.621842] remoteproc remoteproc1: powering up remoteproc-adsp
[ 70.621878] Bluetooth: hci0: QCA Failed to request file: qca/crbtfw21.tlv (-
11)
[ 70.621880] Bluetooth: hci0: QCA Failed to download patch (-11)
[ 70.627693] remoteproc remoteproc2: Direct firmware load for qcom/sdm845/cds
p.mdt failed with error -2
[ 70.633658] remoteproc remoteproc1: Direct firmware load for qcom/sdm845/ads
p.mdt failed with error -2
[ 70.641022] remoteproc remoteproc2: Falling back to sysfs fallback for: qcom
/sdm845/cdsp.mdt
[ 70.647003] remoteproc remoteproc1: Falling back to sysfs fallback for: qcom
/sdm845/adsp.mdt
[ 72.669655] msm ae00000.mdss: [drm:adreno_request_fw] ERROR failed to load
a630_sqe.fw
[ 72.671092] Bluetooth: hci0: QCA preshutdown_cmd failed (-56)
[ 72.680897] lt9611 10-003b: connected = 0
[ 72.687695] msm ae00000.mdss: [drm] Cannot find any crtc or sizes
[ 72.696534] ufshcd-qcom 1d84000.ufshc: ufshcd_populate_vreg: Unable to find
vdd-hba-supply regulator, assuming enabled
[ 72.707333] ufshcd-qcom 1d84000.ufshc: ufshcd_populate_vreg: Unable to find
vccq-supply regulator, assuming enabled
[ 72.717861] ufshcd-qcom 1d84000.ufshc: ufshcd_populate_vreg: Unable to find
vccq2-supply regulator, assuming enabled
[ 72.730824] scsi host0: ufshcd
[ 72.750096] msm-snd-sdm845 soc@0:sound: MultiMedia1: error getting cpu dai n
ame
[ 72.760591] msm-snd-sdm845 soc@0:sound: MultiMedia1: error getting cpu dai n
ame
[ 72.761015] ufshcd-qcom 1d84000.ufshc: ufshcd_print_pwr_info:[RX, TX]: gear=
[1, 1], lane[1, 1], pwr[SLOWAUTO_MODE, SLOWAUTO_MODE], rate = 0
[ 72.769647] PM: genpd: Not disabling unused power domains
[ 72.787396] input: gpio_keys as /devices/platform/gpio_keys/input/input0
[ 72.795685] msm-snd-sdm845 soc@0:sound: MultiMedia1: error getting cpu dai n
ame
[ 72.797535] cfg80211: Loading compiled-in X.509 certificates for regulatory
database
[ 72.829830] cfg80211: Loaded X.509 cert ‘sforshee: 00b28ddf47aef9cea7’
[ 72.831262] ufshcd-qcom 1d84000.ufshc: ufshcd_print_pwr_info:[RX, TX]: gear=
[3, 3], lane[2, 2], pwr[FAST MODE, FAST MODE], rate = 2
[ 72.836509] platform regulatory.0: Direct firmware load for regulatory.db fa
iled with error -2
[ 72.845076] clk: Not disabling unused clocks
[ 72.845084] ALSA device list:
[ 72.845089] No soundcards found.
[ 72.848456] ufshcd-qcom 1d84000.ufshc: ufshcd_find_max_sup_active_icc_level:
Regulator capability was not set, actvIccLevel=0
[ 72.857100] platform regulatory.0: Falling back to sysfs fallback for: regul
atory.db
[ 72.888094] scsi 0:0:0:49488: Well-known LUN SKhynix H28S7Q302BMR A0
02 PQ: 0 ANSI: 6
[ 72.899030] scsi 0:0:0:49476: Well-known LUN SKhynix H28S7Q302BMR A0
02 PQ: 0 ANSI: 6
[ 72.909491] scsi 0:0:0:49456: Well-known LUN SKhynix H28S7Q302BMR A0
02 PQ: 0 ANSI: 6
[ 72.919652] scsi 0:0:0:0: Direct-Access SKhynix H28S7Q302BMR A002 P
Q: 0 ANSI: 6
[ 72.929724] scsi 0:0:0:1: Direct-Access SKhynix H28S7Q302BMR A002 P
Q: 0 ANSI: 6
[ 72.931637] sd 0:0:0:0: [sda] 14145536 4096-byte logical blocks: (57.9 GB/54
.0 GiB)
[ 72.939866] scsi 0:0:0:2: Direct-Access SKhynix H28S7Q302BMR A002 P
Q: 0 ANSI: 6
[ 72.941425] sd 0:0:0:1: [sdb] 1024 4096-byte logical blocks: (4.19 MB/4.00 M
iB)
[ 72.941631] sd 0:0:0:1: [sdb] Write Protect is off
[ 72.941637] sd 0:0:0:1: [sdb] Mode Sense: 00 32 00 10
[ 72.942048] sd 0:0:0:1: [sdb] Write cache: enabled, read cache: enabled, sup
ports DPO and FUA
[ 72.942252] sd 0:0:0:1: [sdb] Optimal transfer size 786432 bytes
[ 72.945858] sd 0:0:0:0: [sda] Write Protect is off
[ 72.955921] scsi 0:0:0:3: Direct-Access SKhynix H28S7Q302BMR A002 P
Q: 0 ANSI: 6
[ 72.956458] sd 0:0:0:2: [sdc] 1024 4096-byte logical blocks: (4.19 MB/4.00 M
iB)
[ 72.956693] sd 0:0:0:2: [sdc] Write Protect is off
[ 72.956699] sd 0:0:0:2: [sdc] Mode Sense: 00 32 00 10
[ 72.957372] sd 0:0:0:2: [sdc] Write cache: enabled, read cache: enabled, sup
ports DPO and FUA
[ 72.957627] sd 0:0:0:2: [sdc] Optimal transfer size 786432 bytes
[ 72.959592] sdb: sdb1 sdb2
[ 72.961209] sd 0:0:0:0: [sda] Mode Sense: 00 32 00 10
[ 72.963337] sd 0:0:0:1: [sdb] Attached SCSI disk
[ 72.964749] msm-snd-sdm845 soc@0:sound: MultiMedia1: error getting cpu dai n
ame
[ 72.968375] sdc: sdc1 sdc2
[ 72.968666] scsi 0:0:0:4: Direct-Access SKhynix H28S7Q302BMR A002 P
Q: 0 ANSI: 6
[ 72.970026] sd 0:0:0:3: [sdd] 32768 4096-byte logical blocks: (134 MB/128 Mi
B)
[ 72.970352] sd 0:0:0:3: [sdd] Write Protect is off
[ 72.970355] sd 0:0:0:3: [sdd] Mode Sense: 00 32 00 10
[ 72.970751] sd 0:0:0:3: [sdd] Write cache: enabled, read cache: enabled, sup
ports DPO and FUA
[ 72.970886] sd 0:0:0:4: [sde] 1048576 4096-byte logical blocks: (4.29 GB/4.0
0 GiB)
[ 72.970945] sd 0:0:0:4: [sde] Write Protect is off
[ 72.970947] sd 0:0:0:4: [sde] Mode Sense: 00 32 00 10
[ 72.970954] scsi 0:0:0:5: Direct-Access SKhynix H28S7Q302BMR A002 P
Q: 0 ANSI: 6
[ 72.971026] sd 0:0:0:3: [sdd] Optimal transfer size 786432 bytes
[ 72.971088] sd 0:0:0:4: [sde] Write cache: enabled, read cache: enabled, sup
ports DPO and FUA
[ 72.971161] sd 0:0:0:4: [sde] Optimal transfer size 786432 bytes
[ 72.971460] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, sup
ports DPO and FUA
[ 72.973592] sd 0:0:0:5: [sdf] 393216 4096-byte logical blocks: (1.61 GB/1.50
GiB)
[ 72.973893] sd 0:0:0:5: [sdf] Write Protect is off
[ 72.973896] sd 0:0:0:5: [sdf] Mode Sense: 00 32 00 10
[ 72.974501] sd 0:0:0:5: [sdf] Write cache: enabled, read cache: enabled, sup
ports DPO and FUA
[ 72.974807] sd 0:0:0:5: [sdf] Optimal transfer size 786432 bytes
[ 72.988960] sd 0:0:0:2: [sdc] Attached SCSI disk
[ 72.999129] sd 0:0:0:0: [sda] Optimal transfer size 786432 bytes
[ 73.008223] sdf: sdf1 sdf2 sdf3 sdf4 sdf5 sdf6 sdf7 sdf8 sdf9
[ 73.008248] sdd: sdd1 sdd2 sdd3
[ 73.009496] msm-snd-sdm845 soc@0:sound: MultiMedia1: error getting cpu dai n
ame
[ 73.014919] sde: sde1 sde2 sde3 sde4 sde5 sde6 sde7 sde8 sde9 sde10 sde11 s
de12 sde13 sde14 sde15 sde16 sde17 sde18 sde19 sde20 sde21 sde22 sde23 sde24 sd
e25 sde26 sde27 sde28 sde29 sde30 sde31 sde32 sde33 sde34 sde35 sde36 sde37 sde
38 sde39 sde40 sde41 sde42 sde43 sde44 sde45 sde46 sde47 sde48
[ 73.015386] sd 0:0:0:3: [sdd] Attached SCSI disk
[ 73.016288] msm-snd-sdm845 soc@0:sound: MultiMedia1: error getting cpu dai n
ame
[ 73.019480] sda: sda1
[ 73.019546] sd 0:0:0:5: [sdf] Attached SCSI disk
[ 73.020897] msm-snd-sdm845 soc@0:sound: MultiMedia1: error getting cpu dai n
ame
[ 73.030587] sd 0:0:0:4: [sde] Attached SCSI disk
[ 73.032572] sd 0:0:0:0: [sda] Attached SCSI disk
[ 73.035426] msm-snd-sdm845 soc@0:sound: MultiMedia1: error getting cpu dai n
ame
[ 73.041136] Freeing unused kernel memory: 7296K
[ 73.048838] msm-snd-sdm845 soc@0:sound: MultiMedia1: error getting cpu dai n
ame
[ 73.297073] Run /init as init process
[ 73.300781] with arguments:
[ 73.303812] /init
[ 73.306133] with environment:
[ 73.309323] HOME=/
[ 73.311717] TERM=linux
Loading, please wait…

  • ROOT=PARTLABEL=rootfs

  • [ -z ]

  • [ PARTLABEL=rootfs = /dev/nfs ]

  • [ -z ]

  • BOOT=local

  • [ -n ]

  • [ = non[ 73.335570] systemd-udevd[363]: Starting version 245.6-2
    e ]

  • resume=

  • mount -t tmpf[ 73.348172] systemd-udevd[364]: /usr/lib/udev/rules.d/50-udev
    -default.rules:24 The line takes no effect, ignoring.
    s -o nodev,noexe[ 73.365328] systemd-udevd[364]: /usr/lib/udev/rules.d/50-ude
    v-default.rules:25 The line takes no effect, ignoring.
    c,nosuid,size=10[ 73.382343] systemd-udevd[364]: /usr/lib/udev/rules.d/50-ude
    v-default.rules:29 The line takes no effec%,mode=0755 tmpf[ 73.398743] system
    d-udevd[364]: /usr/lib/udev/rules.d/50-udev-default.rules:32 The lins /run

  • mkdir [ 73.413914] systemd-udevd[364]: /usr/lib/udev/rules.d/50-udev-defaul
    t.-m 0700 /run/ini[ 73.427868] systemd-udevd[364]: /usr/lib/udev/rules.d/tram
    fs

  • [ -n /[ 73.439995] systemd-udevd[364]: /usr/lrun/initramfs/in[ 73.450903]
    [ 73.46uditramfs.debug ]
    + exec
    [ 73.513676] remoteproc remoteproc1: request_firmware failed: -11
    [ 73.513728] cfg80211: failed to load regulatory.db
    [ 73.524769] remoteproc remoteproc2: request_firmware failed: -11
    [ 73.527111] ax88179_178a 2-3:1.0 enx000ec6817901: renamed from eth0
    [ 73.727690] lt9611 10-003b: connected = 0
    [ 73.731793] msm ae00000.mdss: [drm] Cannot find any crtc or sizes
    [ 74.019958] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts:
    (null)
    [ 74.040313] printk: systemd-udevd: 27 output lines suppressed due to ratelim
    iting

       + exec
    

[ 73.513676] remoteproc remoteproc1: request_firmware failed: -11
[ 73.513728] cfg80211: failed to load regulatory.db
[ 73.524769] remoteproc remoteproc2: request_firmware failed: -11
[ 73.527111] ax88179_178a 2-3:1.0 enx000ec6817901: renamed from eth0
[ 73.727690] lt9611 10-003b: connected = 0
[ 73.731793] msm ae00000.mdss: [drm] Cannot find any crtc or sizes
[ 74.019958] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts:
(null)
[ 74.040313] printk: systemd-udevd: 27 output lines suppressed due to ratelim
iting
run-init: /sbin/[ 74.088706] Kernel panit er[ 74.ror
098395] CPU: 3 PID: 1 Comm: run-init Not tainted 5.7.0-rc3-00001-g4aa9fc2a435[
74.118684] Hardware name: Thundercomm Dragonboard 845c (DT)
[[ 74.130677] dump_backtrace+0x0/0x198
[ 74.134387] show_stack+0x18/0x28
[ 74.137751] dump_stack+0xb8/0x104
[ 74.141206] panic+0x15c/0x324
[ 74.144305] do_exit+0x958/0x988
[ 74.147577] do_group_exit+0x0/0xa0
[ 74.151120] el0_svc_common.constprop.0+0x6c/0x168
[ 74.155971] do_el0_svc+0x24/0x90
[ 74.159332] el0_sync_handler+0x114/0x180
[ 74.163392] el0_sync+0x158/0x180
[ 74.166761] SMP: stopping secondary CPUs
[ 74.171026] Kernel Offset: 0x2a66e4000000 from 0xffff800010000000
[ 74.177186] PHYS_OFFSET: 0xfffff9eac0000000
[ 74.181428] CPU features: 0x080002,2a80a238
[ 74.185667] Memory Limit: none
[ 74.188775] —[ end Kernel panic - not syncing: Attempted to kill init! exi
tcode=0x00000100 ]—