Arch Linux Image for VisionFive 2

Should we upstream these pkg builds together in a group=(starfive) ?

@cwt can you add a provides=() line for all .ko files, so I can add them as dependency on the user space libs. It’s not fixed to a specific kernel, but any package that provides venc.ko and co.

1 Like

I think in the future there will be visionfive 3 and 4 like Raspberry Pi. So how about group=(starfive-vf2) or something like that?

We may need to standardize the name of our packages. I always feel the name of my kernel packages are too long, and the name of other packages like mesa, img-gpu didn’t get along too.

2 Likes

I hope that, by then, VisionFive2 won’t need a special kernel nor special mesa3d.

For the latter, we depend on that Imatech open source driver actually supporting our GPUs.

2 Likes

The initial development board probably exists already. And at a guess a very high percentage of the current source code for the JH7110 SoC can be reused on the new chip. Once StarFive state that the solution to problems in the current silicon (JH7110) will be the StarFive next generation SoC (The errata sheet calls it the “JH-8100”), you know it is on the way. Probably 6 months to a year away from holding one in your hands (for most people), unless you are adding value. e.g. By developing software that is beneficial to RISC-V or working on a popular Linux distribution.

For now I would not expect any official announcements from StarFive to avoid the Osborne effect.

1 Like

The only way that I’ve been able to successfully update the u-boot and firmware on my VF2 previously was by using arch. The commands for doing this used to be included in the top post of this thread but you seem to have got rid of those instructions. Why? Is it no longer possible to update the VF2 u-boot or firmware from Arch? flashcp is still included.

If using flashcp from Arch still works, what are the commands we’d run to update all the things under Arch? There are new versions of the starfive Debian image since I last tried updating the firmware using sf Debian so maybe it’ll work for me now following the quickstart instructions.

Last time I had to do this I had to use a different mtd device to flash the firmware to than the one given in the Updating SPL and U-Boot section of the quickstart guide.

The method I documented here:

Has yet to fail me.

Since the image was constructed using a script with minimal (or zero) manual intervention, and prior to cwt16, the SPL and U-Boot were written to partitions 1 and 2 of the SD image. Therefore, if you boot the board in SD mode, it should load the correct firmware from those partitions. Hence, there is no longer a need to flash the firmware to the board.

However, with the latest firmware 3.6.1 (possibly 3.4.5 as well?), there has been a change that writes the SPL and U-Boot directly to the SD image, resulting in an unbootable image in SD mode. I had to extract partitions 1 and 2 from the official Debian-202308 and then use them in my SD image to enable booting in SD mode. By the way, this poses another issue.

The point I want to emphasize is that if you can boot the board from the Arch SD, then you can follow the official firmware flashing instructions, which I believe would be redundant if included here. I apologize if this causes any confusion, and perhaps I should consider adding a link to the official document with some explanation.

3 Likes

Thanks for explaining where we’re up to cwt. I go away for a few months and everything has changed again but this is only to be expected with such new hardware.

I nearly always boot off NVMe. The only time I can see myself wanting to boot off SD would be in a recovery scenario. It seems I’ve got little to gain in upgrading my u-boot and SPL so I’ll just update my firmware using the quickstart guide command.

1 Like

@leuc @stronnag et. al. I just rebuilt the mesa-pvr-vf2 against llvm15-libs instead of llvm-libs, so now you should be able to upgrade the whole system with pacman -Syu.

$ ldd /usr/lib/dri/pvr_dri.so |grep LLVM
        libLLVM-15.so => /usr/lib/libLLVM-15.so (0x0000003f91663000)
3 Likes

I successfully updated to the latest firmware under arch using the same command and device used in the SF QSG ie

flashcp -v visionfive2_fw_payload.img /dev/mtd1

I’ve had a quick go with the SF 202308 Debian image. I was happy to see that they included all four of the packages that I had requested they add to the minimum image. Thanks StarFive!

mpv seemed to be working better than under 202306 and it does a great job of playing 60 fps 4K hevc video files on a 1080p display. I was able to get some YT videos to play when I was using my 4k display but mpv cannot output video at 4k yet. Does mpv under Arch fare any better with 4k displays?

I am going away for the weekend so I won’t get to try arch again until early next week.

1 Like

I would expect mpv on arch is worse because we haven’t made packages for the gstreamer and ffmpeg using the vdec yet (as far as I know).

https://github.com/leuc/vf2-soft_3rdpart-aur/releases
https://github.com/leuc/ffmpeg-omx-aur/releases
https://github.com/leuc/gst-omx-starfive-aur/releases

i might look into packaging vlc, mpv and kodi build against the ffmpeg with omx patches, if nobody else does.

3 Likes

