Jump to content

About making really hardware accelleration working with videos with aegisub


SoSie

Recommended Posts

Hello all,

 

As subtitler guy, I experienced many troubles making aegisub work. ,

I finally made the subtitle editor, working with hardware under armbian jammy but having still annoyances. I want to share my thought and my discoveries on it.
First I would like to thanks all who post on this already, including alternative ways such as schroot and of course the armbian team for the improvements
of the boot .. schroot allow to run an linux in a linux. According to what I experienced, meson driver development is leaded by oibaf and in advance in ubuntu
but here aegisub does exists only on debian.

The idea was thus to boot on debian jammy and chroot in debian buster armhf at least or better bookworm arm64.
By doing so, I crashed many time aegisub 3.2.2 due to lua badly supported.  schrooting and debian bookworm gives many warning messages (see the pict below, I washed the lua script directory too) but
goes further if we dare to skip assert warnings.  Moreover, at this point, we are no more dealing with Llvm (software accel using 100% of CPUs) but meson-drm and panfrost (harware accel, using 20% of CPUs).
aegisub still remains very fragile but very responsive. So today I decided to switch and to boot into bookworm directly.

After launching aegisub 3.20.3 on arm64 with panfrost enabled (you can check this with glxinfo -B, or inxi -Gs), I discovered it is very stable but suffered of responsivity due to a flood in the logs Hewitt has just given... a patch yesterday against  "panfrost ffe40000.gpu: l2 power transition timeout" log flood here: https://lkml.org/lkml/2024/3/22/977
You will also  be unable to set brightness by software (too bright for my eyes) at least on xfce4, trying my luck with all
techniques https://askubuntu.com/questions/894465/changing-the-screen-brightness-of-the-external-screen
that did not succeed except that ddcci-dkms gave me a clue during install : BACKLIGHT_CLASS_DEVICE disabled in this kernel


I suggest enabling dkms and this for future kernel and taking Hewitt patch into account.

With these findings, did someone has noticed the same and manage to make sound and videos responsive without unsync?


PS/ For now, the armbian is on a sdcard, the log flood may be the cause of the unsync. I have to test further. Trying with latest jammy and schrooting under bookworm.

aegisub-schrooted.png

Edited by SoSie
fix
Link to comment
Share on other sites

I tried with recommanded lxc (linux container is more secure)  but opengl Mai is not recognized

 

 

----> so instead of

 

sudo mkdir -p /srv/chroot/armbian
sudo debootstrap --arch arm64 --foreign bookworm /srv/chroot/debian-arm64 http://debian.xtdv.net/debian

sudo schroot -c debian-arm64

(step to create user pi skipped)

apt install aegisub inxi

 

We notice EVERYTHING IS RECOGNIZED:

(debian-arm64)root@bananapim5:/home/pi# inxi -Gs
Graphics:
  Device-1: meson-g12a-vpu driver: meson_drm v: N/A
  Device-2: meson-g12a-mali driver: panfrost v: kernel
  Device-3: meson-g12a-dw-hdmi driver: meson_dw_hdmi v: N/A
  Display: server: X.Org v: 1.21.1.4 driver: dri: meson
    gpu: meson_drm,panfrost,meson_dw_hdmi note: X driver n/a
    resolution: 1920x1080~60Hz
  API: OpenGL v: 3.1 Mesa 22.3.6 renderer: Mali-G31 (Panfrost)
Sensors:
  System Temperatures: cpu: 44.3 C mobo: N/A
  Fan Speeds (RPM): N/A

 

 

++++++> I have done

sudo lxc-create --name "arm64-bookworm" --template download -- --dist debian --release bookworm --arch arm64

sudo lxc-start  -n "arm64-bookworm"

sudo lxc-attach -n "arm64-bookworm"

apt install aegisub inxi

 

We notice GL is not FULLY DETECTED
root@arm64-bookworm:/home/pi# inxi -Gs
Graphics:
  Device-1: meson-g12a-vpu driver: meson_drm v: N/A
  Device-2: meson-g12a-mali driver: panfrost v: kernel
  Device-3: meson-g12a-dw-hdmi driver: meson_dw_hdmi v: N/A
  Display: server: X.org v: 1.21.1.7 driver: X: loaded: fbdev,modesetting
    gpu: mroot@arm64-bookworm:/home/pi# inxi -Gs
Graphics:
  Device-1: meson-g12a-vpu driver: meson_drm v: N/A
  Device-2: meson-g12a-mali driver: panfrost v: kernel
  Device-3: meson-g12a-dw-hdmi driver: meson_dw_hdmi v: N/A
  Display: server: X.org v: 1.21.1.7 driver: X: loaded: fbdev,modesetting
    gpu: meson_drm,panfrost,meson_dw_hdmi resolution: 1920x1080
  API: OpenGL Message: GL data unavailable for root.
eson_drm,panfrost,meson_dw_hdmi resolution: 1920x1080
  API: OpenGL Message: GL data unavailable for root.

 

root@arm64-bookworm:/home/pi# lshw -c video
  *-graphics                
       product: mesondrmfb
       physical id: 5
       logical name: /dev/fb0
       capabilities: fb
       configuration: depth=32 resolution=720,480

 

root@arm64-bookworm:/home/pi#  xrandr --listproviders
Can't open display :0

 

The reason is OpenGL rely on Xorg and Xorg can't find my display event after doing export DISPLAY=:0
the device :dev/fb0 does not exist also.as we can seet it withe the Xorg log:
 

root@arm64-bookworm:/home/pi# cat /var/log/Xorg.0.log
[ 25980.096]
X.Org X Server 1.21.1.7
X Protocol Version 11, Revision 0
[ 25980.096] Current Operating System: Linux arm64-bookworm 6.2.0-rc3-meson64 #23.02.2 SMP PREEMPT Fri Feb 17 23:06:22 UTC 2023 aarch64
[ 25980.096] Kernel command line: root=UUID=4cc9d1be-c592-4e80-8f1c-e73b8c044930 rootwait rootfstype=ext4 splash plymouth.ignore-serial-consoles console=ttyAML0,115200 console=tty1 consoleblank=0 coherent_pool=2M loglevel=1 ubootpart=7ac72bfa-01 libata.force=noncq usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u,0x1058:0x1001:u  video=drm_kms_helper.edid_firmware=HDMI-A-1:edid/720x480.bin video=HDMI-A-1:720x480M@60 fbcon=rotate:0 module_blacklist=simpledrm  cgroup_enable=memory swapaccount=1
[ 25980.096] xorg-server 2:21.1.7-3+deb12u5 (https://www.debian.org/support)
[ 25980.096] Current version of pixman: 0.42.2
[ 25980.097]     Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
[ 25980.097] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[ 25980.097] (==) Log file: "/var/log/Xorg.0.log", Time: Sun Mar 17 20:03:34 2024
[ 25980.098] (==) Using config directory: "/etc/X11/xorg.conf.d"
[ 25980.098] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[ 25980.100] (==) ServerLayout "dummy_layout"
[ 25980.100] (**) |-->Screen "dummy_screen" (0)
[ 25980.100] (**) |   |-->Monitor "dummy_monitor"
[ 25980.101] (**) |   |-->Device "dummy_videocard"
[ 25980.101] (**) |-->Input Device "dummy_mouse"
[ 25980.101] (**) |-->Input Device "dummy_keyboard"
[ 25980.101] (==) Automatically adding devices
[ 25980.101] (==) Automatically enabling devices
[ 25980.101] (==) Automatically adding GPU devices
[ 25980.101] (==) Automatically binding GPU devices
[ 25980.101] (==) Max clients allowed: 256, resource mask: 0x1fffff
[ 25980.101] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[ 25980.101]     Entry deleted from font path.
[ 25980.101] (==) FontPath set to:
    /usr/share/fonts/X11/misc,
    /usr/share/fonts/X11/100dpi/:unscaled,
    /usr/share/fonts/X11/75dpi/:unscaled,
    /usr/share/fonts/X11/Type1,
    /usr/share/fonts/X11/100dpi,
    /usr/share/fonts/X11/75dpi,
    built-ins
[ 25980.101] (==) ModulePath set to "/usr/lib/xorg/modules"
[ 25980.101] (II) Loader magic: 0xaaaac1da0f00
[ 25980.101] (II) Module ABI versions:
[ 25980.101]     X.Org ANSI C Emulation: 0.4
[ 25980.101]     X.Org Video Driver: 25.2
[ 25980.101]     X.Org XInput driver : 24.4
[ 25980.101]     X.Org Server Extension : 10.0
[ 25980.105] (EE) systemd-logind: failed to get session: PID 991 does not belong to any known session
[ 25980.109] (II) xfree86: Adding drm device (/dev/dri/card0)
[ 25980.109] (II) Platform probe for /sys/devices/platform/soc/ff900000.vpu/drm/card0
[ 25980.111] (II) xfree86: Adding drm device (/dev/dri/card1)
[ 25980.111] (II) Platform probe for /sys/devices/platform/soc/ffe40000.gpu/drm/card1
[ 25980.111] (II) no primary bus or device found
[ 25980.111] (II) LoadModule: "glx"
[ 25980.112] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[ 25980.115] (II) Module glx: vendor="X.Org Foundation"
[ 25980.116]     compiled for 1.21.1.7, module version = 1.0.0
[ 25980.116]     ABI class: X.Org Server Extension, version 10.0
[ 25980.116] (==) Matched modesetting as autoconfigured driver 0
[ 25980.116] (==) Matched fbdev as autoconfigured driver 1
[ 25980.116] (==) Assigned the driver to the xf86ConfigLayout
[ 25980.116] (II) LoadModule: "modesetting"
[ 25980.116] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[ 25980.117] (II) Module modesetting: vendor="X.Org Foundation"
[ 25980.117]     compiled for 1.21.1.7, module version = 1.21.1
[ 25980.117]     Module class: X.Org Video Driver
[ 25980.117]     ABI class: X.Org Video Driver, version 25.2
[ 25980.117] (II) LoadModule: "fbdev"
[ 25980.117] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so
[ 25980.117] (II) Module fbdev: vendor="X.Org Foundation"
[ 25980.118]     compiled for 1.21.1.3, module version = 0.5.0
[ 25980.118]     Module class: X.Org Video Driver
[ 25980.118]     ABI class: X.Org Video Driver, version 25.2
[ 25980.118] (II) LoadModule: "void"
[ 25980.118] (WW) Warning, couldn't open module void
[ 25980.118] (EE) Failed to load module "void" (module does not exist, 0)
[ 25980.118] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[ 25980.118] (II) FBDEV: driver for framebuffer: fbdev
[ 25980.119] (WW) Falling back to old probe method for modesetting
[ 25980.119] (EE) open /dev/dri/card0: No such file or directory
[ 25980.119] (WW) Falling back to old probe method for fbdev
[ 25980.119] (II) Loading sub module "fbdevhw"
[ 25980.119] (II) LoadModule: "fbdevhw"
[ 25980.119] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[ 25980.119] (II) Module fbdevhw: vendor="X.Org Foundation"
[ 25980.119]     compiled for 1.21.1.7, module version = 0.0.2
[ 25980.119]     ABI class: X.Org Video Driver, version 25.2
[ 25980.120] (EE) open /dev/fb0: No such file or directory
[ 25980.120] (WW) Falling back to old probe method for modesetting
[ 25980.120] (EE) open /dev/dri/card0: No such file or directory
[ 25980.120] (WW) Falling back to old probe method for fbdev
[ 25980.120] (II) Loading sub module "fbdevhw"
[ 25980.120] (II) LoadModule: "fbdevhw"
[ 25980.120] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[ 25980.120] (II) Module fbdevhw: vendor="X.Org Foundation"
[ 25980.120]     compiled for 1.21.1.7, module version = 0.0.2
[ 25980.120]     ABI class: X.Org Video Driver, version 25.2
[ 25980.120] (EE) open /dev/fb0: No such file or directory
[ 25980.120] (EE) No devices detected.
[ 25980.120] (EE)
Fatal server error:
[ 25980.120] (EE) no screens found(EE)
[ 25980.120] (EE)
Please consult the The X.Org Foundation support
     at http://wiki.x.org
 for help.
[ 25980.121] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[ 25980.121] (EE)
[ 25980.121] (EE) Server terminated with error (1). Closing log file.

 

Thus starting aegisub in linux container is impossible.
 

root@arm64-bookworm:/home/pi# su - pi
pi@arm64-bookworm:~$ aegisub-3.2
12:56:43: Error: Unable to initialize GTK+, is DISPLAY set properly?

 

So now the question is
DOES SOMEONE KNOW HOW TO MAKE LINUX CONTAINER WORK GRAPHICALLY UNDER Ubuntu JAMMY?

Link to comment
Share on other sites

Posted (edited)

I will answer my question very soon, but let me first introduce the candidate that bring us a lot of attention here: aegisub.
Most of us think its dev has ended in 2018 and we are stuck to 3.2.2 since. It is not the case there are 2 candidates on the row. I made a big picture and bring the evaluation. I used latest armbian 24.2.1 bookworm arm64 on a sdcard for the test. At the begining it was armbian buster version. I override files and updrade package since.


I ensured also to have hardware GL accel with the output on inxi -Gs, we have our Mali friend aboard. Nice! Let's start each aegisub to have the "Big Picture":

 

aegissub-sttate.thumb.png.13d4ca299db8210d5e1500cfbf270000.png

 

I ordered from left to right the versions. What I discovered is the copyright date statement back to the past of aegisub 3.2.2
What happen to us when we try yo launch and chose a subtitle/ video file?
-aegisub 2.30.2 , open with no popup, we can select a video and play it, sound is ok but we can not move in the video using the sound slider. When we play the video the sound slider does not move..Bad luck!

-aegisub 3.2.2 : after cleaning lua scripts /usr/share/aegisub/automation due to unicode incompatibility used in karaskel that make crash aegisub on launch, we enjoy "Wx assert" popups that we can close by unchecking Show this dialog next time and click on Continue button

assert1.thumb.png.d6e35edec68796d0e5214adbd59f9409.png

 

assert2.thumb.png.6b99273cd2790c6878e6ced209283968.png

 

When we open a video then it crash. Oh noo!!!
Normally play ends here but many said snap is robust. So I look at it on snapcraft.io and there was a...

-aegisub 3.3.3 is provided by procles  which is a snap of wanqr latest release. A
sudo apt install snapd

and then snap install aegisub-procless.

 

makes installation succeed, It installs the ubunto core 22 based ecosystem.

Unfortunately, when we trigger it, it did not start. After digging a while , it is due to lua bug in 64 bits arch. I switched to 32bit bit removing snapd:arm64 and installing snap:armhf to force 32bit  It went further but I remember we loosed the hardware accel this time . so snapd that could have saved us is not usable.


For now, the only fully working aegisub with wx assert annoyances is using debootstrap with schroot in bookworm from jammy. I tried with latest bookworm , it works too.

 

schrooted-aegisub3.2.2-arm64.thumb.png.9b4d9a6ee9ae90ae69209d350552d95d.png

Edited by SoSie
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines