Skip to contentSkip to conversation

Update i.MX multimedia packages

PATCH New Gary Bisson 2 participants 11 messages Jul 27, 2016 – Aug 3, 2016 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

cover Update i.MX multimedia packages

Hi all,

This series is long overdue since it is the answer for that request:
http://patchwork.ozlabs.org/patch/409684/

Basically NXP imx-codec and imx-parser are copying their libraries to /usr/lib/imx-mm/. But Buildroot only looks for libraries under /usr/lib at runtime which causes some GStreamer plugins to fail at runtime.

Previous attempts to solve this issue were discarded since it was using symlink in both staging and target areas to cover all the cases.

The gst-fsl-plugin links against the libraries whereas gst1-imx only does that for one plugin and uses dlopen for another.

Debugging that issue it appeared that gst1-imx wasn't looking at the right place at build-time so linking wasn't possible. Then it also appeared that gst1-imx would use dlopen at runtime with the path being the one on the build machine.

Those issues have been resolved with Carlos Rafael Giani, creator and maintainer of the gst1-imx plugin. That is why this series includes the gst1-imx version bump necessary to have everything working properly.

As for imx-codec/parser, their libraries are now copied to /usr/lib using a post install target hook just like it is done in the Yocto recipes.

Regards,
Gary

Gary Bisson (5):
imx-codec: add install hooks to fix libraries path
imx-codec: add missing configure options
imx-parser: add install hooks to fix libraries path
imx-parser: add missing configure options
gst1-imx: bump to version 0.12.2

 package/freescale-imx/imx-codec/imx-codec.mk   | 15 +++++++++++++++
 package/freescale-imx/imx-parser/imx-parser.mk | 13 +++++++++++++
 package/gstreamer1/gst1-imx/gst1-imx.hash      |  2 +-
 package/gstreamer1/gst1-imx/gst1-imx.mk        |  2 +-
 4 files changed, 30 insertions(+), 2 deletions(-)
Signature · 1 line
2.8.1
#1 lore raw

PATCH 1/5 imx-codec: add install hooks to fix libraries path

By default, all the libraries are installed under /usr/lib/imx-mm which causes problems at runtime.

The hooks are inspired from the mechanism used in the Yocto recipe:
https://github.com/Freescale/meta-fsl-arm/blob/krogoth/recipes-multimedia/imx-codec/imx-codec.inc

Tested with the following commands:

 # gst-launch-0.10 audiotestsrc ! mfw_mp3encoder ! fakesink
 # gst-launch-1.0 audiotestsrc ! imxmp3audioenc ! fakesink

---

Here is the list of plugins that couldn't find the codecs at runtime:

$ for i in `find target/usr/lib/gstreamer*/*.so`; do readelf -d $i \
  | grep NEEDED | grep lib_ && echo "($i)"; done
 0x00000001 (NEEDED) Shared library: [lib_nb_amr_dec_arm9_elinux.so.2]
 0x00000001 (NEEDED) Shared library: [lib_wb_amr_dec_arm9_elinux.so.2]
(target/usr/lib/gstreamer-0.10/libmfw_gst_amrdec.so)
 0x00000001 (NEEDED) Shared library: [lib_peq_arm11_elinux.so.1.fhw]
(target/usr/lib/gstreamer-0.10/libmfw_gst_audio_pp.so)
 0x00000001 (NEEDED) Shared library: [lib_mp3_enc_arm12_elinux.so.2]
(target/usr/lib/gstreamer-0.10/libmfw_gst_mp3enc.so)
 0x00000001 (NEEDED) Shared library: [lib_mp3_enc_arm12_elinux.so.2]
(target/usr/lib/gstreamer-1.0/libgstimxaudio.so)

Regards,
Gary

---
 package/freescale-imx/imx-codec/imx-codec.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/freescale-imx/imx-codec/imx-codec.mk +7 -0
index 67d3390..266f47f 100644
@@ -20,4 +20,11 @@ endef
 # FIXME The Makefile installs both the arm9 and arm11 versions of the
 # libraries, but we only need one of them.
 
+define IMX_CODEC_FIXUP_TARGET_PATH
+	find $(TARGET_DIR)/usr/lib/imx-mm -mindepth 2 -maxdepth 3 -not -type d \
+		-exec mv {} $(TARGET_DIR)/usr/lib \;
+	rm -fr $(TARGET_DIR)/usr/lib/imx-mm
+endef
+IMX_CODEC_POST_INSTALL_TARGET_HOOKS += IMX_CODEC_FIXUP_TARGET_PATH
+
 $(eval $(autotools-package))
Signature · 1 line
2.8.1
#2 lore raw

PATCH 1/5 imx-codec: add install hooks to fix libraries path

Quoted 40 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Gary" == Gary Bisson <[email protected]> writes:

By default, all the libraries are installed under /usr/lib/imx-mm which causes problems at runtime.

The hooks are inspired from the mechanism used in the Yocto recipe:
https://github.com/Freescale/meta-fsl-arm/blob/krogoth/recipes-multimedia/imx-codec/imx-codec.inc

Tested with the following commands:

 # gst-launch-0.10 audiotestsrc ! mfw_mp3encoder ! fakesink
 # gst-launch-1.0 audiotestsrc ! imxmp3audioenc ! fakesink

---

Here is the list of plugins that couldn't find the codecs at runtime:

$ for i in `find target/usr/lib/gstreamer*/*.so`; do readelf -d $i \
  | grep NEEDED | grep lib_ && echo "($i)"; done
 0x00000001 (NEEDED) Shared library: [lib_nb_amr_dec_arm9_elinux.so.2]
 0x00000001 (NEEDED) Shared library: [lib_wb_amr_dec_arm9_elinux.so.2]
(target/usr/lib/gstreamer-0.10/libmfw_gst_amrdec.so)
 0x00000001 (NEEDED) Shared library: [lib_peq_arm11_elinux.so.1.fhw]
(target/usr/lib/gstreamer-0.10/libmfw_gst_audio_pp.so)
 0x00000001 (NEEDED) Shared library: [lib_mp3_enc_arm12_elinux.so.2]
(target/usr/lib/gstreamer-0.10/libmfw_gst_mp3enc.so)
 0x00000001 (NEEDED) Shared library: [lib_mp3_enc_arm12_elinux.so.2]
(target/usr/lib/gstreamer-1.0/libgstimxaudio.so)

Regards,
Gary

---
 package/freescale-imx/imx-codec/imx-codec.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/freescale-imx/imx-codec/imx-codec.mk +0 -0
index 67d3390..266f47f 100644

package/freescale-imx/imx-codec/imx-codec.mk endef · line 21

Quoted 2 lines
package/freescale-imx/imx-codec/imx-codec.mk +0 -0
@@ -20,4 +20,11 @@ endef
 # FIXME The Makefile installs both the arm9 and arm11 versions of the
 # libraries, but we only need one of them.

A comment explaining why would have been nice.

package/freescale-imx/imx-codec/imx-codec.mk endef · line 25

Quoted 3 lines
package/freescale-imx/imx-codec/imx-codec.mk +3 -0
+define IMX_CODEC_FIXUP_TARGET_PATH
+	find $(TARGET_DIR)/usr/lib/imx-mm -mindepth 2 -maxdepth 3 -not -type d \
+		-exec mv {} $(TARGET_DIR)/usr/lib \;

I don't quite get why you need mindepth / maxdepth here, we just want to move all files to usr/lib.

usr/lib/imx-mm contains the following subdirs:

tree -d target/usr/lib/imx-mm
target/usr/lib/imx-mm
??? audio-codec
??? ??? wrap
??? video-codec

So I dropped those flags and committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 2/5 imx-codec: add missing configure options

In reply to Gary Bisson

Enable VPU and hard float support when the configuration contains:
BR2_ARM_EABIHF=y
BR2_PACKAGE_IMX_VPU=y

See Yocto equivalent:
https://github.com/Freescale/meta-fsl-arm/blob/krogoth/recipes-multimedia/imx-codec/imx-codec.inc

---

Thanks to those options:
- lib_jpeg_dec_arm11_elinux_novpu.so isn't copied
- lib_peq_arm11_elinux.so.1.fhw is copied instead of the fsw version

Regards,
Gary

---
 package/freescale-imx/imx-codec/imx-codec.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/freescale-imx/imx-codec/imx-codec.mk +8 -0
