Skip to content
This repository has been archived by the owner. It is now read-only.

hardware keyboard no response on raspberry pi #1137

Open
yangxuan8282 opened this issue Jan 19, 2018 · 21 comments

Comments

Projects
None yet
4 participants
@yangxuan8282
Copy link
Contributor

commented Jan 19, 2018

I follow the wiki: https://wiki.postmarketos.org/wiki/Existing_Alpine_installation , have installed postmarketos-base and postmarketos-ui-hildon on raspberry pi. After reboot, I can see the desktop, but both usb keyboard and mouse not working in X11. I guess maybe this is caused by didn't installed the device packages, not provide /etc/deviceinfo, so the scripts didn't auto configure correctly. Trying to fix this manually with add following xorg conf:

/etc/X11/xorg.conf.d/00-keyboard.conf

Section "InputClass"
        Identifier "system-keyboard"
        Driver  "evdev"
        MatchIsKeyboard "on"
        Option "XkbLayout" "us"
        Option "XkbModel" "pc105"
        Option "XkbOptions" "grp:alt_shift_toggle"
EndSection

but this not work

@ollieparanoid

This comment has been minimized.

Copy link
Member

commented Jan 19, 2018

Thanks for trying out postmarketOS! You must be the first one to try installing it that way. We only ran it with the /etc/deviceinfo so far. But the input problem you're having sounds like it could be fixed by installing xf86-input-libinput:

apk add xf86-input-libinput

After that, try to restart the X server. Does that work?

@yangxuan8282

This comment has been minimized.

Copy link
Contributor Author

commented Jan 20, 2018

Thanks for reply

the xf86-input-libinput package has already installed:

rpi:~$ sudo apk del xf86-input-libinput
World updated, but the following packages are not removed due to:
  xf86-input-libinput: postmarketos-base-x11


2 errors; 589 MiB in 327 packages

but there are some progress, after install xf86-input-evdev, and disable hotplug with:

echo " Section "ServerFlags"
   Option "AutoAddDevices" "False"
 EndSection" | sudo tee /etc/X11/xorg.conf

which is suggested by this wiki pages: https://wiki.alpinelinux.org/wiki/XFCE_Setup , in Troubleshooting section

