Roon bridge in docker container using balena

I am trying to run the roon bridge installer in a container using balena…however when running either the roonbridge-installer-armv7hf.sh or -armv8.sh installer scripts it fails complaining that the arch is not armv7hf / armv8.

When I run uname -m it reports aarch64, so I guess it should work looking at the script. But perhaps there is something I am missing?

I can override the check by just changing line 14 to read MACHINE_ARCH=aarch64 and then it builds successfully, but would prefer to use the native script ideally.

Not sure why you’re using Docker for Bridge, but anyway, it would be useful if you shared some information about the host machine, i.e. Pi version, OS etc.

uname -m confirms that the kernel architecture is 64-bit. If you’re using Rasbian it’s 32-bit even though the architecture is 64-bit. I suspect Roon Bridge is compiled for 32-bit too, but you’ve compiled a 64-bit kernel.

What is the output from the following:

cat /proc/cpuinfo
uname -m
uname -p
uname -i

I am not using raspbian as the core OS - I am using balenaOS which is yocto based. And the container image is 64bit debian buster. The docker builders on balena are running natively on arm aarch64 hardware.

Reason for running it in a container is to run it as a plugin for balenaSound

Running those commands on the builder gives me the following for cpuinfo (there are 64 identical armv8 cores on this builder, I have just copied the first two here):

[roon]              Step 5/14 : RUN cat /proc/cpuinfo
[roon]               ---> Running in fc473de97f22
[roon]              processor	: 0
[roon]              model name	: ARMv8 Processor rev 2 (v8l)
[roon]              BogoMIPS	: 100.00
[roon]              Features	: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt lpae evtstrm aes pmull sha1 sha2 crc32
[roon]              CPU implementer	: 0x41
[roon]              CPU architecture: 8
[roon]              CPU variant	: 0x0
[roon]              CPU part	: 0xd08
[roon]              CPU revision	: 2
[roon]              processor	: 1
[roon]              model name	: ARMv8 Processor rev 2 (v8l)
[roon]              BogoMIPS	: 100.00
[roon]              Features	: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt lpae evtstrm aes pmull sha1 sha2 crc32
[roon]              CPU implementer	: 0x41
[roon]              CPU architecture: 8
[roon]              CPU variant	: 0x0
[roon]              CPU part	: 0xd08
[roon]              CPU revision	: 2

For the uname commands it gives me:

[roon]              Step 6/14 : RUN uname -m
[roon]               ---> Running in bffe2be076b7
[roon]              armv6l
[roon]              Removing intermediate container bffe2be076b7
[roon]               ---> 7d3be227c23d
[roon]              Step 7/14 : RUN uname -p
[roon]               ---> Running in d914fd75b39b
[roon]              unknown
[roon]              Removing intermediate container d914fd75b39b
[roon]               ---> a37bcbd9e3af
[roon]              Step 8/14 : RUN uname -i
[roon]               ---> Running in 9a9a89c419c6
[roon]              unknown
[roon]              Removing intermediate container 9a9a89c419c6
[roon]               ---> 7b1b0f24df47

I am not clear why uname -m is outputting armv6l when it is clearly an armv8l processor…?!?

Actually, when I run it on the emulated (QEMU) builder I get:

[roon]              Step 6/14 : RUN uname -m
[roon]               ---> Running in b63b28224847
[roon]              aarch64
[roon]              Removing intermediate container b63b28224847
[roon]               ---> 20f7fb191685
[roon]              Step 7/14 : RUN uname -p
[roon]               ---> Running in 0c1c8e40e027
[roon]              unknown
[roon]              Removing intermediate container 0c1c8e40e027
[roon]               ---> e428c8409cd0
[roon]              Step 8/14 : RUN uname -i
[roon]               ---> Running in b082ecb0f674
[roon]              unknown
[roon]              Removing intermediate container b082ecb0f674
[roon]               ---> c76304dbf052

And for cpuinfo:

[roon]              processor    : 0
[roon]              vendor_id    : GenuineIntel
[roon]              cpu family    : 6
[roon]              model        : 85
[roon]              model name    : Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz
[roon]              stepping    : 4
[roon]              microcode    : 0x2006906
[roon]              cpu MHz        : 3399.973
[roon]              cache size    : 25344 KB
[roon]              physical id    : 0
[roon]              siblings    : 8
[roon]              core id        : 0
[roon]              cpu cores    : 4
[roon]              apicid        : 0
[roon]              initial apicid    : 0
[roon]              fpu        : yes
[roon]              fpu_exception    : yes
[roon]              cpuid level    : 13
[roon]              wp        : yes
[roon]              flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves ida arat pku ospke
[roon]              bugs        : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit
[roon]              bogomips    : 6000.00
[roon]              clflush size    : 64
[roon]              cache_alignment    : 64
[roon]              address sizes    : 46 bits physical, 48 bits virtual
[roon]              power management:

So I presume the arm native builder is doing something funny to trick the system into thinking it is armv6l instead of aarch64 (presumably to allow it to build armv6 stuff natively)

uname -m confirms that you are running a 64-bit ARM kernel. As mentioned earlier, common Raspberry Pi OS used with Roon typically runs a 32-bit kernel on 64-bit architecture; armv8 still runs 32-bit. With this in mind it may be that Bridge is a 32-bit application. Thus the output from the script. Maybe @support can advise if this is the case? However, this is a non-standard configutation so you may want to move this thread to #tinkering.

As far as I am aware, the raspberry pi now officially supports a 64bit kernel using the kernel8.img

In any case, this isn’t the reason why it is failing as the install script includes a check for 64bit kernels from line 91 to 108:

    #
    # Check for proper architecture
    #
    case "$MACHINE_ARCH" in
        armv7*)
            if [ x$ARCH = xarmv7hf ]; then OK=1; fi
            ;;
        aarch64*)
            if [ x$ARCH = xarmv8 ]; then OK=1; fi
            if [ x$ARCH = xarmv7hf ]; then OK=1; fi
            ;;
        x86_64*)
            if [ x$ARCH = xx64 ]; then OK=1; fi 
            ;;
        i686*)
            if [ x$ARCH = xx86 ]; then OK=1; fi 
            ;;
    esac

And it runs fine if I override the check or run the build on the QEMU builder.

I think it is probably an issue in the balena builder that needs addressing rather than anything on the roon side. For now I have a workaround - just running this install script when the container loads rather than during the build process.

Thanks for your help @Martin_Webster and happy new year!