totopr
Posts: 4
Joined: Sun Aug 18, 2019 8:34 pm

bcm_host_init hangs

Sun Aug 18, 2019 8:52 pm

Hello,

after latest system update (yesterday), I'm not able to run Kodi, it just hangs. From Kodi log:

Code: Select all

...
2019-08-18 18:43:23.139 T:1873801536    INFO: CAESinkALSA - Unable to open device "default" for playback
2019-08-18 18:43:23.175 T:1863315776    INFO: CActiveAESink::OpenSink - initialize sink
2019-08-18 18:43:23.175 T:1863315776   DEBUG: CActiveAESink::OpenSink - trying to open device PI:HDMI
2019-08-18 18:43:23.175 T:1863315776   DEBUG: DllBcm: Using omx system library
2019-08-18 18:43:28.175 T:1873801536   ERROR: ActiveAE::InitSink - failed to init
...
2019-08-18 18:43:30.676 T:1873801536   ERROR: ActiveAE::FlushEngine - failed to flush
2019-08-18 18:43:35.677 T:1873801536   ERROR: ActiveAE::InitSink - failed to init
2019-08-18 18:43:38.178 T:1873801536   ERROR: ActiveAE::FlushEngine - failed to flush
After some research I've found that the ActiveAE is linked to video/audio HDMI adapter, that for some reason, seems not available.
Then I moved to CEC utilities to verify HDMI connection: I've used this simple code to debug CEC:
https://github.com/DrGeoff/cec_simplest ... mplest.cpp
logs show the program blocks to bcm_host_init calling.
strace on it gives:

Code: Select all

openat(AT_FDCWD, "/dev/vchiq", O_RDWR|O_LARGEFILE) = 3
ioctl(3, _IOC(_IOC_READ|_IOC_WRITE, 0xc4, 0xa, 0x8), 0x7e93c814) = 0
ioctl(3, _IOC(_IOC_NONE, 0xc4, 0x10, 0), 0x8) = 0
ioctl(3, _IOC(_IOC_NONE, 0xc4, 0, 0), 0) = 0
mmap2(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x760a2000
mprotect(0x760a3000, 8388608, PROT_READ|PROT_WRITE) = 0
clone(child_stack=0x768a1f78, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[488], tls=0x768a2900, child_tidptr=0x768a24a8) = 488
ioctl(3, _IOC(_IOC_READ|_IOC_WRITE, 0xc4, 0x2, 0x1c), 0x7e93c794) = 0
ioctl(3, _IOC(_IOC_NONE, 0xc4, 0xd, 0), 0x12006) = 0
ioctl(3, _IOC(_IOC_READ|_IOC_WRITE, 0xc4, 0x2, 0x1c), 0x7e93c734) = 0
ioctl(3, _IOC(_IOC_READ|_IOC_WRITE, 0xc4, 0x2, 0x1c), 0x7e93c734) = 0
mmap2(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x756ff000
mprotect(0x75700000, 8388608, PROT_READ|PROT_WRITE) = 0
clone(child_stack=0x75efef78, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[489], tls=0x75eff900, child_tidptr=0x75eff4a8) = 489
ioctl(3, _IOC(_IOC_NONE, 0xc4, 0xd, 0), 0x13007) = 0
ioctl(3, _IOC(_IOC_NONE, 0xc4, 0xd, 0), 0x14008) = 0
ioctl(3, _IOC(_IOC_READ|_IOC_WRITE, 0xc4, 0x2, 0x1c), 0x7e93c754) = 0
ioctl(3, _IOC(_IOC_READ|_IOC_WRITE, 0xc4, 0x2, 0x1c), 0x7e93c754) = 0
ioctl(3, _IOC(_IOC_NONE, 0xc4, 0xd, 0), 0x15009) = 0
ioctl(3, _IOC(_IOC_NONE, 0xc4, 0xd, 0), 0x1600a) = 0
mmap2(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x74efe000
mprotect(0x74eff000, 8388608, PROT_READ|PROT_WRITE) = 0
clone(child_stack=0x756fdf78, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[490], tls=0x756fe900, child_tidptr=0x756fe4a8) = 490
ioctl(3, _IOC(_IOC_NONE, 0xc4, 0xc, 0), 0x15009) = 0
ioctl(3, _IOC(_IOC_WRITE, 0xc4, 0x4, 0xc), 0x7e93c764) = 0
ioctl(3, _IOC(_IOC_READ|_IOC_WRITE, 0xc4, 0x8, 0x10), 0x7e93c718) = -1 EAGAIN (Risorsa temporaneamente non disponibile)
futex(0x76e9edc4, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, NULL, FUTEX_BITSET_MATCH_ANY 
then no other output. just blocks.

$ uname -a
Linux alarmpi 4.19.66-1-ARCH #1 SMP PREEMPT Sat Aug 17 02:33:29 UTC 2019 armv7l GNU/Linux
$ cat /proc/cpu
cpu/ cpuinfo
[[email protected] cec]$ cat /proc/cpuinfo

Code: Select all

processor	: 0
model name	: ARMv7 Processor rev 5 (v7l)
BogoMIPS	: 57.60
Features	: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xc07
CPU revision	: 5

processor	: 1
model name	: ARMv7 Processor rev 5 (v7l)
BogoMIPS	: 57.60
Features	: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xc07
CPU revision	: 5

processor	: 2
model name	: ARMv7 Processor rev 5 (v7l)
BogoMIPS	: 57.60
Features	: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xc07
CPU revision	: 5

processor	: 3
model name	: ARMv7 Processor rev 5 (v7l)
BogoMIPS	: 57.60
Features	: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xc07
CPU revision	: 5

Hardware	: BCM2835
Revision	: a01041
Serial		: xxxxxxxxxxxx
The RPi is connected to HDMI to my TV and I can see the console log.

cec-client hangs as well

thanks for your time
Antonio

totopr
Posts: 4
Joined: Sun Aug 18, 2019 8:34 pm

Re: bcm_host_init hangs

Wed Aug 21, 2019 7:06 pm

anyone?

jdonald
Posts: 417
Joined: Fri Nov 03, 2017 4:36 pm

Re: bcm_host_init hangs

Thu Aug 22, 2019 6:23 pm

As of this morning my Pi 3B+ works fine with Buster + kernel 4.19.66 after sudo apt update && sudo apt upgrade -y && sudo rpi-update. I tested bcm_host_init() via kodi, minecraft-pi (in legacy mode), and the hello_triangle example under /opt/vc/src/hello_pi.
totopr wrote:
Sun Aug 18, 2019 8:52 pm
$ uname -a
Linux alarmpi 4.19.66-1-ARCH #1 SMP PREEMPT Sat Aug 17 02:33:29 UTC 2019 armv7l GNU/Linux
What's 4.19.66-1-ARCH? A custom kernel for Arch Linux? If you're not using Raspbian's kernel then all bets are off when trying to use Raspbian userland stuff.

You didn't mention your model of Pi, but from what I can tell revision a01041 is a Pi 2B. Tested under legacy mode or fkms?

totopr
Posts: 4
Joined: Sun Aug 18, 2019 8:34 pm

Re: bcm_host_init hangs

Fri Aug 23, 2019 3:15 pm

Hello Jdonald,

it is an archlinux arm distribution https://archlinuxarm.org/platforms/armv ... berry-pi-2.
the HW is a rpi2 model B V1.1.

It worked fine till last update (18th August). I have to take my courage and install raspbian, losing all configurations I've done past 3-4years. It is not just a media center :(.
meanwhile I will hope!!

thanks
Antonio

jdonald
Posts: 417
Joined: Fri Nov 03, 2017 4:36 pm

Re: bcm_host_init hangs

Fri Aug 23, 2019 4:45 pm

Didn't know there was an Arch distro for Pi that used all the Raspbian userland binaries (nonstandard kodi, libbcm_host.so, brcmGLES). That's much like Ubuntu MATE 16.04 which relied on the Raspbian kernel.

If so, things might just work if you replace it with the Raspbian kernel while retaining the same Arch userland, which you can do by running rpi-update. Of course, make a backup before attempting this.

Or get a new SD card with Raspbian (and perhaps a new Pi) for your media center usage while retaining the Arch system for development and other tasks?

totopr
Posts: 4
Joined: Sun Aug 18, 2019 8:34 pm

Re: bcm_host_init hangs

Sat Aug 24, 2019 9:45 pm

Hello JDonald,

rpi-update did the trick. It works now. You saved me!!!. Now I have to understand if pacman system update recognize the new kernel, but this should be not so complex.
Again, thanks a lot. :D
Antonio

Return to “Arch”