after reboot, the keyboard work now, I can switch to vt2 with ctrl + alt + F2 (although can't login in this vt), and the mouse also work, although not properly, no mouse pointer show up on screen, but there are some response when click

here is the related Xorg.0.log

/var/log/Xorg.0.log

...
[    23.162] (==) ModulePath set to "/usr/lib/xorg/modules"
[    23.162] (==) |-->Input Device "<default pointer>"
[    23.162] (==) |-->Input Device "<default keyboard>"
[    23.162] (==) No Layout section. Using the default mouse configuration.
[    23.162] (==) No Layout section. Using the default keyboard configuration.
...

guess need a configure file for mouse, I have tried this one:

Section "InputClass"
    Identifier "evdev pointer tweaked catchall"
    MatchIsPointer "on"
    Driver "evdev"
    Option "Emulate3Buttons" "True"
    Option "SwapAxes" "True"
EndSection

but not work

@ollieparanoid

This comment has been minimized.

Copy link
Member

commented Jan 20, 2018

Maybe this is an issue with Hildon. Could you check if XFCE4 works?

@yangxuan8282

This comment has been minimized.

Copy link
Contributor Author

commented Jan 20, 2018

Yes, for XFCE4 it just work, both keyboard and mouse, I guess the mouse issues is Hildon related.

@yangxuan8282

This comment has been minimized.

Copy link
Contributor Author

commented Jan 20, 2018

so, I have tested the rest desktop environment on rpi3 with postmarketOS, here is the result:

  • working: XFCE4, MATE

  • not working: weston, LuneOS UI, Plasma Mobile

  • boot, but with issues: Hildon ( cursor invisible )

Don't know how to get VC4 driver work on alpine, otherwise those wayland desktop environment should work, as I have tried on archlinux arm, both weston, KDE Plasma, Enlightenment can work in wayland session use default drm backend on raspberry pi with VC4 enabled.

As for Hildon, if user have touch screen maybe it's usable for rpi.

@ollieparanoid

This comment has been minimized.

Copy link
Member

commented Jan 20, 2018

Thanks for all the testing and the feedback! I've linked to this issue in the Raspberry Pi device page (feel free to extend that with more information).

@NotKit, @MerlijnWajer, @parazyd, @pavelmachek: do you know how to get a cursor in Hildon?

postmarketOS-Wiki pushed a commit to postmarketOS/wiki that referenced this issue Jan 20, 2018

@MerlijnWajer

This comment has been minimized.

Copy link

commented Jan 20, 2018

I do not have a direct link to source, but this link is relevant: https://stackoverflow.com/questions/660613/how-do-you-hide-the-mouse-pointer-under-linux-x11

This is the package in question: http://maemo.org/packages/view/extmou/

@freemangordon knows for sure.

@MerlijnWajer

This comment has been minimized.

Copy link

commented Jan 20, 2018

@yangxuan8282

This comment has been minimized.

Copy link
Contributor Author

commented Jan 22, 2018

@ollieparanoid
Hi, today I'm trying to re-compile the kernel for pi, to include vc4 as module.
And before reboot I install the kernel and create a device info file save as /etc/deviceinfo, it look like this:

/etc/deviceinfo

# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell scripts.

deviceinfo_format_version="0"
deviceinfo_name="rpi2"
deviceinfo_manufacturer="Raspberry Pi Foundation"
deviceinfo_date=""
deviceinfo_keyboard="true"
deviceinfo_nonfree="????"
deviceinfo_dtb=""
deviceinfo_modules_initfs=""
deviceinfo_external_disk="true"
deviceinfo_external_disk_install="true"
deviceinfo_flash_method="none"
deviceinfo_generate_legacy_uboot_initfs="false"
deviceinfo_arch="armhf"

# Splash
deviceinfo_screen_width="1920"
deviceinfo_screen_height="1080"

after reboot it can't boot, with postmarketOS splash screen here, and says no boot partition found.
But after check partition info of the sdcard, seems nothing change, I guess there are some pmos scripts is trying to find a linux partition as /boot, it didn't found.

Do you know how to undo the changes, so I can boot into the system?

@yangxuan8282

This comment has been minimized.

Copy link
Contributor Author

commented Jan 22, 2018

I fresh install the alpine, installed the kernel with vc4 modules load, add the apk sources and install postmarketos-ui-weston, but when I trying to use weston got new issues:

if auto boot use /etc/profile.d/start_weston.sh in tty1, will got Gtk-WARNING **: cannot open display: :0

if run weston-launch in tty2, got this:

Date: 2018-01-22 CST
[21:53:53.072] weston 3.0.0
               http://wayland.freedesktop.org
               Bug reports to: https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=3.0.0
               Build: unknown (not built from git or tarball)
[21:53:53.072] Command line: /usr/bin/weston
[21:53:53.072] OS: Linux, 4.9.65-0-rpi2, #1-Alpine SMP PREEMPT Mon Jan 22 06:09:21 UTC 2018, armv7l
[21:53:53.072] Using config file '/etc/xdg/weston/weston.ini'
[21:53:53.072] Output repaint window is 7 ms maximum.
[21:53:53.072] Loading module '/usr/lib/libweston-3/drm-backend.so'
[21:53:53.074] initializing drm backend
[21:53:53.076] using /dev/dri/card0
[21:53:53.076] Loading module '/usr/lib/libweston-3/gl-renderer.so'
[21:53:53.264] EGL client extensions: EGL_EXT_client_extensions
               EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses
               EGL_KHR_debug EGL_EXT_platform_wayland EGL_EXT_platform_x11
               EGL_MESA_platform_gbm
[21:53:53.266] warning: neither EGL_EXT_swap_buffers_with_damage or EGL_KHR_swap_buffers_with_damage is supported. Performance could be affected.
[21:53:53.266] EGL_KHR_surfaceless_context available
[21:53:53.270] EGL version: 1.4 (DRI2)
[21:53:53.270] EGL vendor: Mesa Project
[21:53:53.270] EGL client APIs: OpenGL OpenGL_ES
[21:53:53.270] EGL extensions: EGL_EXT_buffer_age EGL_EXT_image_dma_buf_import
               EGL_EXT_image_dma_buf_import_modifiers EGL_KHR_cl_event2
               EGL_KHR_config_attribs EGL_KHR_create_context
               EGL_KHR_create_context_no_error EGL_KHR_fence_sync
               EGL_KHR_get_all_proc_addresses EGL_KHR_gl_colorspace
               EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image
               EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image
               EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap
               EGL_KHR_no_config_context EGL_KHR_reusable_sync
               EGL_KHR_surfaceless_context EGL_KHR_wait_sync
               EGL_MESA_configless_context EGL_MESA_drm_image
               EGL_MESA_image_dma_buf_export EGL_WL_bind_wayland_display
[21:53:53.270] GL version: OpenGL ES 2.0 Mesa 17.2.4
[21:53:53.270] GLSL version: OpenGL ES GLSL ES 1.0.16
[21:53:53.270] GL vendor: Broadcom
[21:53:53.270] GL renderer: VC4 V3D 2.1
[21:53:53.271] GL extensions: GL_EXT_blend_minmax GL_EXT_multi_draw_arrays
               GL_EXT_texture_format_BGRA8888
               GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth24
               GL_OES_element_index_uint GL_OES_fbo_render_mipmap
               GL_OES_mapbuffer GL_OES_rgb8_rgba8 GL_OES_stencil8
               GL_OES_texture_3D GL_OES_texture_npot GL_OES_vertex_half_float
               GL_OES_EGL_image GL_OES_depth_texture
               GL_OES_packed_depth_stencil GL_EXT_texture_type_2_10_10_10_REV
               GL_OES_get_program_binary GL_APPLE_texture_max_level
               GL_EXT_discard_framebuffer GL_EXT_read_format_bgra
               GL_EXT_frag_depth GL_NV_fbo_color_attachments
               GL_OES_EGL_image_external GL_OES_EGL_sync
               GL_OES_vertex_array_object GL_EXT_unpack_subimage
               GL_NV_draw_buffers GL_NV_read_buffer GL_NV_read_depth
               GL_NV_read_depth_stencil GL_NV_read_stencil GL_EXT_draw_buffers
               GL_EXT_map_buffer_range GL_KHR_debug GL_OES_surfaceless_context
               GL_EXT_separate_shader_objects
               GL_EXT_compressed_ETC1_RGB8_sub_texture
               GL_EXT_draw_elements_base_vertex GL_EXT_texture_border_clamp
               GL_KHR_context_flush_control GL_OES_draw_elements_base_vertex
               GL_OES_texture_border_clamp GL_KHR_no_error
[21:53:53.271] GL ES 2 renderer features:
               read-back format: BGRA
               wl_shm sub-image to texture: yes
               EGL Wayland extension: yes
[21:53:53.274] event0  - [21:53:53.274] 2.4G Mouse: [21:53:53.274] not tagged as supported input device
[21:53:53.274] event0  - not using input device '/dev/input/event0'
[21:53:53.275] event4  - [21:53:53.275] Dell Dell AC511 USB SoundBar: [21:53:53.275] not tagged as supported input device
[21:53:53.275] event4  - not using input device '/dev/input/event4'
[21:53:53.276] event1  - [21:53:53.276] RAPOO Rapoo 2.4G Wireless Device: [21:53:53.276] not tagged as supported input device
[21:53:53.276] event1  - not using input device '/dev/input/event1'
[21:53:53.276] event2  - [21:53:53.277] RAPOO Rapoo 2.4G Wireless Device: [21:53:53.277] not tagged as supported input device
[21:53:53.277] event2  - not using input device '/dev/input/event2'
[21:53:53.277] event3  - [21:53:53.277] RAPOO Rapoo 2.4G Wireless Device: [21:53:53.277] not tagged as supported input device
[21:53:53.277] event3  - not using input device '/dev/input/event3'
[21:53:53.278] warning: no input devices on entering Weston. Possible causes:
        - no permissions to read /dev/input/event*
        - seats misconfigured (Weston backend option 'seat', udev device property ID_SEAT)
[21:53:53.278] failed to create input devices

and even use root user got same issues, that's kind of weird.

@ollieparanoid

This comment has been minimized.

Copy link
Member

commented Jan 23, 2018

after reboot it can't boot, with postmarketOS splash screen here, and says no boot partition found.
But after check partition info of the sdcard, seems nothing change, I guess there are some pmos scripts is trying to find a linux partition as /boot, it didn't found.

postmarketOS initramfs detects the boot and system partitions by partition label. Once you assign those (pmOS_boot and pmOS_root) it should work (more). I've adjusted the existing Alpine installation page to mention this.

Regarding your weston issues, does weston work (display something on HDMI)?

postmarketOS-Wiki pushed a commit to postmarketOS/wiki that referenced this issue Jan 23, 2018

@yangxuan8282

This comment has been minimized.

Copy link
Contributor Author

commented Jan 23, 2018

after label the partition, and move the initramfs-extra to the root of /boot, the system can boot now, with pmOS splash screen before see the desktop

as for the weston, it failed to launch, and the last comment include all output

@ollieparanoid

This comment has been minimized.

Copy link
Member

commented Jan 23, 2018

nice that it boots now, thanks for trying it out!

After using start_weston.sh, you can read the log (stdout and stderr combined) with logread. Could it be that there's something missing in the log you've attached? (e.g. only redirected stdout, but not stderr).

After some quick research, it looks like there's an extra weston video backend made for the Raspberry Pi, quoting from here:

Weston with its VideoCore backend

You might need to enable that in weston (adjust the APKBUILD accordingly), then rebuild weston and install the updated packages on the device (e.g. by reflashing). Also you'd need to adjust your device's weston configuration to actually use the new backend.

@yangxuan8282

This comment has been minimized.

Copy link
Contributor Author

commented Jan 28, 2018

logread got:

logread can't find syslogd buffer no such file or directory

The content of #1137 (comment) is the output of: weston-launch > weston.output 2>&1, so I guess the stderr also have been redirected.

the blog you mention is quite old, back to 2013, and have to use a special version weston, since then we have open source driver VC4 from Eric Anholt. Actually there used to be a rpi-backend.so weston backend exist, which is specialized for raspberry pi, but it has been nuked in 2016.
Now the working backend for rpi is drm backend, and with VC4 enabled. According to gentoo wiki pages, this can be verified by check if /dev/dri/card0 exist. The official alpine raspberry pi 2 kernel package linux-rpi2 did not compiled with VC4 (CONFIG_DRM_VC4), so I recompiled the kernel to include it as modules, and here is the config file I use. Besides this, we still need mesa compiled with VC4, use --with-gallium-drivers=vc4. According to alpine mesa APKBUILD , which has been included.
So I don't really know why weston not work on alpine for rpi, since it run without issues on archlinux arm.

@ollieparanoid

This comment has been minimized.

Copy link
Member

commented Jan 30, 2018

Thanks for explaining that the videocore weston backend is outdated, that makes sense.

Okay, after digging into this for a bit, I think on your system, the postmarketos-base post-install hook did not get executed properly. It should have done the following regarding syslog:

  • add -C4048 to /etc/conf.d/syslog
  • start syslog at boot (rc-update -q add syslog boot)

(See also: Alpine wiki on syslog)

Maybe weston failed to start with start_weston.sh, because syslog is not started.

When you started weston manually, have you exported the XDG_RUNTIME_DIR variable? Something like that:

export XDG_RUNTIME_DIR=/tmp/$(id -u)-runtime-dir
mkdir -p "${XDG_RUNTIME_DIR}"
chmod 0700 "${XDG_RUNTIME_DIR}" 

If all that does not help, these environment variables may give you more logging output (source):

export MESA_DEBUG=1
export EGL_LOG_LEVEL=debug
export LIBGL_DEBUG=verbose
export WAYLAND_DEBUG=1
@yangxuan8282

This comment has been minimized.

Copy link
Contributor Author

commented Feb 18, 2018

@ollieparanoid
hi, Oliver there are some progress, after fix syslog stuff like your suggest, and set ${XDG_RUNTIME_DIR}, now I can launch weston with root user, use drm backend and my custom kernel.
But I can't launch weston-launch with normal user pi, from logread:

Jan  1 15:59:59 rpi user.notice pi:weston: weston-launch: Permission denied. You should either:
Jan  1 15:59:59 rpi user.notice pi:weston:  - enable systemd session support for weston-launch.
Jan  1 15:59:59 rpi user.notice pi:weston:  - or add yourself to the 'weston-launch' group.

but I have already add the user pi into group weston-launch, this can be verified from output of command groups:

rpi:~$ groups
pi root sys adm wheel console audio input video netdev docker weston-launch

and I have also checked the /etc/group:

cat /etc/group
...
weston-launch:x:1001:pi

by the way, the group weston-launch was created manually by type:

sudo addgroup weston-launch

since it not exist

@yangxuan8282

This comment has been minimized.

Copy link
Contributor Author

commented Feb 18, 2018

as for other desktop environment, I can launch luna, although it's not really stable on rpi, it crash after open calendar, and the mouse looks quite weird, the cursor become a line

image

@ollieparanoid

This comment has been minimized.

Copy link
Member

commented Feb 19, 2018

CC @magmastonealex: postmarketOS with LuneOS UI on the big screen!

Thanks for making the photo! LuneOS was only added recently and has not been used much. We could try to fix the crash if you want, a starting point would be checking if logread has anything useful.

@sebastian-de

This comment has been minimized.

Copy link

commented Jun 28, 2018

I tried postmarketOS with Plasma Mobile on my Rpi3 today. Plasma starts up fine and I see a mouse pointer on the screen, but the Rpi doesn't respond to mouse or keyboard input. I can't even use CTRL-ALT-F* to switch to a console, but ssh works.
I tried to install libinput manually, but this didn't change the behaviour. libinput list-devices shows mouse and keyboard correctly.
The log seems to get flooded with network manager errors (which seems to be a known bug according to some reported issues), right now it's not even possible to logread -f | grep -i input
Any hints how to find a solution?

@yangxuan8282

This comment has been minimized.

Copy link
Contributor Author

commented Jun 28, 2018

@MerlijnWajer

This comment has been minimized.

Copy link

commented Jun 28, 2018

@ollieparanoid btw - newer versions of hildon-desktop do show the mouse cursor now - at least when a mouse is plugged in when it starts.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.