Bug 90562 - failed to create display when use "weston --backend=wayland-backend.so"
Summary: failed to create display when use "weston --backend=wayland-backend.so"
Status: RESOLVED FIXED
Alias: None
Product: Wayland
Classification: Unclassified
Component: wayland (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Wayland bug list
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-21 13:32 UTC by Mark Yao
Modified: 2015-05-22 07:12 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Mark Yao 2015-05-21 13:32:38 UTC
run command at opensuse 13.2:
   weston --backend=wayland-backend.so


[21:00:54.070] weston 1.6.0
               http://wayland.freedesktop.org/
               Bug reports to: https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=1.6.0
               Build: 1.5.93-5-g2858cc2 configure.ac: bump version to 1.6.0 (2014-09-19 13:40:14 +0300)
[21:00:54.071] OS: Linux, 3.16.6-2-desktop, #1 SMP PREEMPT Mon Oct 20 13:47:22 UTC 2014 (feb42ea), x86_64
[21:00:54.085] Starting with no config file.
[21:00:54.105] Loading module '/usr/lib64/weston/wayland-backend.so'
[21:00:54.401] failed to create display: No such file or directory
[21:00:54.401] fatal: failed to create compositor

$env | grep -E "XDG|WAYLAND"

XDG_VTNR=7
XDG_SESSION_ID=1
XDG_MENU_PREFIX=gnome-
XDG_CONFIG_DIRS=/etc/xdg
XDG_SEAT=seat0
XDG_SESSION_DESKTOP=gnome
XDG_DATA_DIRS=/usr/share
XDG_RUNTIME_DIR=/run/user/1000
XDG_CURRENT_DESKTOP=GNOME

strace weston --backend=wayland-backend.so:
...
connect(10, {sa_family=AF_LOCAL, sun_path="/run/user/1000/wayland-0"}, 27) = -1 ENOENT (No such file or directory)

who can create the "/run/user/1000/wayland-0" ?

I read the weston source code:
  this socket can create by src/compositor.c: weston_create_listening_socket()
  but actually things:
---->    main
---->    backend_init
---->    wl_display_connect (check the socket and report no display) BREAK
----> **NO** PATH get here to call weston_create_listening_socket()

Is that a bug or I do something wrong?
Comment 1 Pekka Paalanen 2015-05-21 13:52:57 UTC
Using the wayland backend of Weston means that you want to run Weston under another Wayland compositor (which could also be Weston, if you wish).

If you are not running under an existing Wayland compositor, then obviously connecting to the parent compositor will fail.

What are you trying to do?
Comment 2 Mark Yao 2015-05-22 00:59:47 UTC
(In reply to Pekka Paalanen from comment #1)
> Using the wayland backend of Weston means that you want to run Weston under
> another Wayland compositor (which could also be Weston, if you wish).
> 
> If you are not running under an existing Wayland compositor, then obviously
> connecting to the parent compositor will fail.
> 
> What are you trying to do?

wayland is a child for other compositor?

I test run weston --backend=x11-backend.so,success
then open  weston desktop shell:
int the desktop shell: run weston --backend=wayland-backend.so,
success display but get this Error: libwayland: unable to lock lockfile /run/user/0/wayland-0.lock, maybe another compositor is running
Is it right?

thanks for the help.

BTW, if I didn't use weston, like glmark2-es2-wayland or gtk3-demo with wayland,
I should run weston first? or there is another way to run an existing Wayland compositor.

My trying is just want to run a destop with wayland backend.
Comment 3 Pekka Paalanen 2015-05-22 05:52:48 UTC
Weston's Wayland-backend is meant for running Weston under another Wayland compositor, yes. Just like the DRM backend is for running Weston on DRM/KMS, the fbdev backend is for running Weston on /dev/fb, and the X11 backend is for running Weston under an X server.

(In reply to Mark Yao from comment #2)
> I test run weston --backend=x11-backend.so,success
> then open  weston desktop shell:
> int the desktop shell: run weston --backend=wayland-backend.so,
> success display but get this Error: libwayland: unable to lock lockfile
> /run/user/0/wayland-0.lock, maybe another compositor is running
> Is it right?

This is because Weston 1.6.0 IIRC did not yet automatically search for a free socket name. You can work around that by specifying --socket with an unused name on the command line. Weston 1.7.0 should find a free socket name automatically.

> BTW, if I didn't use weston, like glmark2-es2-wayland or gtk3-demo with
> wayland,
> I should run weston first? or there is another way to run an existing
> Wayland compositor.

You can run whatever compositor you want. Weston is just one of them and not in any way mandatory. GNOME has one, KDE has one, E has one, and there are more.

> My trying is just want to run a destop with wayland backend.

I can't see why? If it works, you already have a Wayland environment running, and you don't need Weston with the wayland backend.

I think you are confusing some concepts here. The wayland backend is *not* needed to get a Wayland environment running. A Wayland compositor provides a Wayland environment for its clients in any case.
Comment 4 Mark Yao 2015-05-22 07:12:49 UTC
(In reply to Pekka Paalanen from comment #3)
> Weston's Wayland-backend is meant for running Weston under another Wayland
> compositor, yes. Just like the DRM backend is for running Weston on DRM/KMS,
> the fbdev backend is for running Weston on /dev/fb, and the X11 backend is
> for running Weston under an X server.
> 
> (In reply to Mark Yao from comment #2)
> > I test run weston --backend=x11-backend.so,success
> > then open  weston desktop shell:
> > int the desktop shell: run weston --backend=wayland-backend.so,
> > success display but get this Error: libwayland: unable to lock lockfile
> > /run/user/0/wayland-0.lock, maybe another compositor is running
> > Is it right?
> 
> This is because Weston 1.6.0 IIRC did not yet automatically search for a
> free socket name. You can work around that by specifying --socket with an
> unused name on the command line. Weston 1.7.0 should find a free socket name
> automatically.
> 
> > BTW, if I didn't use weston, like glmark2-es2-wayland or gtk3-demo with
> > wayland,
> > I should run weston first? or there is another way to run an existing
> > Wayland compositor.
> 
> You can run whatever compositor you want. Weston is just one of them and not
> in any way mandatory. GNOME has one, KDE has one, E has one, and there are
> more.
> 
> > My trying is just want to run a destop with wayland backend.
> 
> I can't see why? If it works, you already have a Wayland environment
> running, and you don't need Weston with the wayland backend.
> 
> I think you are confusing some concepts here. The wayland backend is *not*
> needed to get a Wayland environment running. A Wayland compositor provides a
> Wayland environment for its clients in any case.

Thanks, I think I get the point.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.