All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Failed to load libmmal.so from rpi-userland package via buildroot toolchain on raspberry pi 4
@ 2020-03-28  7:09 iman ahmadvand
  2020-03-28 10:31 ` Peter Seiderer
  0 siblings, 1 reply; 10+ messages in thread
From: iman ahmadvand @ 2020-03-28  7:09 UTC (permalink / raw)
  To: buildroot

Hi everyone.
It seems that loading the MMAL interface shared libraries from rpi-userland
package via simple dlopen is not possible, or more specific, the packages
or binaries such as VLC or VLC codec plugin (libavcodec_plugin) could not
load the libavcodec from FFmpeg which in turn depends on libmmal*.so

The steps to reproduce(with BR2_PACKAGE_RPI_USERLAND enabled,
BR2_STRIP_strip disabled, BR2_OPTIMIZE_0 enabled):
git clone git://git.busybox.net/buildroot buildroot && cd buildroot && git
checkout 2019.11.01
make raspberrypi4_defconfig && make all

Then in this image try to run a simple c routine with dlopen(), if you do
so, for example, ./dltest /usr/lib/libmmal.so you will end up with:

symbol 'mmal_port_payload_alloc': can't resolve symbol
symbol 'mmal_port_payload_free': can't resolve symbol
symbol 'mmal_port_log_category': can't resolve symbol

Or for another proof of the issue, you can run VLC with X11 to play an
MPEG-4 video, and you will  end up with VLC could not load the codec module
because of the same thing:

main debug: loading plugins cache file /usr/lib/vlc/plugins/plugins.dat
main warning: cannot read /usr/lib/vlc/plugins/plugins.dat: No such
file or directory
main debug: recursively browsing `/usr/lib/vlc/plugins'
main warning: cannot load module
`/usr/lib/vlc/plugins/codec/libavcodec_plugin.so' ((null)

Any idea about this?

Best Regards.
IMAN.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20200328/edb4f076/attachment.html>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] Failed to load libmmal.so from rpi-userland package via buildroot toolchain on raspberry pi 4
  2020-03-28  7:09 [Buildroot] Failed to load libmmal.so from rpi-userland package via buildroot toolchain on raspberry pi 4 iman ahmadvand
@ 2020-03-28 10:31 ` Peter Seiderer
  2020-03-28 11:05   ` daggs
  2020-03-28 12:44   ` iman ahmadvand
  0 siblings, 2 replies; 10+ messages in thread
From: Peter Seiderer @ 2020-03-28 10:31 UTC (permalink / raw)
  To: buildroot

Hello Iman,

On Sat, 28 Mar 2020 11:39:46 +0430, iman ahmadvand <iman72411@gmail.com> wrote:

> Hi everyone.
> It seems that loading the MMAL interface shared libraries from rpi-userland
> package via simple dlopen is not possible, or more specific, the packages
> or binaries such as VLC or VLC codec plugin (libavcodec_plugin) could not
> load the libavcodec from FFmpeg which in turn depends on libmmal*.so
>
> The steps to reproduce(with BR2_PACKAGE_RPI_USERLAND enabled,
> BR2_STRIP_strip disabled, BR2_OPTIMIZE_0 enabled):
> git clone git://git.busybox.net/buildroot buildroot && cd buildroot && git
> checkout 2019.11.01
> make raspberrypi4_defconfig && make all
>
> Then in this image try to run a simple c routine with dlopen(), if you do
> so, for example, ./dltest /usr/lib/libmmal.so you will end up with:
>
> symbol 'mmal_port_payload_alloc': can't resolve symbol
> symbol 'mmal_port_payload_free': can't resolve symbol
> symbol 'mmal_port_log_category': can't resolve symbol
>

Can confirm your failure...did not (yet) find out what fails exactly, but
ldd produces the following ouput (mind the 0x00000000):

	$ ldd /usr/lib/libmmal.so
checking sub-depends for '/usr/lib/libmmal_vc_client.so'
checking sub-depends for '/usr/lib/libmmal_components.so'
checking sub-depends for '/usr/lib/libvchiq_arm.so'
checking sub-depends for '/usr/lib/libvcsm.so'
checking sub-depends for '/usr/lib/libmmal_core.so'
checking sub-depends for '/usr/lib/libmmal_util.so'
checking sub-depends for '/usr/lib/libcontainers.so'
checking sub-depends for '/usr/lib/libvcos.so'
checking sub-depends for '/lib/libc.so.0'
        ld-uClibc.so.1 => /lib/ld-uClibc.so.1 (0xb6f8b000)
        libmmal_vc_client.so => /usr/lib/libmmal_vc_client.so (0x00000000)
        libmmal_components.so => /usr/lib/libmmal_components.so (0x00000000)
        libvchiq_arm.so => /usr/lib/libvchiq_arm.so (0x00000000)
        libvcsm.so => /usr/lib/libvcsm.so (0x00000000)
        libmmal_core.so => /usr/lib/libmmal_core.so (0x00000000)
        libmmal_util.so => /usr/lib/libmmal_util.so (0x00000000)
        libcontainers.so => /usr/lib/libcontainers.so (0x00000000)
        libvcos.so => /usr/lib/libvcos.so (0x00000000)
        libc.so.0 => /lib/libc.so.0 (0x00000000)
        /lib/ld-uClibc.so.1 => /lib/ld-uClibc.so.1 (0x00000000)


After changing the buildroot toolchain from uclibc to glibc (and a full
re-build) dlopen() of /usr/lib/libmmal.so works and ldd produces the
following output:

	$ ldd /usr/lib/libmmal.so
	linux-vdso.so.1 (0xbea59000)
	libmmal_vc_client.so => /usr/lib/libmmal_vc_client.so (0xb6f5f000)
	libmmal_components.so => /usr/lib/libmmal_components.so (0xb6f44000)
	libvchiq_arm.so => /usr/lib/libvchiq_arm.so (0xb6f2e000)
	libvcsm.so => /usr/lib/libvcsm.so (0xb6f14000)
	libmmal_core.so => /usr/lib/libmmal_core.so (0xb6ef6000)
	libmmal_util.so => /usr/lib/libmmal_util.so (0xb6ed8000)
	libcontainers.so => /usr/lib/libcontainers.so (0xb6eb5000)
	libvcos.so => /usr/lib/libvcos.so (0xb6e9c000)
	libpthread.so.0 => /lib/libpthread.so.0 (0xb6e71000)
	libdl.so.2 => /lib/libdl.so.2 (0xb6e5e000)
	librt.so.1 => /lib/librt.so.1 (0xb6e47000)
	libc.so.6 => /lib/libc.so.6 (0xb6cfb000)
	/lib/ld-linux-armhf.so.3 (0xb6f8f000)

Regards,
Peter


> Or for another proof of the issue, you can run VLC with X11 to play an
> MPEG-4 video, and you will  end up with VLC could not load the codec module
> because of the same thing:
>
> main debug: loading plugins cache file /usr/lib/vlc/plugins/plugins.dat
> main warning: cannot read /usr/lib/vlc/plugins/plugins.dat: No such
> file or directory
> main debug: recursively browsing `/usr/lib/vlc/plugins'
> main warning: cannot load module
> `/usr/lib/vlc/plugins/codec/libavcodec_plugin.so' ((null)
>
> Any idea about this?
>
> Best Regards.
> IMAN.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] Failed to load libmmal.so from rpi-userland package via buildroot toolchain on raspberry pi 4
  2020-03-28 10:31 ` Peter Seiderer
@ 2020-03-28 11:05   ` daggs
  2020-03-28 14:28     ` Peter Seiderer
  2020-03-28 12:44   ` iman ahmadvand
  1 sibling, 1 reply; 10+ messages in thread
From: daggs @ 2020-03-28 11:05 UTC (permalink / raw)
  To: buildroot

Greetings,

> Sent: Saturday, March 28, 2020 at 1:31 PM
> From: "Peter Seiderer" <ps.report@gmx.net>
> To: "iman ahmadvand" <iman72411@gmail.com>
> Cc: buildroot at busybox.net
> Subject: Re: [Buildroot] Failed to load libmmal.so from rpi-userland package via buildroot toolchain on raspberry pi 4
>
> Hello Iman,
>
> On Sat, 28 Mar 2020 11:39:46 +0430, iman ahmadvand <iman72411@gmail.com> wrote:
>
> > Hi everyone.
> > It seems that loading the MMAL interface shared libraries from rpi-userland
> > package via simple dlopen is not possible, or more specific, the packages
> > or binaries such as VLC or VLC codec plugin (libavcodec_plugin) could not
> > load the libavcodec from FFmpeg which in turn depends on libmmal*.so
> >
> > The steps to reproduce(with BR2_PACKAGE_RPI_USERLAND enabled,
> > BR2_STRIP_strip disabled, BR2_OPTIMIZE_0 enabled):
> > git clone git://git.busybox.net/buildroot buildroot && cd buildroot && git
> > checkout 2019.11.01
> > make raspberrypi4_defconfig && make all
> >
> > Then in this image try to run a simple c routine with dlopen(), if you do
> > so, for example, ./dltest /usr/lib/libmmal.so you will end up with:
> >
> > symbol 'mmal_port_payload_alloc': can't resolve symbol
> > symbol 'mmal_port_payload_free': can't resolve symbol
> > symbol 'mmal_port_log_category': can't resolve symbol
> >
>
> Can confirm your failure...did not (yet) find out what fails exactly, but
> ldd produces the following ouput (mind the 0x00000000):
>
> 	$ ldd /usr/lib/libmmal.so
> checking sub-depends for '/usr/lib/libmmal_vc_client.so'
> checking sub-depends for '/usr/lib/libmmal_components.so'
> checking sub-depends for '/usr/lib/libvchiq_arm.so'
> checking sub-depends for '/usr/lib/libvcsm.so'
> checking sub-depends for '/usr/lib/libmmal_core.so'
> checking sub-depends for '/usr/lib/libmmal_util.so'
> checking sub-depends for '/usr/lib/libcontainers.so'
> checking sub-depends for '/usr/lib/libvcos.so'
> checking sub-depends for '/lib/libc.so.0'
>         ld-uClibc.so.1 => /lib/ld-uClibc.so.1 (0xb6f8b000)
>         libmmal_vc_client.so => /usr/lib/libmmal_vc_client.so (0x00000000)
>         libmmal_components.so => /usr/lib/libmmal_components.so (0x00000000)
>         libvchiq_arm.so => /usr/lib/libvchiq_arm.so (0x00000000)
>         libvcsm.so => /usr/lib/libvcsm.so (0x00000000)
>         libmmal_core.so => /usr/lib/libmmal_core.so (0x00000000)
>         libmmal_util.so => /usr/lib/libmmal_util.so (0x00000000)
>         libcontainers.so => /usr/lib/libcontainers.so (0x00000000)
>         libvcos.so => /usr/lib/libvcos.so (0x00000000)
>         libc.so.0 => /lib/libc.so.0 (0x00000000)
>         /lib/ld-uClibc.so.1 => /lib/ld-uClibc.so.1 (0x00000000)
>
>
> After changing the buildroot toolchain from uclibc to glibc (and a full
> re-build) dlopen() of /usr/lib/libmmal.so works and ldd produces the
> following output:
>
> 	$ ldd /usr/lib/libmmal.so
> 	linux-vdso.so.1 (0xbea59000)
> 	libmmal_vc_client.so => /usr/lib/libmmal_vc_client.so (0xb6f5f000)
> 	libmmal_components.so => /usr/lib/libmmal_components.so (0xb6f44000)
> 	libvchiq_arm.so => /usr/lib/libvchiq_arm.so (0xb6f2e000)
> 	libvcsm.so => /usr/lib/libvcsm.so (0xb6f14000)
> 	libmmal_core.so => /usr/lib/libmmal_core.so (0xb6ef6000)
> 	libmmal_util.so => /usr/lib/libmmal_util.so (0xb6ed8000)
> 	libcontainers.so => /usr/lib/libcontainers.so (0xb6eb5000)
> 	libvcos.so => /usr/lib/libvcos.so (0xb6e9c000)
> 	libpthread.so.0 => /lib/libpthread.so.0 (0xb6e71000)
> 	libdl.so.2 => /lib/libdl.so.2 (0xb6e5e000)
> 	librt.so.1 => /lib/librt.so.1 (0xb6e47000)
> 	libc.so.6 => /lib/libc.so.6 (0xb6cfb000)
> 	/lib/ld-linux-armhf.so.3 (0xb6f8f000)
>
> Regards,
> Peter
>
>
> > Or for another proof of the issue, you can run VLC with X11 to play an
> > MPEG-4 video, and you will  end up with VLC could not load the codec module
> > because of the same thing:
> >
> > main debug: loading plugins cache file /usr/lib/vlc/plugins/plugins.dat
> > main warning: cannot read /usr/lib/vlc/plugins/plugins.dat: No such
> > file or directory
> > main debug: recursively browsing `/usr/lib/vlc/plugins'
> > main warning: cannot load module
> > `/usr/lib/vlc/plugins/codec/libavcodec_plugin.so' ((null)
> >
> > Any idea about this?
> >
> > Best Regards.
> > IMAN.

I wonder, how do you run ldd on the pi4 with the buildroot env? I'm trying to debug my mmal issue too.

Thanks.

Dagg.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] Failed to load libmmal.so from rpi-userland package via buildroot toolchain on raspberry pi 4
  2020-03-28 10:31 ` Peter Seiderer
  2020-03-28 11:05   ` daggs
@ 2020-03-28 12:44   ` iman ahmadvand
  2020-03-28 14:34     ` Peter Seiderer
  1 sibling, 1 reply; 10+ messages in thread
From: iman ahmadvand @ 2020-03-28 12:44 UTC (permalink / raw)
  To: buildroot

Hi Peter.

Exact same situation for me when changing to glibc or using external linaro
toolchain(which comes with glibc).
Don't know what's going on.
Interesting thread: https://github.com/raspberrypi/userland/issues/178

Regards.
IMAN.

On Sat, Mar 28, 2020 at 3:01 PM Peter Seiderer <ps.report@gmx.net> wrote:

> Hello Iman,
>
> On Sat, 28 Mar 2020 11:39:46 +0430, iman ahmadvand <iman72411@gmail.com>
> wrote:
>
> > Hi everyone.
> > It seems that loading the MMAL interface shared libraries from
> rpi-userland
> > package via simple dlopen is not possible, or more specific, the packages
> > or binaries such as VLC or VLC codec plugin (libavcodec_plugin) could not
> > load the libavcodec from FFmpeg which in turn depends on libmmal*.so
> >
> > The steps to reproduce(with BR2_PACKAGE_RPI_USERLAND enabled,
> > BR2_STRIP_strip disabled, BR2_OPTIMIZE_0 enabled):
> > git clone git://git.busybox.net/buildroot buildroot && cd buildroot &&
> git
> > checkout 2019.11.01
> > make raspberrypi4_defconfig && make all
> >
> > Then in this image try to run a simple c routine with dlopen(), if you do
> > so, for example, ./dltest /usr/lib/libmmal.so you will end up with:
> >
> > symbol 'mmal_port_payload_alloc': can't resolve symbol
> > symbol 'mmal_port_payload_free': can't resolve symbol
> > symbol 'mmal_port_log_category': can't resolve symbol
> >
>
> Can confirm your failure...did not (yet) find out what fails exactly, but
> ldd produces the following ouput (mind the 0x00000000):
>
>         $ ldd /usr/lib/libmmal.so
> checking sub-depends for '/usr/lib/libmmal_vc_client.so'
> checking sub-depends for '/usr/lib/libmmal_components.so'
> checking sub-depends for '/usr/lib/libvchiq_arm.so'
> checking sub-depends for '/usr/lib/libvcsm.so'
> checking sub-depends for '/usr/lib/libmmal_core.so'
> checking sub-depends for '/usr/lib/libmmal_util.so'
> checking sub-depends for '/usr/lib/libcontainers.so'
> checking sub-depends for '/usr/lib/libvcos.so'
> checking sub-depends for '/lib/libc.so.0'
>         ld-uClibc.so.1 => /lib/ld-uClibc.so.1 (0xb6f8b000)
>         libmmal_vc_client.so => /usr/lib/libmmal_vc_client.so (0x00000000)
>         libmmal_components.so => /usr/lib/libmmal_components.so
> (0x00000000)
>         libvchiq_arm.so => /usr/lib/libvchiq_arm.so (0x00000000)
>         libvcsm.so => /usr/lib/libvcsm.so (0x00000000)
>         libmmal_core.so => /usr/lib/libmmal_core.so (0x00000000)
>         libmmal_util.so => /usr/lib/libmmal_util.so (0x00000000)
>         libcontainers.so => /usr/lib/libcontainers.so (0x00000000)
>         libvcos.so => /usr/lib/libvcos.so (0x00000000)
>         libc.so.0 => /lib/libc.so.0 (0x00000000)
>         /lib/ld-uClibc.so.1 => /lib/ld-uClibc.so.1 (0x00000000)
>
>
> After changing the buildroot toolchain from uclibc to glibc (and a full
> re-build) dlopen() of /usr/lib/libmmal.so works and ldd produces the
> following output:
>
>         $ ldd /usr/lib/libmmal.so
>         linux-vdso.so.1 (0xbea59000)
>         libmmal_vc_client.so => /usr/lib/libmmal_vc_client.so (0xb6f5f000)
>         libmmal_components.so => /usr/lib/libmmal_components.so
> (0xb6f44000)
>         libvchiq_arm.so => /usr/lib/libvchiq_arm.so (0xb6f2e000)
>         libvcsm.so => /usr/lib/libvcsm.so (0xb6f14000)
>         libmmal_core.so => /usr/lib/libmmal_core.so (0xb6ef6000)
>         libmmal_util.so => /usr/lib/libmmal_util.so (0xb6ed8000)
>         libcontainers.so => /usr/lib/libcontainers.so (0xb6eb5000)
>         libvcos.so => /usr/lib/libvcos.so (0xb6e9c000)
>         libpthread.so.0 => /lib/libpthread.so.0 (0xb6e71000)
>         libdl.so.2 => /lib/libdl.so.2 (0xb6e5e000)
>         librt.so.1 => /lib/librt.so.1 (0xb6e47000)
>         libc.so.6 => /lib/libc.so.6 (0xb6cfb000)
>         /lib/ld-linux-armhf.so.3 (0xb6f8f000)
>
> Regards,
> Peter
>
>
> > Or for another proof of the issue, you can run VLC with X11 to play an
> > MPEG-4 video, and you will  end up with VLC could not load the codec
> module
> > because of the same thing:
> >
> > main debug: loading plugins cache file /usr/lib/vlc/plugins/plugins.dat
> > main warning: cannot read /usr/lib/vlc/plugins/plugins.dat: No such
> > file or directory
> > main debug: recursively browsing `/usr/lib/vlc/plugins'
> > main warning: cannot load module
> > `/usr/lib/vlc/plugins/codec/libavcodec_plugin.so' ((null)
> >
> > Any idea about this?
> >
> > Best Regards.
> > IMAN.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20200328/f718c8b0/attachment.html>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] Failed to load libmmal.so from rpi-userland package via buildroot toolchain on raspberry pi 4
  2020-03-28 11:05   ` daggs
@ 2020-03-28 14:28     ` Peter Seiderer
  2020-03-28 17:04       ` daggs
  0 siblings, 1 reply; 10+ messages in thread
From: Peter Seiderer @ 2020-03-28 14:28 UTC (permalink / raw)
  To: buildroot

Hello Dagg,

On Sat, 28 Mar 2020 12:05:38 +0100, daggs <daggs@gmx.com> wrote:

> Greetings,
>
> > Sent: Saturday, March 28, 2020 at 1:31 PM
> > From: "Peter Seiderer" <ps.report@gmx.net>
> > To: "iman ahmadvand" <iman72411@gmail.com>
> > Cc: buildroot at busybox.net
> > Subject: Re: [Buildroot] Failed to load libmmal.so from rpi-userland package via buildroot toolchain on raspberry pi 4
> >
> > Hello Iman,
> >
> > On Sat, 28 Mar 2020 11:39:46 +0430, iman ahmadvand <iman72411@gmail.com> wrote:
> >
> > > Hi everyone.
> > > It seems that loading the MMAL interface shared libraries from rpi-userland
> > > package via simple dlopen is not possible, or more specific, the packages
> > > or binaries such as VLC or VLC codec plugin (libavcodec_plugin) could not
> > > load the libavcodec from FFmpeg which in turn depends on libmmal*.so
> > >
> > > The steps to reproduce(with BR2_PACKAGE_RPI_USERLAND enabled,
> > > BR2_STRIP_strip disabled, BR2_OPTIMIZE_0 enabled):
> > > git clone git://git.busybox.net/buildroot buildroot && cd buildroot && git
> > > checkout 2019.11.01
> > > make raspberrypi4_defconfig && make all
> > >
> > > Then in this image try to run a simple c routine with dlopen(), if you do
> > > so, for example, ./dltest /usr/lib/libmmal.so you will end up with:
> > >
> > > symbol 'mmal_port_payload_alloc': can't resolve symbol
> > > symbol 'mmal_port_payload_free': can't resolve symbol
> > > symbol 'mmal_port_log_category': can't resolve symbol
> > >
> >
> > Can confirm your failure...did not (yet) find out what fails exactly, but
> > ldd produces the following ouput (mind the 0x00000000):
> >
> > 	$ ldd /usr/lib/libmmal.so
> > checking sub-depends for '/usr/lib/libmmal_vc_client.so'
> > checking sub-depends for '/usr/lib/libmmal_components.so'
> > checking sub-depends for '/usr/lib/libvchiq_arm.so'
> > checking sub-depends for '/usr/lib/libvcsm.so'
> > checking sub-depends for '/usr/lib/libmmal_core.so'
> > checking sub-depends for '/usr/lib/libmmal_util.so'
> > checking sub-depends for '/usr/lib/libcontainers.so'
> > checking sub-depends for '/usr/lib/libvcos.so'
> > checking sub-depends for '/lib/libc.so.0'
> >         ld-uClibc.so.1 => /lib/ld-uClibc.so.1 (0xb6f8b000)
> >         libmmal_vc_client.so => /usr/lib/libmmal_vc_client.so (0x00000000)
> >         libmmal_components.so => /usr/lib/libmmal_components.so (0x00000000)
> >         libvchiq_arm.so => /usr/lib/libvchiq_arm.so (0x00000000)
> >         libvcsm.so => /usr/lib/libvcsm.so (0x00000000)
> >         libmmal_core.so => /usr/lib/libmmal_core.so (0x00000000)
> >         libmmal_util.so => /usr/lib/libmmal_util.so (0x00000000)
> >         libcontainers.so => /usr/lib/libcontainers.so (0x00000000)
> >         libvcos.so => /usr/lib/libvcos.so (0x00000000)
> >         libc.so.0 => /lib/libc.so.0 (0x00000000)
> >         /lib/ld-uClibc.so.1 => /lib/ld-uClibc.so.1 (0x00000000)
> >
> >
> > After changing the buildroot toolchain from uclibc to glibc (and a full
> > re-build) dlopen() of /usr/lib/libmmal.so works and ldd produces the
> > following output:
> >
> > 	$ ldd /usr/lib/libmmal.so
> > 	linux-vdso.so.1 (0xbea59000)
> > 	libmmal_vc_client.so => /usr/lib/libmmal_vc_client.so (0xb6f5f000)
> > 	libmmal_components.so => /usr/lib/libmmal_components.so (0xb6f44000)
> > 	libvchiq_arm.so => /usr/lib/libvchiq_arm.so (0xb6f2e000)
> > 	libvcsm.so => /usr/lib/libvcsm.so (0xb6f14000)
> > 	libmmal_core.so => /usr/lib/libmmal_core.so (0xb6ef6000)
> > 	libmmal_util.so => /usr/lib/libmmal_util.so (0xb6ed8000)
> > 	libcontainers.so => /usr/lib/libcontainers.so (0xb6eb5000)
> > 	libvcos.so => /usr/lib/libvcos.so (0xb6e9c000)
> > 	libpthread.so.0 => /lib/libpthread.so.0 (0xb6e71000)
> > 	libdl.so.2 => /lib/libdl.so.2 (0xb6e5e000)
> > 	librt.so.1 => /lib/librt.so.1 (0xb6e47000)
> > 	libc.so.6 => /lib/libc.so.6 (0xb6cfb000)
> > 	/lib/ld-linux-armhf.so.3 (0xb6f8f000)
> >
> > Regards,
> > Peter
> >
> >
> > > Or for another proof of the issue, you can run VLC with X11 to play an
> > > MPEG-4 video, and you will  end up with VLC could not load the codec module
> > > because of the same thing:
> > >
> > > main debug: loading plugins cache file /usr/lib/vlc/plugins/plugins.dat
> > > main warning: cannot read /usr/lib/vlc/plugins/plugins.dat: No such
> > > file or directory
> > > main debug: recursively browsing `/usr/lib/vlc/plugins'
> > > main warning: cannot load module
> > > `/usr/lib/vlc/plugins/codec/libavcodec_plugin.so' ((null)
> > >
> > > Any idea about this?
> > >
> > > Best Regards.
> > > IMAN.
>
> I wonder, how do you run ldd on the pi4 with the buildroot env? I'm trying to debug my mmal issue too.

Exactly with the command line as given above 'ldd /usr/lib/libmmal.so' on the
target (here pi4), what do your mean with buildroot env (do not mix 'ldd -
print shared object dependencies' with 'ld - The GNU linker')?

Regards,
Peter

>
> Thanks.
>
> Dagg.
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] Failed to load libmmal.so from rpi-userland package via buildroot toolchain on raspberry pi 4
  2020-03-28 12:44   ` iman ahmadvand
@ 2020-03-28 14:34     ` Peter Seiderer
  2020-04-07 13:14       ` iman ahmadvand
  0 siblings, 1 reply; 10+ messages in thread
From: Peter Seiderer @ 2020-03-28 14:34 UTC (permalink / raw)
  To: buildroot

Hello Iman,

On Sat, 28 Mar 2020 17:14:59 +0430, iman ahmadvand <iman72411@gmail.com> wrote:

> Hi Peter.
>
> Exact same situation for me when changing to glibc or using external linaro
> toolchain(which comes with glibc).

What do you mean by 'exact same situation', the simple dlopen() test, or the
complete VLC test? Did you do a *complete* re-build and complete installation?
Can you show the output from 'ldd /usr/lib/libmmal.so'?

Regards,
Peter

> Don't know what's going on.
> Interesting thread: https://github.com/raspberrypi/userland/issues/178
>
> Regards.
> IMAN.
>
> On Sat, Mar 28, 2020 at 3:01 PM Peter Seiderer <ps.report@gmx.net> wrote:
>
> > Hello Iman,
> >
> > On Sat, 28 Mar 2020 11:39:46 +0430, iman ahmadvand <iman72411@gmail.com>
> > wrote:
> >
> > > Hi everyone.
> > > It seems that loading the MMAL interface shared libraries from
> > rpi-userland
> > > package via simple dlopen is not possible, or more specific, the packages
> > > or binaries such as VLC or VLC codec plugin (libavcodec_plugin) could not
> > > load the libavcodec from FFmpeg which in turn depends on libmmal*.so
> > >
> > > The steps to reproduce(with BR2_PACKAGE_RPI_USERLAND enabled,
> > > BR2_STRIP_strip disabled, BR2_OPTIMIZE_0 enabled):
> > > git clone git://git.busybox.net/buildroot buildroot && cd buildroot &&
> > git
> > > checkout 2019.11.01
> > > make raspberrypi4_defconfig && make all
> > >
> > > Then in this image try to run a simple c routine with dlopen(), if you do
> > > so, for example, ./dltest /usr/lib/libmmal.so you will end up with:
> > >
> > > symbol 'mmal_port_payload_alloc': can't resolve symbol
> > > symbol 'mmal_port_payload_free': can't resolve symbol
> > > symbol 'mmal_port_log_category': can't resolve symbol
> > >
> >
> > Can confirm your failure...did not (yet) find out what fails exactly, but
> > ldd produces the following ouput (mind the 0x00000000):
> >
> >         $ ldd /usr/lib/libmmal.so
> > checking sub-depends for '/usr/lib/libmmal_vc_client.so'
> > checking sub-depends for '/usr/lib/libmmal_components.so'
> > checking sub-depends for '/usr/lib/libvchiq_arm.so'
> > checking sub-depends for '/usr/lib/libvcsm.so'
> > checking sub-depends for '/usr/lib/libmmal_core.so'
> > checking sub-depends for '/usr/lib/libmmal_util.so'
> > checking sub-depends for '/usr/lib/libcontainers.so'
> > checking sub-depends for '/usr/lib/libvcos.so'
> > checking sub-depends for '/lib/libc.so.0'
> >         ld-uClibc.so.1 => /lib/ld-uClibc.so.1 (0xb6f8b000)
> >         libmmal_vc_client.so => /usr/lib/libmmal_vc_client.so (0x00000000)
> >         libmmal_components.so => /usr/lib/libmmal_components.so
> > (0x00000000)
> >         libvchiq_arm.so => /usr/lib/libvchiq_arm.so (0x00000000)
> >         libvcsm.so => /usr/lib/libvcsm.so (0x00000000)
> >         libmmal_core.so => /usr/lib/libmmal_core.so (0x00000000)
> >         libmmal_util.so => /usr/lib/libmmal_util.so (0x00000000)
> >         libcontainers.so => /usr/lib/libcontainers.so (0x00000000)
> >         libvcos.so => /usr/lib/libvcos.so (0x00000000)
> >         libc.so.0 => /lib/libc.so.0 (0x00000000)
> >         /lib/ld-uClibc.so.1 => /lib/ld-uClibc.so.1 (0x00000000)
> >
> >
> > After changing the buildroot toolchain from uclibc to glibc (and a full
> > re-build) dlopen() of /usr/lib/libmmal.so works and ldd produces the
> > following output:
> >
> >         $ ldd /usr/lib/libmmal.so
> >         linux-vdso.so.1 (0xbea59000)
> >         libmmal_vc_client.so => /usr/lib/libmmal_vc_client.so (0xb6f5f000)
> >         libmmal_components.so => /usr/lib/libmmal_components.so
> > (0xb6f44000)
> >         libvchiq_arm.so => /usr/lib/libvchiq_arm.so (0xb6f2e000)
> >         libvcsm.so => /usr/lib/libvcsm.so (0xb6f14000)
> >         libmmal_core.so => /usr/lib/libmmal_core.so (0xb6ef6000)
> >         libmmal_util.so => /usr/lib/libmmal_util.so (0xb6ed8000)
> >         libcontainers.so => /usr/lib/libcontainers.so (0xb6eb5000)
> >         libvcos.so => /usr/lib/libvcos.so (0xb6e9c000)
> >         libpthread.so.0 => /lib/libpthread.so.0 (0xb6e71000)
> >         libdl.so.2 => /lib/libdl.so.2 (0xb6e5e000)
> >         librt.so.1 => /lib/librt.so.1 (0xb6e47000)
> >         libc.so.6 => /lib/libc.so.6 (0xb6cfb000)
> >         /lib/ld-linux-armhf.so.3 (0xb6f8f000)
> >
> > Regards,
> > Peter
> >
> >
> > > Or for another proof of the issue, you can run VLC with X11 to play an
> > > MPEG-4 video, and you will  end up with VLC could not load the codec
> > module
> > > because of the same thing:
> > >
> > > main debug: loading plugins cache file /usr/lib/vlc/plugins/plugins.dat
> > > main warning: cannot read /usr/lib/vlc/plugins/plugins.dat: No such
> > > file or directory
> > > main debug: recursively browsing `/usr/lib/vlc/plugins'
> > > main warning: cannot load module
> > > `/usr/lib/vlc/plugins/codec/libavcodec_plugin.so' ((null)
> > >
> > > Any idea about this?
> > >
> > > Best Regards.
> > > IMAN.
> >
> >

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] Failed to load libmmal.so from rpi-userland package via buildroot toolchain on raspberry pi 4
  2020-03-28 14:28     ` Peter Seiderer
@ 2020-03-28 17:04       ` daggs
  2020-03-28 18:56         ` Peter Seiderer
  0 siblings, 1 reply; 10+ messages in thread
From: daggs @ 2020-03-28 17:04 UTC (permalink / raw)
  To: buildroot

Greetings Peter,

> Sent: Saturday, March 28, 2020 at 5:28 PM
> From: "Peter Seiderer" <ps.report@gmx.net>
> To: daggs <daggs@gmx.com>
> Cc: buildroot at busybox.net, "iman ahmadvand" <iman72411@gmail.com>
> Subject: Re: [Buildroot] Failed to load libmmal.so from rpi-userland package via buildroot toolchain on raspberry pi 4
>
> Hello Dagg,
>
> On Sat, 28 Mar 2020 12:05:38 +0100, daggs <daggs@gmx.com> wrote:
>
> > Greetings,
> >
> > > Sent: Saturday, March 28, 2020 at 1:31 PM
> > > From: "Peter Seiderer" <ps.report@gmx.net>
> > > To: "iman ahmadvand" <iman72411@gmail.com>
> > > Cc: buildroot at busybox.net
> > > Subject: Re: [Buildroot] Failed to load libmmal.so from rpi-userland package via buildroot toolchain on raspberry pi 4
> > >
> > > Hello Iman,
> > >
> > > On Sat, 28 Mar 2020 11:39:46 +0430, iman ahmadvand <iman72411@gmail.com> wrote:
> > >
> > > > Hi everyone.
> > > > It seems that loading the MMAL interface shared libraries from rpi-userland
> > > > package via simple dlopen is not possible, or more specific, the packages
> > > > or binaries such as VLC or VLC codec plugin (libavcodec_plugin) could not
> > > > load the libavcodec from FFmpeg which in turn depends on libmmal*.so
> > > >
> > > > The steps to reproduce(with BR2_PACKAGE_RPI_USERLAND enabled,
> > > > BR2_STRIP_strip disabled, BR2_OPTIMIZE_0 enabled):
> > > > git clone git://git.busybox.net/buildroot buildroot && cd buildroot && git
> > > > checkout 2019.11.01
> > > > make raspberrypi4_defconfig && make all
> > > >
> > > > Then in this image try to run a simple c routine with dlopen(), if you do
> > > > so, for example, ./dltest /usr/lib/libmmal.so you will end up with:
> > > >
> > > > symbol 'mmal_port_payload_alloc': can't resolve symbol
> > > > symbol 'mmal_port_payload_free': can't resolve symbol
> > > > symbol 'mmal_port_log_category': can't resolve symbol
> > > >
> > >
> > > Can confirm your failure...did not (yet) find out what fails exactly, but
> > > ldd produces the following ouput (mind the 0x00000000):
> > >
> > > 	$ ldd /usr/lib/libmmal.so
> > > checking sub-depends for '/usr/lib/libmmal_vc_client.so'
> > > checking sub-depends for '/usr/lib/libmmal_components.so'
> > > checking sub-depends for '/usr/lib/libvchiq_arm.so'
> > > checking sub-depends for '/usr/lib/libvcsm.so'
> > > checking sub-depends for '/usr/lib/libmmal_core.so'
> > > checking sub-depends for '/usr/lib/libmmal_util.so'
> > > checking sub-depends for '/usr/lib/libcontainers.so'
> > > checking sub-depends for '/usr/lib/libvcos.so'
> > > checking sub-depends for '/lib/libc.so.0'
> > >         ld-uClibc.so.1 => /lib/ld-uClibc.so.1 (0xb6f8b000)
> > >         libmmal_vc_client.so => /usr/lib/libmmal_vc_client.so (0x00000000)
> > >         libmmal_components.so => /usr/lib/libmmal_components.so (0x00000000)
> > >         libvchiq_arm.so => /usr/lib/libvchiq_arm.so (0x00000000)
> > >         libvcsm.so => /usr/lib/libvcsm.so (0x00000000)
> > >         libmmal_core.so => /usr/lib/libmmal_core.so (0x00000000)
> > >         libmmal_util.so => /usr/lib/libmmal_util.so (0x00000000)
> > >         libcontainers.so => /usr/lib/libcontainers.so (0x00000000)
> > >         libvcos.so => /usr/lib/libvcos.so (0x00000000)
> > >         libc.so.0 => /lib/libc.so.0 (0x00000000)
> > >         /lib/ld-uClibc.so.1 => /lib/ld-uClibc.so.1 (0x00000000)
> > >
> > >
> > > After changing the buildroot toolchain from uclibc to glibc (and a full
> > > re-build) dlopen() of /usr/lib/libmmal.so works and ldd produces the
> > > following output:
> > >
> > > 	$ ldd /usr/lib/libmmal.so
> > > 	linux-vdso.so.1 (0xbea59000)
> > > 	libmmal_vc_client.so => /usr/lib/libmmal_vc_client.so (0xb6f5f000)
> > > 	libmmal_components.so => /usr/lib/libmmal_components.so (0xb6f44000)
> > > 	libvchiq_arm.so => /usr/lib/libvchiq_arm.so (0xb6f2e000)
> > > 	libvcsm.so => /usr/lib/libvcsm.so (0xb6f14000)
> > > 	libmmal_core.so => /usr/lib/libmmal_core.so (0xb6ef6000)
> > > 	libmmal_util.so => /usr/lib/libmmal_util.so (0xb6ed8000)
> > > 	libcontainers.so => /usr/lib/libcontainers.so (0xb6eb5000)
> > > 	libvcos.so => /usr/lib/libvcos.so (0xb6e9c000)
> > > 	libpthread.so.0 => /lib/libpthread.so.0 (0xb6e71000)
> > > 	libdl.so.2 => /lib/libdl.so.2 (0xb6e5e000)
> > > 	librt.so.1 => /lib/librt.so.1 (0xb6e47000)
> > > 	libc.so.6 => /lib/libc.so.6 (0xb6cfb000)
> > > 	/lib/ld-linux-armhf.so.3 (0xb6f8f000)
> > >
> > > Regards,
> > > Peter
> > >
> > >
> > > > Or for another proof of the issue, you can run VLC with X11 to play an
> > > > MPEG-4 video, and you will  end up with VLC could not load the codec module
> > > > because of the same thing:
> > > >
> > > > main debug: loading plugins cache file /usr/lib/vlc/plugins/plugins.dat
> > > > main warning: cannot read /usr/lib/vlc/plugins/plugins.dat: No such
> > > > file or directory
> > > > main debug: recursively browsing `/usr/lib/vlc/plugins'
> > > > main warning: cannot load module
> > > > `/usr/lib/vlc/plugins/codec/libavcodec_plugin.so' ((null)
> > > >
> > > > Any idea about this?
> > > >
> > > > Best Regards.
> > > > IMAN.
> >
> > I wonder, how do you run ldd on the pi4 with the buildroot env? I'm trying to debug my mmal issue too.
>
> Exactly with the command line as given above 'ldd /usr/lib/libmmal.so' on the
> target (here pi4), what do your mean with buildroot env (do not mix 'ldd -
> print shared object dependencies' with 'ld - The GNU linker')?
>
> Regards,
> Peter
>

here is what I get:
<root@TvHeadend_Server: /home/igor> ldd /usr/lib/libmmal.so
bash: ldd: command not found
<root@TvHeadend_Server: /home/igor> cat /etc/os-release
NAME=Buildroot
VERSION=2020.02-rc2-00018-g16d3e1734e-dirty
ID=buildroot
VERSION_ID=2020.02-rc2
PRETTY_NAME="Buildroot 2020.02-rc2"
<root@TvHeadend_Server: /home/igor> uname  -a
Linux TvHeadend_Server 4.19.97-v8 #1 SMP PREEMPT Fri Feb 28 15:16:43 IST 2020 aarch64 GNU/Linux
<root@TvHeadend_Server: /home/igor> ls -l /usr/lib/libmmal*
-rwxr-xr-x    1 root     root         14192 Feb 28 15:21 /usr/lib/libmmal.so
-rwxr-xr-x    1 root     root         51576 Feb 28 15:21 /usr/lib/libmmal_components.so
-rwxr-xr-x    1 root     root         72344 Feb 28 15:21 /usr/lib/libmmal_core.so
-rwxr-xr-x    1 root     root         72320 Feb 28 15:21 /usr/lib/libmmal_util.so
-rwxr-xr-x    1 root     root         43520 Feb 28 15:21 /usr/lib/libmmal_vc_client.so

looks like I'm missing something...

Thanks,

Dagg.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] Failed to load libmmal.so from rpi-userland package via buildroot toolchain on raspberry pi 4
  2020-03-28 17:04       ` daggs
@ 2020-03-28 18:56         ` Peter Seiderer
  2020-03-28 21:26           ` Peter Seiderer
  0 siblings, 1 reply; 10+ messages in thread
From: Peter Seiderer @ 2020-03-28 18:56 UTC (permalink / raw)
  To: buildroot

Hello Dagg,

On Sat, 28 Mar 2020 18:04:18 +0100, daggs <daggs@gmx.com> wrote:

> Greetings Peter,
>
> > Sent: Saturday, March 28, 2020 at 5:28 PM
> > From: "Peter Seiderer" <ps.report@gmx.net>
> > To: daggs <daggs@gmx.com>
> > Cc: buildroot at busybox.net, "iman ahmadvand" <iman72411@gmail.com>
> > Subject: Re: [Buildroot] Failed to load libmmal.so from rpi-userland package via buildroot toolchain on raspberry pi 4
> >
> > Hello Dagg,
> >
> > On Sat, 28 Mar 2020 12:05:38 +0100, daggs <daggs@gmx.com> wrote:
> >
> > > Greetings,
> > >
> > > > Sent: Saturday, March 28, 2020 at 1:31 PM
> > > > From: "Peter Seiderer" <ps.report@gmx.net>
> > > > To: "iman ahmadvand" <iman72411@gmail.com>
> > > > Cc: buildroot at busybox.net
> > > > Subject: Re: [Buildroot] Failed to load libmmal.so from rpi-userland package via buildroot toolchain on raspberry pi 4
> > > >
> > > > Hello Iman,
> > > >
> > > > On Sat, 28 Mar 2020 11:39:46 +0430, iman ahmadvand <iman72411@gmail.com> wrote:
> > > >
> > > > > Hi everyone.
> > > > > It seems that loading the MMAL interface shared libraries from rpi-userland
> > > > > package via simple dlopen is not possible, or more specific, the packages
> > > > > or binaries such as VLC or VLC codec plugin (libavcodec_plugin) could not
> > > > > load the libavcodec from FFmpeg which in turn depends on libmmal*.so
> > > > >
> > > > > The steps to reproduce(with BR2_PACKAGE_RPI_USERLAND enabled,
> > > > > BR2_STRIP_strip disabled, BR2_OPTIMIZE_0 enabled):
> > > > > git clone git://git.busybox.net/buildroot buildroot && cd buildroot && git
> > > > > checkout 2019.11.01
> > > > > make raspberrypi4_defconfig && make all
> > > > >
> > > > > Then in this image try to run a simple c routine with dlopen(), if you do
> > > > > so, for example, ./dltest /usr/lib/libmmal.so you will end up with:
> > > > >
> > > > > symbol 'mmal_port_payload_alloc': can't resolve symbol
> > > > > symbol 'mmal_port_payload_free': can't resolve symbol
> > > > > symbol 'mmal_port_log_category': can't resolve symbol
> > > > >
> > > >
> > > > Can confirm your failure...did not (yet) find out what fails exactly, but
> > > > ldd produces the following ouput (mind the 0x00000000):
> > > >
> > > > 	$ ldd /usr/lib/libmmal.so
> > > > checking sub-depends for '/usr/lib/libmmal_vc_client.so'
> > > > checking sub-depends for '/usr/lib/libmmal_components.so'
> > > > checking sub-depends for '/usr/lib/libvchiq_arm.so'
> > > > checking sub-depends for '/usr/lib/libvcsm.so'
> > > > checking sub-depends for '/usr/lib/libmmal_core.so'
> > > > checking sub-depends for '/usr/lib/libmmal_util.so'
> > > > checking sub-depends for '/usr/lib/libcontainers.so'
> > > > checking sub-depends for '/usr/lib/libvcos.so'
> > > > checking sub-depends for '/lib/libc.so.0'
> > > >         ld-uClibc.so.1 => /lib/ld-uClibc.so.1 (0xb6f8b000)
> > > >         libmmal_vc_client.so => /usr/lib/libmmal_vc_client.so (0x00000000)
> > > >         libmmal_components.so => /usr/lib/libmmal_components.so (0x00000000)
> > > >         libvchiq_arm.so => /usr/lib/libvchiq_arm.so (0x00000000)
> > > >         libvcsm.so => /usr/lib/libvcsm.so (0x00000000)
> > > >         libmmal_core.so => /usr/lib/libmmal_core.so (0x00000000)
> > > >         libmmal_util.so => /usr/lib/libmmal_util.so (0x00000000)
> > > >         libcontainers.so => /usr/lib/libcontainers.so (0x00000000)
> > > >         libvcos.so => /usr/lib/libvcos.so (0x00000000)
> > > >         libc.so.0 => /lib/libc.so.0 (0x00000000)
> > > >         /lib/ld-uClibc.so.1 => /lib/ld-uClibc.so.1 (0x00000000)
> > > >
> > > >
> > > > After changing the buildroot toolchain from uclibc to glibc (and a full
> > > > re-build) dlopen() of /usr/lib/libmmal.so works and ldd produces the
> > > > following output:
> > > >
> > > > 	$ ldd /usr/lib/libmmal.so
> > > > 	linux-vdso.so.1 (0xbea59000)
> > > > 	libmmal_vc_client.so => /usr/lib/libmmal_vc_client.so (0xb6f5f000)
> > > > 	libmmal_components.so => /usr/lib/libmmal_components.so (0xb6f44000)
> > > > 	libvchiq_arm.so => /usr/lib/libvchiq_arm.so (0xb6f2e000)
> > > > 	libvcsm.so => /usr/lib/libvcsm.so (0xb6f14000)
> > > > 	libmmal_core.so => /usr/lib/libmmal_core.so (0xb6ef6000)
> > > > 	libmmal_util.so => /usr/lib/libmmal_util.so (0xb6ed8000)
> > > > 	libcontainers.so => /usr/lib/libcontainers.so (0xb6eb5000)
> > > > 	libvcos.so => /usr/lib/libvcos.so (0xb6e9c000)
> > > > 	libpthread.so.0 => /lib/libpthread.so.0 (0xb6e71000)
> > > > 	libdl.so.2 => /lib/libdl.so.2 (0xb6e5e000)
> > > > 	librt.so.1 => /lib/librt.so.1 (0xb6e47000)
> > > > 	libc.so.6 => /lib/libc.so.6 (0xb6cfb000)
> > > > 	/lib/ld-linux-armhf.so.3 (0xb6f8f000)
> > > >
> > > > Regards,
> > > > Peter
> > > >
> > > >
> > > > > Or for another proof of the issue, you can run VLC with X11 to play an
> > > > > MPEG-4 video, and you will  end up with VLC could not load the codec module
> > > > > because of the same thing:
> > > > >
> > > > > main debug: loading plugins cache file /usr/lib/vlc/plugins/plugins.dat
> > > > > main warning: cannot read /usr/lib/vlc/plugins/plugins.dat: No such
> > > > > file or directory
> > > > > main debug: recursively browsing `/usr/lib/vlc/plugins'
> > > > > main warning: cannot load module
> > > > > `/usr/lib/vlc/plugins/codec/libavcodec_plugin.so' ((null)
> > > > >
> > > > > Any idea about this?
> > > > >
> > > > > Best Regards.
> > > > > IMAN.
> > >
> > > I wonder, how do you run ldd on the pi4 with the buildroot env? I'm trying to debug my mmal issue too.
> >
> > Exactly with the command line as given above 'ldd /usr/lib/libmmal.so' on the
> > target (here pi4), what do your mean with buildroot env (do not mix 'ldd -
> > print shared object dependencies' with 'ld - The GNU linker')?
> >
> > Regards,
> > Peter
> >
>
> here is what I get:
> <root@TvHeadend_Server: /home/igor> ldd /usr/lib/libmmal.so
> bash: ldd: command not found
> <root@TvHeadend_Server: /home/igor> cat /etc/os-release
> NAME=Buildroot
> VERSION=2020.02-rc2-00018-g16d3e1734e-dirty
> ID=buildroot
> VERSION_ID=2020.02-rc2
> PRETTY_NAME="Buildroot 2020.02-rc2"
> <root@TvHeadend_Server: /home/igor> uname  -a
> Linux TvHeadend_Server 4.19.97-v8 #1 SMP PREEMPT Fri Feb 28 15:16:43 IST 2020 aarch64 GNU/Linux
> <root@TvHeadend_Server: /home/igor> ls -l /usr/lib/libmmal*
> -rwxr-xr-x    1 root     root         14192 Feb 28 15:21 /usr/lib/libmmal.so
> -rwxr-xr-x    1 root     root         51576 Feb 28 15:21 /usr/lib/libmmal_components.so
> -rwxr-xr-x    1 root     root         72344 Feb 28 15:21 /usr/lib/libmmal_core.so
> -rwxr-xr-x    1 root     root         72320 Feb 28 15:21 /usr/lib/libmmal_util.so
> -rwxr-xr-x    1 root     root         43520 Feb 28 15:21 /usr/lib/libmmal_vc_client.so
>
> looks like I'm missing something...

Then your are using for sure something different than a plain raspberrypi4_defconfig
with BR2_PACKAGE_RPI_USERLAND enabled (or there is a differnce between
2020.02-rc2 (used by your, why rc2?) and git master (used by me)....

When in doubt provide your .config (or defconfig) file...

Regards,
Peter

>
> Thanks,
>
> Dagg.
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] Failed to load libmmal.so from rpi-userland package via buildroot toolchain on raspberry pi 4
  2020-03-28 18:56         ` Peter Seiderer
@ 2020-03-28 21:26           ` Peter Seiderer
  0 siblings, 0 replies; 10+ messages in thread
From: Peter Seiderer @ 2020-03-28 21:26 UTC (permalink / raw)
  To: buildroot

Hello Dagg,

On Sat, 28 Mar 2020 19:56:50 +0100, Peter Seiderer <ps.report@gmx.net> wrote:

> Hello Dagg,
>
> On Sat, 28 Mar 2020 18:04:18 +0100, daggs <daggs@gmx.com> wrote:
>
> > Greetings Peter,
> >
> > > Sent: Saturday, March 28, 2020 at 5:28 PM
> > > From: "Peter Seiderer" <ps.report@gmx.net>
> > > To: daggs <daggs@gmx.com>
> > > Cc: buildroot at busybox.net, "iman ahmadvand" <iman72411@gmail.com>
> > > Subject: Re: [Buildroot] Failed to load libmmal.so from rpi-userland package via buildroot toolchain on raspberry pi 4
> > >
> > > Hello Dagg,
> > >
> > > On Sat, 28 Mar 2020 12:05:38 +0100, daggs <daggs@gmx.com> wrote:
> > >
> > > > Greetings,
> > > >
> > > > > Sent: Saturday, March 28, 2020 at 1:31 PM
> > > > > From: "Peter Seiderer" <ps.report@gmx.net>
> > > > > To: "iman ahmadvand" <iman72411@gmail.com>
> > > > > Cc: buildroot at busybox.net
> > > > > Subject: Re: [Buildroot] Failed to load libmmal.so from rpi-userland package via buildroot toolchain on raspberry pi 4
> > > > >
> > > > > Hello Iman,
> > > > >
> > > > > On Sat, 28 Mar 2020 11:39:46 +0430, iman ahmadvand <iman72411@gmail.com> wrote:
> > > > >
> > > > > > Hi everyone.
> > > > > > It seems that loading the MMAL interface shared libraries from rpi-userland
> > > > > > package via simple dlopen is not possible, or more specific, the packages
> > > > > > or binaries such as VLC or VLC codec plugin (libavcodec_plugin) could not
> > > > > > load the libavcodec from FFmpeg which in turn depends on libmmal*.so
> > > > > >
> > > > > > The steps to reproduce(with BR2_PACKAGE_RPI_USERLAND enabled,
> > > > > > BR2_STRIP_strip disabled, BR2_OPTIMIZE_0 enabled):
> > > > > > git clone git://git.busybox.net/buildroot buildroot && cd buildroot && git
> > > > > > checkout 2019.11.01
> > > > > > make raspberrypi4_defconfig && make all
> > > > > >
> > > > > > Then in this image try to run a simple c routine with dlopen(), if you do
> > > > > > so, for example, ./dltest /usr/lib/libmmal.so you will end up with:
> > > > > >
> > > > > > symbol 'mmal_port_payload_alloc': can't resolve symbol
> > > > > > symbol 'mmal_port_payload_free': can't resolve symbol
> > > > > > symbol 'mmal_port_log_category': can't resolve symbol
> > > > > >
> > > > >
> > > > > Can confirm your failure...did not (yet) find out what fails exactly, but
> > > > > ldd produces the following ouput (mind the 0x00000000):
> > > > >
> > > > > 	$ ldd /usr/lib/libmmal.so
> > > > > checking sub-depends for '/usr/lib/libmmal_vc_client.so'
> > > > > checking sub-depends for '/usr/lib/libmmal_components.so'
> > > > > checking sub-depends for '/usr/lib/libvchiq_arm.so'
> > > > > checking sub-depends for '/usr/lib/libvcsm.so'
> > > > > checking sub-depends for '/usr/lib/libmmal_core.so'
> > > > > checking sub-depends for '/usr/lib/libmmal_util.so'
> > > > > checking sub-depends for '/usr/lib/libcontainers.so'
> > > > > checking sub-depends for '/usr/lib/libvcos.so'
> > > > > checking sub-depends for '/lib/libc.so.0'
> > > > >         ld-uClibc.so.1 => /lib/ld-uClibc.so.1 (0xb6f8b000)
> > > > >         libmmal_vc_client.so => /usr/lib/libmmal_vc_client.so (0x00000000)
> > > > >         libmmal_components.so => /usr/lib/libmmal_components.so (0x00000000)
> > > > >         libvchiq_arm.so => /usr/lib/libvchiq_arm.so (0x00000000)
> > > > >         libvcsm.so => /usr/lib/libvcsm.so (0x00000000)
> > > > >         libmmal_core.so => /usr/lib/libmmal_core.so (0x00000000)
> > > > >         libmmal_util.so => /usr/lib/libmmal_util.so (0x00000000)
> > > > >         libcontainers.so => /usr/lib/libcontainers.so (0x00000000)
> > > > >         libvcos.so => /usr/lib/libvcos.so (0x00000000)
> > > > >         libc.so.0 => /lib/libc.so.0 (0x00000000)
> > > > >         /lib/ld-uClibc.so.1 => /lib/ld-uClibc.so.1 (0x00000000)
> > > > >
> > > > >
> > > > > After changing the buildroot toolchain from uclibc to glibc (and a full
> > > > > re-build) dlopen() of /usr/lib/libmmal.so works and ldd produces the
> > > > > following output:
> > > > >
> > > > > 	$ ldd /usr/lib/libmmal.so
> > > > > 	linux-vdso.so.1 (0xbea59000)
> > > > > 	libmmal_vc_client.so => /usr/lib/libmmal_vc_client.so (0xb6f5f000)
> > > > > 	libmmal_components.so => /usr/lib/libmmal_components.so (0xb6f44000)
> > > > > 	libvchiq_arm.so => /usr/lib/libvchiq_arm.so (0xb6f2e000)
> > > > > 	libvcsm.so => /usr/lib/libvcsm.so (0xb6f14000)
> > > > > 	libmmal_core.so => /usr/lib/libmmal_core.so (0xb6ef6000)
> > > > > 	libmmal_util.so => /usr/lib/libmmal_util.so (0xb6ed8000)
> > > > > 	libcontainers.so => /usr/lib/libcontainers.so (0xb6eb5000)
> > > > > 	libvcos.so => /usr/lib/libvcos.so (0xb6e9c000)
> > > > > 	libpthread.so.0 => /lib/libpthread.so.0 (0xb6e71000)
> > > > > 	libdl.so.2 => /lib/libdl.so.2 (0xb6e5e000)
> > > > > 	librt.so.1 => /lib/librt.so.1 (0xb6e47000)
> > > > > 	libc.so.6 => /lib/libc.so.6 (0xb6cfb000)
> > > > > 	/lib/ld-linux-armhf.so.3 (0xb6f8f000)
> > > > >
> > > > > Regards,
> > > > > Peter
> > > > >
> > > > >
> > > > > > Or for another proof of the issue, you can run VLC with X11 to play an
> > > > > > MPEG-4 video, and you will  end up with VLC could not load the codec module
> > > > > > because of the same thing:
> > > > > >
> > > > > > main debug: loading plugins cache file /usr/lib/vlc/plugins/plugins.dat
> > > > > > main warning: cannot read /usr/lib/vlc/plugins/plugins.dat: No such
> > > > > > file or directory
> > > > > > main debug: recursively browsing `/usr/lib/vlc/plugins'
> > > > > > main warning: cannot load module
> > > > > > `/usr/lib/vlc/plugins/codec/libavcodec_plugin.so' ((null)
> > > > > >
> > > > > > Any idea about this?
> > > > > >
> > > > > > Best Regards.
> > > > > > IMAN.
> > > >
> > > > I wonder, how do you run ldd on the pi4 with the buildroot env? I'm trying to debug my mmal issue too.
> > >
> > > Exactly with the command line as given above 'ldd /usr/lib/libmmal.so' on the
> > > target (here pi4), what do your mean with buildroot env (do not mix 'ldd -
> > > print shared object dependencies' with 'ld - The GNU linker')?
> > >
> > > Regards,
> > > Peter
> > >
> >
> > here is what I get:
> > <root@TvHeadend_Server: /home/igor> ldd /usr/lib/libmmal.so
> > bash: ldd: command not found
> > <root@TvHeadend_Server: /home/igor> cat /etc/os-release
> > NAME=Buildroot
> > VERSION=2020.02-rc2-00018-g16d3e1734e-dirty
> > ID=buildroot
> > VERSION_ID=2020.02-rc2
> > PRETTY_NAME="Buildroot 2020.02-rc2"
> > <root@TvHeadend_Server: /home/igor> uname  -a
> > Linux TvHeadend_Server 4.19.97-v8 #1 SMP PREEMPT Fri Feb 28 15:16:43 IST 2020 aarch64 GNU/Linux
> > <root@TvHeadend_Server: /home/igor> ls -l /usr/lib/libmmal*
> > -rwxr-xr-x    1 root     root         14192 Feb 28 15:21 /usr/lib/libmmal.so
> > -rwxr-xr-x    1 root     root         51576 Feb 28 15:21 /usr/lib/libmmal_components.so
> > -rwxr-xr-x    1 root     root         72344 Feb 28 15:21 /usr/lib/libmmal_core.so
> > -rwxr-xr-x    1 root     root         72320 Feb 28 15:21 /usr/lib/libmmal_util.so
> > -rwxr-xr-x    1 root     root         43520 Feb 28 15:21 /usr/lib/libmmal_vc_client.so
> >
> > looks like I'm missing something...
>
> Then your are using for sure something different than a plain raspberrypi4_defconfig
> with BR2_PACKAGE_RPI_USERLAND enabled (or there is a differnce between
> 2020.02-rc2 (used by your, why rc2?) and git master (used by me)....
>
> When in doubt provide your .config (or defconfig) file...

And for glibc you need to enable BR2_PACKAGE_GLIBC_UTILS=y to gain
the ldd command on the target...

Regards,
Peter

>
> Regards,
> Peter
>
> >
> > Thanks,
> >
> > Dagg.
> > _______________________________________________
> > buildroot mailing list
> > buildroot at busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] Failed to load libmmal.so from rpi-userland package via buildroot toolchain on raspberry pi 4
  2020-03-28 14:34     ` Peter Seiderer
@ 2020-04-07 13:14       ` iman ahmadvand
  0 siblings, 0 replies; 10+ messages in thread
From: iman ahmadvand @ 2020-04-07 13:14 UTC (permalink / raw)
  To: buildroot

Hi, peter.

Sorry for the outdated reply!
I just mean both cases, dlopeb() and ldd examine on libmmal.so succeed by
changing to glibc (and also VLC codec plugin) as you suggested.
But don't know what happens with uclibc! which break rpi-userland MMAL
components register

Regards.
Iman.

On Sat, Mar 28, 2020 at 7:04 PM Peter Seiderer <ps.report@gmx.net> wrote:

> Hello Iman,
>
> On Sat, 28 Mar 2020 17:14:59 +0430, iman ahmadvand <iman72411@gmail.com>
> wrote:
>
> > Hi Peter.
> >
> > Exact same situation for me when changing to glibc or using external
> linaro
> > toolchain(which comes with glibc).
>
> What do you mean by 'exact same situation', the simple dlopen() test, or
> the
> complete VLC test? Did you do a *complete* re-build and complete
> installation?
> Can you show the output from 'ldd /usr/lib/libmmal.so'?
>
> Regards,
> Peter
>
> > Don't know what's going on.
> > Interesting thread: https://github.com/raspberrypi/userland/issues/178
> >
> > Regards.
> > IMAN.
> >
> > On Sat, Mar 28, 2020 at 3:01 PM Peter Seiderer <ps.report@gmx.net>
> wrote:
> >
> > > Hello Iman,
> > >
> > > On Sat, 28 Mar 2020 11:39:46 +0430, iman ahmadvand <
> iman72411 at gmail.com>
> > > wrote:
> > >
> > > > Hi everyone.
> > > > It seems that loading the MMAL interface shared libraries from
> > > rpi-userland
> > > > package via simple dlopen is not possible, or more specific, the
> packages
> > > > or binaries such as VLC or VLC codec plugin (libavcodec_plugin)
> could not
> > > > load the libavcodec from FFmpeg which in turn depends on libmmal*.so
> > > >
> > > > The steps to reproduce(with BR2_PACKAGE_RPI_USERLAND enabled,
> > > > BR2_STRIP_strip disabled, BR2_OPTIMIZE_0 enabled):
> > > > git clone git://git.busybox.net/buildroot buildroot && cd buildroot
> &&
> > > git
> > > > checkout 2019.11.01
> > > > make raspberrypi4_defconfig && make all
> > > >
> > > > Then in this image try to run a simple c routine with dlopen(), if
> you do
> > > > so, for example, ./dltest /usr/lib/libmmal.so you will end up with:
> > > >
> > > > symbol 'mmal_port_payload_alloc': can't resolve symbol
> > > > symbol 'mmal_port_payload_free': can't resolve symbol
> > > > symbol 'mmal_port_log_category': can't resolve symbol
> > > >
> > >
> > > Can confirm your failure...did not (yet) find out what fails exactly,
> but
> > > ldd produces the following ouput (mind the 0x00000000):
> > >
> > >         $ ldd /usr/lib/libmmal.so
> > > checking sub-depends for '/usr/lib/libmmal_vc_client.so'
> > > checking sub-depends for '/usr/lib/libmmal_components.so'
> > > checking sub-depends for '/usr/lib/libvchiq_arm.so'
> > > checking sub-depends for '/usr/lib/libvcsm.so'
> > > checking sub-depends for '/usr/lib/libmmal_core.so'
> > > checking sub-depends for '/usr/lib/libmmal_util.so'
> > > checking sub-depends for '/usr/lib/libcontainers.so'
> > > checking sub-depends for '/usr/lib/libvcos.so'
> > > checking sub-depends for '/lib/libc.so.0'
> > >         ld-uClibc.so.1 => /lib/ld-uClibc.so.1 (0xb6f8b000)
> > >         libmmal_vc_client.so => /usr/lib/libmmal_vc_client.so
> (0x00000000)
> > >         libmmal_components.so => /usr/lib/libmmal_components.so
> > > (0x00000000)
> > >         libvchiq_arm.so => /usr/lib/libvchiq_arm.so (0x00000000)
> > >         libvcsm.so => /usr/lib/libvcsm.so (0x00000000)
> > >         libmmal_core.so => /usr/lib/libmmal_core.so (0x00000000)
> > >         libmmal_util.so => /usr/lib/libmmal_util.so (0x00000000)
> > >         libcontainers.so => /usr/lib/libcontainers.so (0x00000000)
> > >         libvcos.so => /usr/lib/libvcos.so (0x00000000)
> > >         libc.so.0 => /lib/libc.so.0 (0x00000000)
> > >         /lib/ld-uClibc.so.1 => /lib/ld-uClibc.so.1 (0x00000000)
> > >
> > >
> > > After changing the buildroot toolchain from uclibc to glibc (and a full
> > > re-build) dlopen() of /usr/lib/libmmal.so works and ldd produces the
> > > following output:
> > >
> > >         $ ldd /usr/lib/libmmal.so
> > >         linux-vdso.so.1 (0xbea59000)
> > >         libmmal_vc_client.so => /usr/lib/libmmal_vc_client.so
> (0xb6f5f000)
> > >         libmmal_components.so => /usr/lib/libmmal_components.so
> > > (0xb6f44000)
> > >         libvchiq_arm.so => /usr/lib/libvchiq_arm.so (0xb6f2e000)
> > >         libvcsm.so => /usr/lib/libvcsm.so (0xb6f14000)
> > >         libmmal_core.so => /usr/lib/libmmal_core.so (0xb6ef6000)
> > >         libmmal_util.so => /usr/lib/libmmal_util.so (0xb6ed8000)
> > >         libcontainers.so => /usr/lib/libcontainers.so (0xb6eb5000)
> > >         libvcos.so => /usr/lib/libvcos.so (0xb6e9c000)
> > >         libpthread.so.0 => /lib/libpthread.so.0 (0xb6e71000)
> > >         libdl.so.2 => /lib/libdl.so.2 (0xb6e5e000)
> > >         librt.so.1 => /lib/librt.so.1 (0xb6e47000)
> > >         libc.so.6 => /lib/libc.so.6 (0xb6cfb000)
> > >         /lib/ld-linux-armhf.so.3 (0xb6f8f000)
> > >
> > > Regards,
> > > Peter
> > >
> > >
> > > > Or for another proof of the issue, you can run VLC with X11 to play
> an
> > > > MPEG-4 video, and you will  end up with VLC could not load the codec
> > > module
> > > > because of the same thing:
> > > >
> > > > main debug: loading plugins cache file
> /usr/lib/vlc/plugins/plugins.dat
> > > > main warning: cannot read /usr/lib/vlc/plugins/plugins.dat: No such
> > > > file or directory
> > > > main debug: recursively browsing `/usr/lib/vlc/plugins'
> > > > main warning: cannot load module
> > > > `/usr/lib/vlc/plugins/codec/libavcodec_plugin.so' ((null)
> > > >
> > > > Any idea about this?
> > > >
> > > > Best Regards.
> > > > IMAN.
> > >
> > >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20200407/1521159f/attachment.html>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-04-07 13:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-28  7:09 [Buildroot] Failed to load libmmal.so from rpi-userland package via buildroot toolchain on raspberry pi 4 iman ahmadvand
2020-03-28 10:31 ` Peter Seiderer
2020-03-28 11:05   ` daggs
2020-03-28 14:28     ` Peter Seiderer
2020-03-28 17:04       ` daggs
2020-03-28 18:56         ` Peter Seiderer
2020-03-28 21:26           ` Peter Seiderer
2020-03-28 12:44   ` iman ahmadvand
2020-03-28 14:34     ` Peter Seiderer
2020-04-07 13:14       ` iman ahmadvand

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.