broadcom graphics API hangs after kernel 4.9.11 update

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

broadcom graphics API hangs after kernel 4.9.11 update

Postby aroberts » Wed Feb 22, 2017 5:26 am

libbcm_host api graphics_get_display_size hangs on original raspberry pi (armv6l), but not on Raspberry pi 3 (armv7l)
after recent firmware/kernel update to 4.9.11.

Sample program. rpi.c:
#include <stdio.h>
#include <stdint.h>
#include <bcm_host.h>

int main(void)
{
uint32_t screen_width, screen_height;
bcm_host_init();
printf("Calling graphics_get_display_size\n");
int32_t success = graphics_get_display_size(DISPMANX_ID_MAIN_LCD, &screen_width, &screen_height);
if (success < 0)
{
printf("graphics_get_display_size failed - %d\n", success);
}
else
{
printf("graphics_get_display_size ok width=%d, height=%d\n", screen_width, screen_height);
}
return 0;
}

built using:
gcc -O0 -g -o rpi rpi.c -I/opt/vc/include -L/opt/vc/lib -lbcm_host

On armvl6 it hangs here:
gdb rpi
run
...
Calling graphics_get_display_size
^C
Thread 1 "rpi" received signal SIGINT, Interrupt.
0x76ddbf70 in do_futex_wait.constprop () from /usr/lib/libpthread.so.0
(gdb) where
#0 0x76ddbf70 in do_futex_wait.constprop () from /usr/lib/libpthread.so.0
#1 0x76ddc0b4 in __new_sem_wait_slow.constprop.0 ()
from /usr/lib/libpthread.so.0
#2 0x76fa2868 in dispmanx_get_handle () from /opt/vc/lib/libbcm_host.so
#3 0x76fa3510 in vc_dispmanx_display_open () from /opt/vc/lib/libbcm_host.so
#4 0x76f977fc in graphics_get_display_size () from /opt/vc/lib/libbcm_host.so
#5 0x000106f4 in main () at rpi.c:10

on armv7l (RPI 3) works as expected.
./rpi
Calling graphics_get_display_size
graphics_get_display_size ok width=720, height=480

This was working ok on previous 4.4.x kernels on both models.

Regards

Andrew Roberts
aroberts
 
Posts: 41
Joined: Tue Mar 15, 2016 4:32 am

Re: broadcom graphics API hangs after kernel 4.9.11 update

Postby aroberts » Sat Feb 25, 2017 5:13 am

This now appears to be fixed in the latest kernel update: 4.9.12-1
So it now works as expected on both original armv6 PI and armv7 Pi3

Andrew
aroberts
 
Posts: 41
Joined: Tue Mar 15, 2016 4:32 am

Re: broadcom graphics API hangs after kernel 4.9.11 update

Postby aroberts » Mon Feb 27, 2017 5:40 am

Looks like this is not totally fixed. armv6 raspberry pi looks ok. But the RPI3 (armv7)
occaisionally hangs with the test program. So there seems to be a partial fix.
Once the program stops working once it stays that way until the next reboot.

Regards

Andrew
aroberts
 
Posts: 41
Joined: Tue Mar 15, 2016 4:32 am

Re: broadcom graphics API hangs after kernel 4.9.11 update

Postby aroberts » Tue Feb 28, 2017 9:00 am

4.9.13-1 upgrade appear to fix this properly on both armv6 and armv7.
Both the cut down test program and my original app no longer hang after multiple runs.
aroberts
 
Posts: 41
Joined: Tue Mar 15, 2016 4:32 am


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 4 guests