The Mer Wiki now uses your Mer user account and password (create account on https://bugs.merproject.org/)


Sailfish/ButterflyTouch

From Mer Wiki
< Sailfish(Difference between revisions)
Jump to: navigation, search
m (Working parts)
(Working parts)
 
(8 intermediate revisions by one user not shown)
Line 1: Line 1:
Work in progress. This is mostly inspired from the [[Sailfish/Exopc|ExoPC]] tutorial, with adaptation for this hardware.
+
Work in progress. This is mostly inspired from the [[Sailfish/Exopc|ExoPC]] tutorial, with adaptation for this hardware, and has been updated to use the Qt5/Wayland new SDK Alpha.
  
 
= Install Sailfish SDK Emulator on ButterflyTouch =
 
= Install Sailfish SDK Emulator on ButterflyTouch =
Line 12: Line 12:
 
=== USB key setup ===
 
=== USB key setup ===
 
* Extract root filesystem from emulator virtualbox image
 
* Extract root filesystem from emulator virtualbox image
  VBoxManage internalcommands converttoraw sailfishos.vdi sailfish.raw
+
  VBoxManage internalcommands converttoraw ~/SailfishOS/emulator/sailfishos.vdi sailfish.raw
 
* Copy to flash key
 
* Copy to flash key
 
  sudo dd if=sailfish.raw of=/dev/sd* bs=4M
 
  sudo dd if=sailfish.raw of=/dev/sd* bs=4M
Line 19: Line 19:
 
* Edit /boot/extlinux/extlinux.conf to boot from sdb1 and add rootwait
 
* Edit /boot/extlinux/extlinux.conf to boot from sdb1 and add rootwait
  
=== Running on the ButteflyTouch ===
+
=== Running on the ButterflyTouch ===
 
* The following has been done with Ethernet cable plugged. Wifi activation could be added later on.
 
* The following has been done with Ethernet cable plugged. Wifi activation could be added later on.
 
* Place the USB key in ButteflyTouch
 
* Place the USB key in ButteflyTouch
 
* Boot, press F12 button to access boot device selection menu and select USB
 
* Boot, press F12 button to access boot device selection menu and select USB
* Ctrl/Alt F2 - Login root/nemo here are our steps for your reference.
+
* Ctrl/Alt F2 - Login root/(no password)
  
* edit sshd to allow remote login
+
* sshd is already launched by default, but the root account needs a password to allow to connect to it ['''Edit''' : as user nemo is in the sudoers, it may not be needed, as nemo can do all this].
* run /usr/sbin/sshd --daemon to launch the SSH server.
+
* launch command "passwd", and set the password to nemo.
  
From now on, you can connect remotely to do the following (it allows copy/pasting the command from a browser and now typing by hand).
+
From now on, you can connect remotely to do the following (it allows copy/pasting the command from a browser and not typing by hand).
  
* Install missing packets to run X server with the correct drivers.
+
* Edit /usr/lib/qt5/qml/Sailfish/Silica/ApplicationWindow.qml
** Add the mer repository:
+
zypper ar http://repo.merproject.org/obs/home:/vgrade:/branches:/nemo:/devel:/hw:/x86-common/latest_i586/home:vgrade:branches:nemo:devel:hw:x86-common.repo
+
** I had some trouble with the default path this gave me. I had to edit the repository and change it:
+
vim /etc/zypp/repos.d/home_vgrade_branches_nemo_devel_hw_x86-common.repo
+
 
+
# Comment the existing baseurl line :
+
#baseurl=http://repo.merproject.org/repositories/home:/vgrade:/branches:/nemo:/devel:/hw:/x86-common/latest_i586/
+
# and replace it by :
+
baseurl=http://repo.merproject.org/obs/home:/vgrade:/branches:/nemo:/devel:/hw:/x86-common/latest_i586/
+
 
+
** Then install the missing packets
+
zypper in mesa-x86-generic-9.0.2-50.2
+
zypper in xorg-x11-drv-intel-2.21.3
+
 
+
Rebooting at this point gave me errors that I can see in Xorg log :
+
cat /var/log/Xorg.0.log | grep EE
+
If found out, it was looking for a i965 driver (strange, Fedora on this computer uses i915 module ?). A quick search provides the correct packet :
+
zypper search i965
+
** Install the i965 drivers:
+
zypper install mesa-x86-generic-dri-i965-driver
+
 
+
* remove egl_gallium.so (ExoPC tutorial ask to remove also st.so, but this was not present on my system)
+
cd /usr/lib/egl/
+
mv egl_gallium.so egl_gallium.so.old
+
 
+
* Edit to /usr/lib/systemd/user/lipstick.service to add Environment=QT_DEFAULT_RUNTIME_SYSTEM=
+
echo "Environment=QT_DEFAULT_RUNTIME_SYSTEM=" >> /usr/lib/systemd/user/lipstick.service
+
* Add some variable to /var/lib/environment/nemo/50-jolla-ui
+
echo "EGL_PLATFORM=x11" >> /var/lib/environment/nemo/50-jolla-ui
+
echo "EGL_DRIVER=egl_dri2" >> /var/lib/environment/nemo/50-jolla-ui
+
echo "MCOMPOSITOR_USE_TFP=1" >> /var/lib/environment/nemo/50-jolla-ui
+
 
+
* Set content of /etc/X11/xorg.conf.d/x86-vm.conf to :
+
Section "Monitor"
+
Identifier "Default Monitor"
+
HorizSync 30-100
+
VertRefresh 20-160
+
EndSection
+
Section "Screen"
+
Identifier "Default Screen"
+
Monitor "Default Monitor"
+
DefaultDepth 24
+
SubSection "Display"
+
# Viewport 0 0
+
Depth 24
+
EndSubsection
+
EndSection
+
Section "Device"
+
Identifier "Videocard0"
+
Driver "intel"
+
Option "AccelMathod" "sna"
+
EndSection
+
Section "Module"
+
Load "glx"
+
Load "dri"
+
EndSection
+
Section "DRI"
+
Mode 0666
+
EndSection
+
 
+
* Edit /usr/lib/qt4/imports/Sailfish/Silica/ApplicationWindow.qml to set width/height 1366/768
+
 
  //width: _transpose ? screen.height : screen.width
 
  //width: _transpose ? screen.height : screen.width
 
  //height: _transpose ? screen.width : screen.height
 
  //height: _transpose ? screen.width : screen.height
Line 97: Line 36:
 
  height: 768
 
  height: 768
  
* Put the display in portrait mode. Execute following command while logged in as user "nemo"
+
* Put the display in portrait mode.  
 +
The original command don't work anymore, so edit the file manually :
 +
vim /etc/gconf/gconf.xml.mandatory/desktop/jolla/components/%gconf.xml
 +
and replace the angle "0" by "90".
 +
 
 +
The original command was:
 
  su nemo # to switch to nemo user
 
  su nemo # to switch to nemo user
 
  gconftool-2 --set /desktop/jolla/components/screen_rotation_angle --type int 90
 
  gconftool-2 --set /desktop/jolla/components/screen_rotation_angle --type int 90
Line 103: Line 47:
 
* reboot the system, press F12 to select boot from USB, and then it should boot to sailfish, with the graphical interface showing.
 
* reboot the system, press F12 to select boot from USB, and then it should boot to sailfish, with the graphical interface showing.
  
== Running the silica demo ==
+
== Install to hard disk with double boot ==
If the image has been prepared after a test with silica components demo has been run in the emulator, its files are already on the USB key.
+
This can be done after trying out the usb key (what I did), or directly without the USB key step (using the raw file of the Virtual machine). The following instruction are written from the usb key.
  
They can be runned from ssh. Connect as nemo however ! (if runned as root, the theme is not the good one, it falls back to a simpler one).
+
DISCLAIMER : Take care of what you are doing here, as you can erase a complete partition (maybe more) of your hard drive, or break the bootloader. Save your data first (I know I didn't, but don't do like me ! ;) ) and double check the command you are typing.
su nemo # if connected as root
+
 
cd /opt/sdk/bin/
+
In my case, the usb key was /dev/sdb1, and the availlable partition on my hard drive /dev/sda5, change the number to what you have.
  DISPLAY=:0 ./silicacomponentgallery
+
 
 +
Boot the device under your favorite linux distribution (Fedora in my case), and run the command (change sdaX by your partitition number):
 +
  sudo dd if=/dev/sdb1 of=/dev/sdaX bs=4M
 
   
 
   
 +
Then, for update grub2 configuration to add this to the boot menu:
 +
sudo cp /boot/grub2.grub.cfg /boot/grub2.grub.cfg.old # save the old config
 +
sudo grub2-mkconfig -o /boot/grub2.grub.cfg
 +
 +
It should display somewhere in the output:
 +
Found Mer release 0.2011 (Mer) on /dev/sdaX
 +
 +
Reboot, and select the Mer entry in the boot menu.
  
 
== Working parts ==
 
== Working parts ==
* Touchscreen (for a short moment)
+
* Touchscreen
* Touchpad (always)
+
* General sailfish interface
* General sailfish interface (for a moment)
+
* The silica component demo
* The silica component demo (some elements not shown, do not use the touchscreen)
+
* HDMI output (I plugged it to a 24" screen and got a mirror of the tablet screen)
 +
* Sound (at least when a pull up menu is triggered)
 +
 
 +
 
 +
Video of it running can be seen here : [http://youtu.be/EIkfaxzIKrM "Sailfish OS with Qt5/Wayland running on Packard Bell Butterfly Touch"]
 +
 
 +
== Known issues ==
 +
* If screen shut down (after a few seconds on the home screen), the only way to light it again is to type a key (shows command line), then touch the screen (show the graphical interface).
 +
 
 +
 
 +
= Interface with QtCreator =
 +
QtCreator can be used to compile and send the program to a remote device, not only the emulator.
 +
 
 +
== Change some rights on the device ==
 +
As the process to deploy the file is not exactly the same than with the emulator, some rights have to be changed, so that the sftp commands don't fail.
 +
sudo chmod og+w /usr/bin/
 +
sudo chmod og+w /usr/share
 +
sudo chmod og+w /usr/share/applications/
 +
The first is where the binary will be put, the second where a directory will be created to contains the app data, and the last is where the icon shortcut will be placed.
 +
 
 +
== Create a new Device ==
 +
In QtCreator menu "Options/Devices":
 +
* "Add"
 +
* "Generic Linux Device"
 +
* Connection data page:
 +
** Name : "Butterfly"
 +
** IP : "192.168.1.xxx"
 +
** User name : "nemo"
 +
** Authentication type : "Password"
 +
** User password : "nemo"
 +
 
 +
 
 +
== Create a new Kit ==
 +
In QtCreator menu "Options/Build & Run", in tab "Kits":
 +
* Select "MerSDK-sailfishOS-i486-x86"
 +
* "Clone"
 +
* select "Clone of MerSDK-sailfishOS-i486-x86" and change :
 +
** Name : "Butterfly"
 +
** Device type : "Generic Linux Device"
 +
** Device : "Butterfly"
 +
 
 +
== Add the kit to the project ==
 +
If the project is opened, click on the "Projects" icon on the left tab (CTRL+4 shortcut).
 +
Click "Add Kit", and select "Butterfly"
 +
 
 +
== Compile/Run ==
 +
Run the project as usual. Take care the kit "Buttefly" is selected
  
Here is a screen photo of the silica component demo, on the buttons page, running on the Butterfly Touch. (sorry for the bad quality, it is almost impossible to take a correct photo of this brilliant screen...):
+
== Debug ==
 +
Debugging seems to work (I never debugged a QML app yet, so don't know if it is fully functionnal).
 +
However, as stated in the SDK known issues (https://sailfishos.org/wiki/SDK_Alpha_Qt5_Known_Issues), to be able to do it, first run this command:
 +
sudo zypper in qt5-qtdeclarative-plugin-qmlinspector
 +
It will install the missing package that is needed.
  
[[File:SailFishOnButterflyTouch.jpg|500px]]
+
Then simply press "F5" or click on the debug button in QtCreator to build/deploy/run with debugging support. You can place breakpoints and see QML/js console messages.
  
 
== Known issues ==
 
== Known issues ==
* Touchpad works at the beginning, but quickly only change the cursor position, and don't interact with the interface
+
* icon is not shown : replace in the "Other files/HelloWorld.desktop" file the "Icon=" by one icon that exist, for example "icon-launcher-default" (default icon-launcher-gallery don't exist in the emulator)
* Interface seems to restart every 2 minutes, with segfaults in libQtGui.so for lipstick and mcompositer programs (messages can be seen from tty2), like below
+
* program crash when run from the icon : replace in the "Other files/HelloWorld.desktop" file the "Exec=" line by : "invoker --type=j -s /usr/bin/HelloWorld"
lipstick[2160]: segfault at 8 ip 6e3d7fec sp 77d49580 error 4 in libQtGui.so.4.8.3[6e1de000+af5000]
+
* cannot deploy as RPM, only by copying binaries (due to having selected a ""Generic Linux Device", and not a Mer Emulator)
mcompositor[...]: segfault at 8 ip ... sp ... error 4 in libQtGui.so.4.8.3[...+af5000]
+
* Some elements are not shown. All the "glowing" things for example don't appear (dots at the top left that are used as bread-crumbs, lines under text buttons). This is probably due to the interface not being hardware accelerated, as it really looks like it is all shader related functions that are not here ?
+
* Swipe from left to right or right to left doesn't give the app transparency to see the opened app and time or doesn"t put the application in background
+
* When using the silica component demo, hitting the touchscreen gives a segfault. Using the touchpad works.
+
* sensord log give a bunch of the following:
+
2013-03-10 15:04:59 [sensord] *WARNING* [nodebase.cpp:699:void NodeBase::setValid(bool)]: Node 'orientationsensor' state changed to invalid
+
2013-03-10 15:04:59 [sensord] *CRITICAL* [sensormanager.cpp:266:AbstractSensorChannel* SensorManager::addSensor(const QString&)]: orientationsensor instantiation failed
+
2013-03-10 15:04:59 [sensord] *WARNING* [sensormanager.cpp:202:void SensorManager::setError(SensorManagerError, const QString&)]: SensorManagerError: sensor has not been instantiated
+
This is also seen in the output of the silica component demo:
+
loaded the Generic plugin
+
Loaded the MeeGo sensor plugin
+
Requested sensor id ' "orientationsensor" ' interface not granted
+
Requested sensor id ' "orientationsensor" ' interface not granted
+

Latest revision as of 18:44, 4 August 2013

Work in progress. This is mostly inspired from the ExoPC tutorial, with adaptation for this hardware, and has been updated to use the Qt5/Wayland new SDK Alpha.

Contents

[edit] Install Sailfish SDK Emulator on ButterflyTouch

This page has instructions on how to install Sailfish SDK emulator on your Packard Bell Butterfly Touch.

It is a x86 (Intel SU4100 dual core x86_64) based laptop/tablet PC. It has a 11.6" resistive touch screen (1366x768). It uses a Intel GM45 Express Chipset.

[edit] Install Steps

[edit] USB key setup

  • Extract root filesystem from emulator virtualbox image
VBoxManage internalcommands converttoraw ~/SailfishOS/emulator/sailfishos.vdi sailfish.raw
  • Copy to flash key
sudo dd if=sailfish.raw of=/dev/sd* bs=4M
sync
  • Mount flash key
  • Edit /boot/extlinux/extlinux.conf to boot from sdb1 and add rootwait

[edit] Running on the ButterflyTouch

  • The following has been done with Ethernet cable plugged. Wifi activation could be added later on.
  • Place the USB key in ButteflyTouch
  • Boot, press F12 button to access boot device selection menu and select USB
  • Ctrl/Alt F2 - Login root/(no password)
  • sshd is already launched by default, but the root account needs a password to allow to connect to it [Edit : as user nemo is in the sudoers, it may not be needed, as nemo can do all this].
  • launch command "passwd", and set the password to nemo.

From now on, you can connect remotely to do the following (it allows copy/pasting the command from a browser and not typing by hand).

  • Edit /usr/lib/qt5/qml/Sailfish/Silica/ApplicationWindow.qml
//width: _transpose ? screen.height : screen.width
//height: _transpose ? screen.width : screen.height
width: 1366
height: 768
  • Put the display in portrait mode.

The original command don't work anymore, so edit the file manually :

vim /etc/gconf/gconf.xml.mandatory/desktop/jolla/components/%gconf.xml

and replace the angle "0" by "90".

The original command was:

su nemo # to switch to nemo user
gconftool-2 --set /desktop/jolla/components/screen_rotation_angle --type int 90
  • reboot the system, press F12 to select boot from USB, and then it should boot to sailfish, with the graphical interface showing.

[edit] Install to hard disk with double boot

This can be done after trying out the usb key (what I did), or directly without the USB key step (using the raw file of the Virtual machine). The following instruction are written from the usb key.

DISCLAIMER : Take care of what you are doing here, as you can erase a complete partition (maybe more) of your hard drive, or break the bootloader. Save your data first (I know I didn't, but don't do like me ! ;) ) and double check the command you are typing.

In my case, the usb key was /dev/sdb1, and the availlable partition on my hard drive /dev/sda5, change the number to what you have.

Boot the device under your favorite linux distribution (Fedora in my case), and run the command (change sdaX by your partitition number):

sudo dd if=/dev/sdb1 of=/dev/sdaX bs=4M

Then, for update grub2 configuration to add this to the boot menu:

sudo cp /boot/grub2.grub.cfg /boot/grub2.grub.cfg.old # save the old config
sudo grub2-mkconfig -o /boot/grub2.grub.cfg

It should display somewhere in the output:

Found Mer release 0.2011 (Mer) on /dev/sdaX

Reboot, and select the Mer entry in the boot menu.

[edit] Working parts

  • Touchscreen
  • General sailfish interface
  • The silica component demo
  • HDMI output (I plugged it to a 24" screen and got a mirror of the tablet screen)
  • Sound (at least when a pull up menu is triggered)


Video of it running can be seen here : "Sailfish OS with Qt5/Wayland running on Packard Bell Butterfly Touch"

[edit] Known issues

  • If screen shut down (after a few seconds on the home screen), the only way to light it again is to type a key (shows command line), then touch the screen (show the graphical interface).


[edit] Interface with QtCreator

QtCreator can be used to compile and send the program to a remote device, not only the emulator.

[edit] Change some rights on the device

As the process to deploy the file is not exactly the same than with the emulator, some rights have to be changed, so that the sftp commands don't fail.

sudo chmod og+w /usr/bin/
sudo chmod og+w /usr/share
sudo chmod og+w /usr/share/applications/

The first is where the binary will be put, the second where a directory will be created to contains the app data, and the last is where the icon shortcut will be placed.

[edit] Create a new Device

In QtCreator menu "Options/Devices":

  • "Add"
  • "Generic Linux Device"
  • Connection data page:
    • Name : "Butterfly"
    • IP : "192.168.1.xxx"
    • User name : "nemo"
    • Authentication type : "Password"
    • User password : "nemo"


[edit] Create a new Kit

In QtCreator menu "Options/Build & Run", in tab "Kits":

  • Select "MerSDK-sailfishOS-i486-x86"
  • "Clone"
  • select "Clone of MerSDK-sailfishOS-i486-x86" and change :
    • Name : "Butterfly"
    • Device type : "Generic Linux Device"
    • Device : "Butterfly"

[edit] Add the kit to the project

If the project is opened, click on the "Projects" icon on the left tab (CTRL+4 shortcut). Click "Add Kit", and select "Butterfly"

[edit] Compile/Run

Run the project as usual. Take care the kit "Buttefly" is selected

[edit] Debug

Debugging seems to work (I never debugged a QML app yet, so don't know if it is fully functionnal). However, as stated in the SDK known issues (https://sailfishos.org/wiki/SDK_Alpha_Qt5_Known_Issues), to be able to do it, first run this command:

sudo zypper in qt5-qtdeclarative-plugin-qmlinspector

It will install the missing package that is needed.

Then simply press "F5" or click on the debug button in QtCreator to build/deploy/run with debugging support. You can place breakpoints and see QML/js console messages.

[edit] Known issues

  • icon is not shown : replace in the "Other files/HelloWorld.desktop" file the "Icon=" by one icon that exist, for example "icon-launcher-default" (default icon-launcher-gallery don't exist in the emulator)
  • program crash when run from the icon : replace in the "Other files/HelloWorld.desktop" file the "Exec=" line by : "invoker --type=j -s /usr/bin/HelloWorld"
  • cannot deploy as RPM, only by copying binaries (due to having selected a ""Generic Linux Device", and not a Mer Emulator)
Personal tools