All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libsdl: enable X11 for nativesdk
@ 2017-04-06 19:55 Martin Kelly
  2017-04-11 16:34 ` akuster808
  0 siblings, 1 reply; 5+ messages in thread
From: Martin Kelly @ 2017-04-06 19:55 UTC (permalink / raw)
  To: openembedded-core

From: Martin Kelly <mkelly@xevo.com>

Currently, the following situation fails:

- Build an SDK and image. Make the image support graphics but not X11.
- Extract SDK and copy image somewhere outside of the Yocto workspace. Do
  runqemu on the image.

This results in the error:
"Could not initialize SDL(No available video device) - exiting"

This error occurs because libSDL attempts to load libX11 for video devices. When
it fails, qemu also fails.

Note that the same runqemu command will work fine from within the Yocto
workspace environment because it will use the native libSDL -- which supports
X11 -- rather than the nativesdk libSDL. In addition, the command will work fine
as long as DISTRO_FEATURES includes x11, because then the nativesdk libSDL will
be compiled with X11 support.

Although the example above may seem a bit silly, this is actually a pretty bad
error because it breaks the ability to build an SDK and image on one machine and
run it on a different machine.

Fix the issue by building nativesdk-libsdl with X11 support -- even when
DISTRO_FEATURES does not include X11 -- as we already do for libsdl-native.

Signed-off-by: Martin Kelly <mkelly@xevo.com>
---
 meta/recipes-graphics/libsdl/libsdl_1.2.15.bb      | 3 ++-
 meta/recipes-graphics/xorg-lib/libxcb_1.12.bb      | 1 +
 meta/recipes-graphics/xorg-lib/xorg-lib-common.inc | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb b/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb
index c802a6f..89d84ab 100644
--- a/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb
+++ b/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb
@@ -43,8 +43,9 @@ EXTRA_OECONF = "--disable-static --enable-cdrom --enable-threads --enable-timers
 
 PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'alsa directfb pulseaudio x11', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'opengl', '', d)}"
+# Without X11 support, qemu will fail because SDL cannot find video devices.
 PACKAGECONFIG_class-native = "x11"
-PACKAGECONFIG_class-nativesdk = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
+PACKAGECONFIG_class-nativesdk = "x11"
 
 PACKAGECONFIG[alsa] = "--enable-alsa --disable-alsatest,--disable-alsa,alsa-lib"
 PACKAGECONFIG[pulseaudio] = "--enable-pulseaudio,--disable-pulseaudio,pulseaudio"
diff --git a/meta/recipes-graphics/xorg-lib/libxcb_1.12.bb b/meta/recipes-graphics/xorg-lib/libxcb_1.12.bb
index a38bdea..6d7e675 100644
--- a/meta/recipes-graphics/xorg-lib/libxcb_1.12.bb
+++ b/meta/recipes-graphics/xorg-lib/libxcb_1.12.bb
@@ -31,6 +31,7 @@ inherit autotools pkgconfig distro_features_check
 # The libxau and others requires x11 in DISTRO_FEATURES
 REQUIRED_DISTRO_FEATURES = "x11"
 REQUIRED_DISTRO_FEATURES_class-native = ""
+REQUIRED_DISTRO_FEATURES_class-nativesdk = ""
 
 export PYTHON = "python3"
 
diff --git a/meta/recipes-graphics/xorg-lib/xorg-lib-common.inc b/meta/recipes-graphics/xorg-lib/xorg-lib-common.inc
index 6f4e444..b397923 100644
--- a/meta/recipes-graphics/xorg-lib/xorg-lib-common.inc
+++ b/meta/recipes-graphics/xorg-lib/xorg-lib-common.inc
@@ -25,3 +25,4 @@ UNKNOWN_CONFIGURE_WHITELIST += "--enable-malloc0returnsnull --disable-malloc0ret
 
 REQUIRED_DISTRO_FEATURES ?= "x11"
 REQUIRED_DISTRO_FEATURES_class-native = ""
+REQUIRED_DISTRO_FEATURES_class-nativesdk = ""
-- 
2.1.4



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

* Re: [PATCH] libsdl: enable X11 for nativesdk
  2017-04-06 19:55 [PATCH] libsdl: enable X11 for nativesdk Martin Kelly
@ 2017-04-11 16:34 ` akuster808
  2017-04-11 17:14   ` Richard Purdie
  0 siblings, 1 reply; 5+ messages in thread
From: akuster808 @ 2017-04-11 16:34 UTC (permalink / raw)
  To: openembedded-core; +Cc: Martin Kelly



On 04/06/2017 12:55 PM, Martin Kelly wrote:
> From: Martin Kelly <mkelly@xevo.com>
>
> Currently, the following situation fails:
>
> - Build an SDK and image. Make the image support graphics but not X11.
> - Extract SDK and copy image somewhere outside of the Yocto workspace. Do
>    runqemu on the image.
>
> This results in the error:
> "Could not initialize SDL(No available video device) - exiting"
This seems to have fixed an issue I was seeing on FedoraCore 25 with 
Morty with the same error.  Did I miss comments regarding these changes?

- armin
>
> This error occurs because libSDL attempts to load libX11 for video devices. When
> it fails, qemu also fails.
>
> Note that the same runqemu command will work fine from within the Yocto
> workspace environment because it will use the native libSDL -- which supports
> X11 -- rather than the nativesdk libSDL. In addition, the command will work fine
> as long as DISTRO_FEATURES includes x11, because then the nativesdk libSDL will
> be compiled with X11 support.
>
> Although the example above may seem a bit silly, this is actually a pretty bad
> error because it breaks the ability to build an SDK and image on one machine and
> run it on a different machine.
>
> Fix the issue by building nativesdk-libsdl with X11 support -- even when
> DISTRO_FEATURES does not include X11 -- as we already do for libsdl-native.
>
> Signed-off-by: Martin Kelly <mkelly@xevo.com>
> ---
>   meta/recipes-graphics/libsdl/libsdl_1.2.15.bb      | 3 ++-
>   meta/recipes-graphics/xorg-lib/libxcb_1.12.bb      | 1 +
>   meta/recipes-graphics/xorg-lib/xorg-lib-common.inc | 1 +
>   3 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb b/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb
> index c802a6f..89d84ab 100644
> --- a/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb
> +++ b/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb
> @@ -43,8 +43,9 @@ EXTRA_OECONF = "--disable-static --enable-cdrom --enable-threads --enable-timers
>   
>   PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'alsa directfb pulseaudio x11', d)} \
>                      ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'opengl', '', d)}"
> +# Without X11 support, qemu will fail because SDL cannot find video devices.
>   PACKAGECONFIG_class-native = "x11"
> -PACKAGECONFIG_class-nativesdk = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
> +PACKAGECONFIG_class-nativesdk = "x11"
>   
>   PACKAGECONFIG[alsa] = "--enable-alsa --disable-alsatest,--disable-alsa,alsa-lib"
>   PACKAGECONFIG[pulseaudio] = "--enable-pulseaudio,--disable-pulseaudio,pulseaudio"
> diff --git a/meta/recipes-graphics/xorg-lib/libxcb_1.12.bb b/meta/recipes-graphics/xorg-lib/libxcb_1.12.bb
> index a38bdea..6d7e675 100644
> --- a/meta/recipes-graphics/xorg-lib/libxcb_1.12.bb
> +++ b/meta/recipes-graphics/xorg-lib/libxcb_1.12.bb
> @@ -31,6 +31,7 @@ inherit autotools pkgconfig distro_features_check
>   # The libxau and others requires x11 in DISTRO_FEATURES
>   REQUIRED_DISTRO_FEATURES = "x11"
>   REQUIRED_DISTRO_FEATURES_class-native = ""
> +REQUIRED_DISTRO_FEATURES_class-nativesdk = ""
>   
>   export PYTHON = "python3"
>   
> diff --git a/meta/recipes-graphics/xorg-lib/xorg-lib-common.inc b/meta/recipes-graphics/xorg-lib/xorg-lib-common.inc
> index 6f4e444..b397923 100644
> --- a/meta/recipes-graphics/xorg-lib/xorg-lib-common.inc
> +++ b/meta/recipes-graphics/xorg-lib/xorg-lib-common.inc
> @@ -25,3 +25,4 @@ UNKNOWN_CONFIGURE_WHITELIST += "--enable-malloc0returnsnull --disable-malloc0ret
>   
>   REQUIRED_DISTRO_FEATURES ?= "x11"
>   REQUIRED_DISTRO_FEATURES_class-native = ""
> +REQUIRED_DISTRO_FEATURES_class-nativesdk = ""



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

* Re: [PATCH] libsdl: enable X11 for nativesdk
  2017-04-11 16:34 ` akuster808
@ 2017-04-11 17:14   ` Richard Purdie
  2017-04-11 21:47     ` Martin Kelly
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2017-04-11 17:14 UTC (permalink / raw)
  To: akuster808, openembedded-core; +Cc: Martin Kelly

On Tue, 2017-04-11 at 09:34 -0700, akuster808 wrote:
> 
> On 04/06/2017 12:55 PM, Martin Kelly wrote:
> > 
> > From: Martin Kelly <mkelly@xevo.com>
> > 
> > Currently, the following situation fails:
> > 
> > - Build an SDK and image. Make the image support graphics but not
> > X11.
> > - Extract SDK and copy image somewhere outside of the Yocto
> > workspace. Do
> >    runqemu on the image.
> > 
> > This results in the error:
> > "Could not initialize SDL(No available video device) - exiting"
> This seems to have fixed an issue I was seeing on FedoraCore 25 with 
> Morty with the same error.  Did I miss comments regarding these
> changes?

No, I haven't directly commented but these changes do worry me a bit in
that we're setting the PACKAGECONFIG to x11 for some nativesdk things
and ignoring it for others. I don't like the inconsistency.

I'm hoping the patch from Jussi today will be a better solution for
this problem, at least for master.

Cheers,

Richard


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

* Re: [PATCH] libsdl: enable X11 for nativesdk
  2017-04-11 17:14   ` Richard Purdie
@ 2017-04-11 21:47     ` Martin Kelly
  2017-04-13  0:16       ` Martin Kelly
  0 siblings, 1 reply; 5+ messages in thread
From: Martin Kelly @ 2017-04-11 21:47 UTC (permalink / raw)
  To: Richard Purdie, akuster808, openembedded-core; +Cc: Martin Kelly

On 04/11/2017 10:14 AM, Richard Purdie wrote:
> On Tue, 2017-04-11 at 09:34 -0700, akuster808 wrote:
>>
>> On 04/06/2017 12:55 PM, Martin Kelly wrote:
>>>
>>> From: Martin Kelly <mkelly@xevo.com>
>>>
>>> Currently, the following situation fails:
>>>
>>> - Build an SDK and image. Make the image support graphics but not
>>> X11.
>>> - Extract SDK and copy image somewhere outside of the Yocto
>>> workspace. Do
>>>    runqemu on the image.
>>>
>>> This results in the error:
>>> "Could not initialize SDL(No available video device) - exiting"
>> This seems to have fixed an issue I was seeing on FedoraCore 25 with
>> Morty with the same error.  Did I miss comments regarding these
>> changes?
>
> No, I haven't directly commented but these changes do worry me a bit in
> that we're setting the PACKAGECONFIG to x11 for some nativesdk things
> and ignoring it for others. I don't like the inconsistency.
>
> I'm hoping the patch from Jussi today will be a better solution for
> this problem, at least for master.
>

I like Jussi's solution better too. However, I don't have a good way to 
test it on my project (Automotive Grade Linux, which uses Morty), as the 
patch does not backport well due to other changes.

The bug is very significant when your workload hits it (makes images 
built by a different machine unusable). Is there a good solution here 
for Morty?


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

* Re: [PATCH] libsdl: enable X11 for nativesdk
  2017-04-11 21:47     ` Martin Kelly
@ 2017-04-13  0:16       ` Martin Kelly
  0 siblings, 0 replies; 5+ messages in thread
From: Martin Kelly @ 2017-04-13  0:16 UTC (permalink / raw)
  To: Richard Purdie, akuster808, openembedded-core; +Cc: Martin Kelly

On 04/11/2017 02:47 PM, Martin Kelly wrote:
> On 04/11/2017 10:14 AM, Richard Purdie wrote:
>> On Tue, 2017-04-11 at 09:34 -0700, akuster808 wrote:
>>>
>>> On 04/06/2017 12:55 PM, Martin Kelly wrote:
>>>>
>>>> From: Martin Kelly <mkelly@xevo.com>
>>>>
>>>> Currently, the following situation fails:
>>>>
>>>> - Build an SDK and image. Make the image support graphics but not
>>>> X11.
>>>> - Extract SDK and copy image somewhere outside of the Yocto
>>>> workspace. Do
>>>>    runqemu on the image.
>>>>
>>>> This results in the error:
>>>> "Could not initialize SDL(No available video device) - exiting"
>>> This seems to have fixed an issue I was seeing on FedoraCore 25 with
>>> Morty with the same error.  Did I miss comments regarding these
>>> changes?
>>
>> No, I haven't directly commented but these changes do worry me a bit in
>> that we're setting the PACKAGECONFIG to x11 for some nativesdk things
>> and ignoring it for others. I don't like the inconsistency.
>>
>> I'm hoping the patch from Jussi today will be a better solution for
>> this problem, at least for master.
>>
>

I finally tested today with Jussi's patch, and I'm happy to report that 
it appears to fix the issue!


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

end of thread, other threads:[~2017-04-13  0:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-06 19:55 [PATCH] libsdl: enable X11 for nativesdk Martin Kelly
2017-04-11 16:34 ` akuster808
2017-04-11 17:14   ` Richard Purdie
2017-04-11 21:47     ` Martin Kelly
2017-04-13  0:16       ` Martin Kelly

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.