Oh sweet, nice job. I’ve been out of touch for a while. I started some similar PKGBUILDs months ago but didn’t have time to finish the project. Glad someone else stepped up :slight_smile:

pacman -S xf86-video-fbdev

The debian image is using mode setting for x11, not fbdev. Config is in /usr/local/etc

New release for mesa-pvr-vf2 Release v22.1.3-3 · cwt/aur-mesa-pvr-vf2 · GitHub.

As @sajattack tested and found a lot of segfaults from LLVM-15, the LLVM JIT was disabled in this release.

2 Likes

Runs kde plasma-wayland now :smiley:

5 Likes

wave5 decoding via gstreamer v4l2h264dec somewhat works, but not fully stable. Got a kernel oops after 11% into the file.

gst-play can’t select a specific hardware decoder, so it needs a pipeline.

gst-launch-1.0 -e filesrc location=1080p.x264.mkv ! matroskademux ! h264parse ! v4l2h264dec capture-io-mode=2 ! kmssink driver-name=starfive
Unable to handle kernel paging request at virtual address fffffffffffffd6c
Oops [#1]
Modules linked in: nfsv3 nfs_acl rpcsec_gss_krb5 auth_rpcgss nfsv4 dns_resolver nfs fscache lockd grace sunrpc mousedev wave5 v4l2_mem2mem goodix imx708 cfg80211 rfkill sch_fq_codel fuse dm_mod zram zsmalloc bpf_preload ip_tables x_tables
CPU: 1 PID: 5147 Comm: matroskademux0: Not tainted 5.15.2-cwt-3.6.1-1 #1 88b3c5b07c93cb445813c4c8c63e06c3da5574d4
Hardware name: StarFive VisionFive V2 (DT)
epc : wave5_handle_bitstream_buffer+0x64/0x2fc [wave5]
 ra : wave5_handle_bitstream_buffer+0xf6/0x2fc [wave5]
epc : ffffffff01c58ffc ra : ffffffff01c5908e sp : ffffffd00494bad0
 gp : ffffffff819d9c98 tp : ffffffe14e8b24c0 t0 : ffffffe0fb00d060
 t1 : ffffffff80c02b82 t2 : 0000000000000000 s0 : 000000000001ae73
 s1 : 0000000000000100 a0 : ffffffe107dd7cf0 a1 : 0000000000000001
 a2 : 46a1033837412a00 a3 : 0000000000000000 a4 : ffffffe1074b53a8
 a5 : ffffffff80917204 a6 : 0000000000000001 a7 : 0000000000000001
 s2 : ffffffe1077d1c68 s3 : ffffffe1077d0000 s4 : ffffffd02ab0c000
 s5 : ffffffff819df0b8 s6 : 000000000001ae73 s7 : 0000000000000001
 s8 : 0000000000000100 s9 : ffffffe1077d0010 s10: ffffffe0c6797828
 s11: ffffffffffffffed t3 : 0000000000000000 t4 : 0000000100005a3a
 t5 : 0000000000000040 t6 : 0000000000040000
status: 0000000200000120 badaddr: fffffffffffffd6c cause: 000000000000000d
[<ffffffff01c58ffc>] wave5_handle_bitstream_buffer+0x64/0x2fc [wave5]
[<ffffffff01c5a2a6>] wave5_vpu_dec_buf_queue+0x74/0x384 [wave5]
[<ffffffff809115b4>] vb2_core_qbuf+0x13a/0x3da
[<ffffffff809145a4>] vb2_qbuf+0x74/0xaa
[<ffffffff01c45ec0>] v4l2_m2m_qbuf+0x58/0x11a [v4l2_mem2mem]
[<ffffffff808e8458>] __video_do_ioctl+0x240/0x316
[<ffffffff801a77e4>] kvmalloc_node+0x5e/0xae
[<ffffffff8021e26e>] __check_object_size+0x140/0x352
[<ffffffff808e8214>] video_ioctl2+0xc/0x10
[<ffffffff808e801c>] video_usercopy+0x2c8/0x3d8
[<ffffffff808e76e2>] v4l2_ioctl+0x2e/0x42
[<ffffffff802359d4>] sys_ioctl+0x85a/0x96e
[<ffffffff800465ca>] irqtime_account_irq+0x44/0x10a
[<ffffffff80235176>] vfs_fileattr_set+0x20a/0x20e
[<ffffffff80003a56>] check_syscall_nr+0x1e/0x22
---[ end trace 8be00a8ef299139c ]---

How do I install this? The github doesn’t mention anything, and sudo mv * /usr destroyed my system.

https://wiki.archlinux.org/title/Pacman#Additional_commands

Install a ‘local’ package that is not from a remote repository

pacman -U */path/to/package/package_name-version.pkg.tar.zst

1 Like