Hosting Jitsi on ppc64le

I recently tried self-hosting Jitsi on Debian on the Talos II.

I had to apply some small workarounds for ppc64le, so I thought I’d post them here.

The cause of the first issue, no audio or video in a call, was reported in the Jitsi Videobridge log, /var/log/jitsi/jvb.log:

[...]
Exception in thread "Smack-Single Threaded Executor 0 (0)" java.lang.UnsatisfiedLinkError: /tmp/nativeutils5300293642203108/libjnisctp.so: /tmp/nativeutils5300293642203108/libjnisctp.so: cannot open shared object file: No such file or directory (Possible cause: can't load AMD 64-bit .so on a Power PC 64 LE-bit platform)
[...]

To fix this, you have to build libjnisctp.so for ppc64le and substitute it for the x86-64 version of the library. Unless this is fixed upstream, you’ll have to re-do the steps starting from wrapper=[...] if you upgrade the jitsi-videobridge2 package.

git clone https://github.com/sctplab/usrsctp.git
git clone https://github.com/jitsi/jitsi-sctp
cd jitsi-sctp/
cp -R ../usrsctp usrsctp/
mvn package -DbuildSctp -DbuildNativeWrapper -DskipTests
wrapper="$(dpkg -L jitsi-videobridge2|grep jniwrapper-native)"
sudo cp "${wrapper}" "${wrapper}.bak"
cp "${wrapper}" ./tohack.jar
mkdir hacks
cd hacks
jar xf ../tohack.jar
cp ../jniwrapper/native/target/libjnisctp-linux-ppc64le.so \
	lib/linux/libjnisctp.so
jar cf hacked.jar *
sudo cp hacked.jar "${wrapper}"

I also had to help along the installation of luajwtjitsi, a dependency of Prosody, which at first errored out with:

sudo luarocks install luaossl
Installing https://luarocks.org/luaossl-20200709-0.src.rock

Error: Could not find library file for CRYPTO
  No file libcrypto.a in /usr/lib
  No file libcrypto.a in /usr/lib/x86_64-linux-gnu
  No file libcrypto.so in /usr/lib
  No file libcrypto.so in /usr/lib/x86_64-linux-gnu
  No file matching libcrypto.so.* in /usr/lib
  No file matching libcrypto.so.* in /usr/lib/x86_64-linux-gnu
You may have to install CRYPTO in your system and/or pass CRYPTO_DIR or CRYPTO_LIBDIR to the luarocks command.
Example: luarocks install luaossl CRYPTO_DIR=/usr/local

luarocks needs a hint as to the ppc64le library locations for luaossl, a dependency of luajwtjitsi.

sudo luarocks install luaossl \
	CRYPTO_LIBDIR=/usr/lib/powerpc64le-linux-gnu \
	OPENSSL_LIBDIR=/usr/lib/powerpc64le-linux-gnu
sudo luarocks install luajwtjitsi

I’m impressed with Jitsi; its self-hosting documentation is straightforward, and once it is installed, the video bridge works smoothly. I didn’t do detailed comparisons, but video call quality seems as good as any of the centrally-run services I’ve used.

Lisp on Talos II

I’ve been following the status of Lisp on ppc64le lately.

I’m running ppc64le Debian sid. Just after I had set up my system, I did some experimentation with what Debian packages had to offer. ECL was the only Lisp that worked, so I started using it for various projects. (I’ve since learned on #sbcl that CLISP built from source is also a good option.)

Ideally I wanted to be able to use SBCL, so I wondered how far into an SBCL bootstrap I could get with ECL as the host compiler. A few months ago, I found the answer was not very far.

Since then though, the SBCL maintainers have been hard at work on two fronts: making SBCL bootstrap against ECL again (on any architecture) and porting SBCL to PPC64.

Recently with a few minor local changes, I was able to bootstrap SBCL natively on my Talos II starting with ECL, then build SBCL again with the bootstrapped SBCL. I had to build ECL from the tip of its development branch, but it has a nice build system and, being based on C, doesn’t require any bootstrapping steps.

So the SBCL ppc64 port is really shaping up; hopefully the next release will advertise ppc64le support. For now, plenty of packages work for me already, like SILME and Quicklisp.

I’d also like to try the same bootstrap procedure on ppc64be ABI version 1 (Debian sid) and ppc64be ABI version 2 (another distro, probably Adélie). I’m working on setting up an environment with qemu-system-ppc64.

Anyway, I’m happy that I can now use SBCL on my Talos II.