index 266f47f..c5c5626 100644
@@ -13,6 +13,14 @@ IMX_CODEC_LICENSE = NXP Semiconductor Software License Agreement, BSD-3c (flac,
 IMX_CODEC_LICENSE_FILES = EULA COPYING
 IMX_CODEC_REDISTRIBUTE = NO
 
+ifeq ($(BR2_ARM_EABIHF),y)
+IMX_CODEC_CONF_OPTS += --enable-fhw
+endif
+
+ifeq ($(BR2_PACKAGE_IMX_VPU),y)
+IMX_CODEC_CONF_OPTS += --enable-vpu
+endif
+
 define IMX_CODEC_EXTRACT_CMDS
 	$(call FREESCALE_IMX_EXTRACT_HELPER,$(DL_DIR)/$(IMX_CODEC_SOURCE))
 endef
Signature · 1 line
2.8.1
#4 lore raw

PATCH 2/5 imx-codec: add missing configure options

Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Gary" == Gary Bisson <[email protected]> writes:

Enable VPU and hard float support when the configuration contains:
BR2_ARM_EABIHF=y
BR2_PACKAGE_IMX_VPU=y

See Yocto equivalent:
https://github.com/Freescale/meta-fsl-arm/blob/krogoth/recipes-multimedia/imx-codec/imx-codec.inc

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#5 lore raw

PATCH 3/5 imx-parser: add install hooks to fix libraries path

In reply to Gary Bisson

By default, all the libraries are installed under /usr/lib/imx-mm which causes problems at runtime.

---
 package/freescale-imx/imx-parser/imx-parser.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/freescale-imx/imx-parser/imx-parser.mk +7 -0
index a207d6e..75fe6cc 100644
@@ -20,4 +20,11 @@ endef
 # The Makefile installs several versions of the libraries, but we only
 # need one of them, depending on the platform.
 
+define IMX_PARSER_FIXUP_TARGET_PATH
+	find $(TARGET_DIR)/usr/lib/imx-mm -mindepth 2 -maxdepth 2 -not -type d \
+		-exec mv {} $(TARGET_DIR)/usr/lib \;
+	rm -fr $(TARGET_DIR)/usr/lib/imx-mm
+endef
+IMX_PARSER_POST_INSTALL_TARGET_HOOKS += IMX_PARSER_FIXUP_TARGET_PATH
+
 $(eval $(autotools-package))
Signature · 1 line
2.8.1
#6 lore raw

PATCH 3/5 imx-parser: add install hooks to fix libraries path

Quoted 15 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Gary" == Gary Bisson <[email protected]> writes:

By default, all the libraries are installed under /usr/lib/imx-mm which causes problems at runtime.

---
 package/freescale-imx/imx-parser/imx-parser.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/freescale-imx/imx-parser/imx-parser.mk +0 -0
index a207d6e..75fe6cc 100644

package/freescale-imx/imx-parser/imx-parser.mk endef · line 26

Quoted 7 lines
package/freescale-imx/imx-parser/imx-parser.mk +4 -0
@@ -20,4 +20,11 @@ endef
 # The Makefile installs several versions of the libraries, but we only
 # need one of them, depending on the platform.
 
+define IMX_PARSER_FIXUP_TARGET_PATH
+	find $(TARGET_DIR)/usr/lib/imx-mm -mindepth 2 -maxdepth 2 -not -type d \
+		-exec mv {} $(TARGET_DIR)/usr/lib \;
+	rm -fr $(TARGET_DIR)/usr/lib/imx-mm

Same comment as for imx-codec. Committed with that fixes, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#7 lore raw

PATCH 4/5 imx-parser: add missing configure options

In reply to Gary Bisson

Enable hard float support when the configuration contains:
BR2_ARM_EABIHF=y

See Yocto equivalent:
https://github.com/Freescale/meta-fsl-arm/blob/krogoth/recipes-multimedia/imx-parser/imx-parser.inc

---

Thanks to those options:
- libraries are copied from release/lib/yocto/hw instead of release/lib/yocto/sw.

Regards,
Gary

---
 package/freescale-imx/imx-parser/imx-parser.mk | 6 ++++++
 1 file changed, 6 insertions(+)
package/freescale-imx/imx-parser/imx-parser.mk +6 -0
index 75fe6cc..75364ae 100644
@@ -13,6 +13,12 @@ IMX_PARSER_LICENSE = NXP Semiconductor Software License Agreement
 IMX_PARSER_LICENSE_FILES = EULA COPYING
 IMX_PARSER_REDISTRIBUTE = NO
 
+ifeq ($(BR2_ARM_EABIHF),y)
+IMX_PARSER_CONF_OPTS += --enable-fhw
+else
+IMX_PARSER_CONF_OPTS += --enable-fsw
+endif
+
 define IMX_PARSER_EXTRACT_CMDS
 	$(call FREESCALE_IMX_EXTRACT_HELPER,$(DL_DIR)/$(IMX_PARSER_SOURCE))
 endef
Signature · 1 line
2.8.1
#8 lore raw

PATCH 4/5 imx-parser: add missing configure options

Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Gary" == Gary Bisson <[email protected]> writes:

Enable hard float support when the configuration contains:
BR2_ARM_EABIHF=y

See Yocto equivalent:
https://github.com/Freescale/meta-fsl-arm/blob/krogoth/recipes-multimedia/imx-parser/imx-parser.inc

Quoted 6 lines

---

Thanks to those options:
- libraries are copied from release/lib/yocto/hw instead of release/lib/yocto/sw.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#9 lore raw

PATCH 5/5 gst1-imx: bump to version 0.12.2

In reply to Gary Bisson

Changelog:
* imxv4l2videosrc:
* Stricter checks for video device capabilities
* Add support for more video formats like 8/16-bit grayscale

* pxp: Fix incorrect return code which broke blitter with GStreamer 1.8

* blitter:
* Improvements in error logging
* Fixes for RGBx framebuffer format detection
* Fix for subtle tearing problem by implementing triple buffering

* audio:
* Replace objdump-based scan during build configuration Codec filenames are instead moved to the C code; the libdir path of the libfslaudiocodec.pc file is used to know where on the target the files are placed
* Explicitely add the libfslaudiocodec.pc libdir to the MP3 encoder Fixes build errors in buildroot
* Minor logging fixes

* misc:
* Proper check for region copies in phys_mem_meta
* Add missing G_END_DECLS lines in headers

Tested with the following commands on i.MX6Q (IPU):

 # gst-launch-1.0 playbin uri=file:///root/tears_of_steel_1080p.webm
 # gst-launch-1.0 filesrc location=/root/tears_of_steel_1080p.webm ! \
   matroskademux ! imxvpudec ! imxipuvideosink
 # gst-launch-1.0 filesrc location=/root/tears_of_steel_1080p.webm ! \
   matroskademux ! imxvpudec ! imxeglvivsink

Tested with the following commands on i.MX7 (PXP):

 # gst-launch-1.0 imxv4l2videosrc device=/dev/video1 ! imxpxpvideosink
---
 package/gstreamer1/gst1-imx/gst1-imx.hash | 2 +-
 package/gstreamer1/gst1-imx/gst1-imx.mk   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
package/gstreamer1/gst1-imx/gst1-imx.hash +1 -1
index ca47776..d345deb 100644
@@ -1,2 +1,2 @@
 # locally computed hash
-sha256 d8a7357bc575e22d0d19d6d7cf547bd69cad5fc47adb93f09ead41b0124353fa  gst1-imx-0.12.1.tar.gz
+sha256 a75f8bc3219fa3c62637f443cef0196c9eafb90aaa5af094847d007124895822  gst1-imx-0.12.2.tar.gz
package/gstreamer1/gst1-imx/gst1-imx.mk +1 -1
index e67f11f..3c6b1b6 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-GST1_IMX_VERSION = 0.12.1
+GST1_IMX_VERSION = 0.12.2
 GST1_IMX_SITE = $(call github,Freescale,gstreamer-imx,$(GST1_IMX_VERSION))
 
 GST1_IMX_LICENSE = LGPLv2+
Signature · 1 line
2.8.1
#10 lore raw

PATCH 5/5 gst1-imx: bump to version 0.12.2

Quoted 34 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Gary" == Gary Bisson <[email protected]> writes:

Changelog:
* imxv4l2videosrc:
* Stricter checks for video device capabilities
* Add support for more video formats like 8/16-bit grayscale

* pxp: Fix incorrect return code which broke blitter with GStreamer 1.8

* blitter:
* Improvements in error logging
* Fixes for RGBx framebuffer format detection
* Fix for subtle tearing problem by implementing triple buffering

* audio:
* Replace objdump-based scan during build configuration Codec filenames are instead moved to the C code; the libdir path of the libfslaudiocodec.pc file is used to know where on the target the files are placed
* Explicitely add the libfslaudiocodec.pc libdir to the MP3 encoder Fixes build errors in buildroot
* Minor logging fixes

* misc:
* Proper check for region copies in phys_mem_meta
* Add missing G_END_DECLS lines in headers

Tested with the following commands on i.MX6Q (IPU):

 # gst-launch-1.0 playbin uri=file:///root/tears_of_steel_1080p.webm
 # gst-launch-1.0 filesrc location=/root/tears_of_steel_1080p.webm ! \
   matroskademux ! imxvpudec ! imxipuvideosink
 # gst-launch-1.0 filesrc location=/root/tears_of_steel_1080p.webm ! \
   matroskademux ! imxvpudec ! imxeglvivsink
Quoted 4 lines

Tested with the following commands on i.MX7 (PXP):

 # gst-launch-1.0 imxv4l2videosrc device=/dev/video1 ! imxpxpvideosink

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard