Forum
[PROBLEM] Waveshare5/Sainsmart 7" HDMI with GPIO touch - Printable Version

+- Forum (http://forum.xbian.org)
+-- Forum: Hardware (/forum-7.html)
+--- Forum: Video and Audio (/forum-28.html)
+--- Thread: [PROBLEM] Waveshare5/Sainsmart 7" HDMI with GPIO touch (/thread-3849.html)

Pages: 1 2


RE: Waveshare5/Sainsmart 7" HDMI with GPIO touch - Matt Larose - 1st Nov, 2016 08:53 AM

(1st Nov, 2016 04:49 AM)Nachteule Wrote:  Oh yes, you're right. Those libs are not longer part of Debian Jessie Sad

But - you do not need all that library stuff for Kodi Smile

Just tested, I only had to add following lines to file /home/xbian/.kodi/userdata/advancedsettings.xml,

Code:
<touchscreen>
    <x_offset>-32</x_offset> <!-- cursor pixel x offset -->
    <y_offset>-35</y_offset> <!-- cursor pixel y offset -->
    <x_stretch_factor>0.209</x_stretch_factor> <!-- stretch factor -->
    <y_stretch_factor>0.131</y_stretch_factor> <!-- stretch factor -->
</touchscreen>

modifying file /usr/local/share/kodi/system/keymaps/mouse.xml [1]

and restart Kodi (v17! from devel repo)

[1] would be good idea to copy this file into folder /home/xbian/.kodi/userdata/keymaps and edit it there

Sounds promising, however I'm confused as to the modifying mouse.XML file - what kind of modifying?
I'll test this out tonight.


RE: Waveshare5/Sainsmart 7" HDMI with GPIO touch - Matt Larose - 1st Nov, 2016 01:59 PM

Alright, so far, what I've done:
Updated to kodi v17 via the devel repo.
Edited advanced settings:
sudo nano /home/xbian/.kodi/userdata/advancedsettings.xml
I copied this text:
<touchscreen>
<x_offset>-32</x_offset> <!-- cursor pixel x offset -->
<y_offset>-35</y_offset> <!-- cursor pixel y offset -->
<x_stretch_factor>0.209</x_stretch_factor> <!-- stretch factor -->
<y_stretch_factor>0.131</y_stretch_factor> <!-- stretch factor -->
</touchscreen>
Into that file, and saved it.
I then opened the /usr/local/share/kodi/system/keymaps/mouse.xml file,
And copied the text:
<mouse>
<leftclick>leftclick</leftclick>
<rightclick>rightclick</rightclick>
<middleclick>middleclick</middleclick>
<doubleclick id="0">noop</doubleclick>
<longclick id="0">contextmenu</longclick>
<wheeldown>wheeldown</wheeldown>
<wheelup>wheelup</wheelup>
<mousedrag>mousedrag</mousedrag>
<mousedragend>leftclick</mousedragend>
<mousemove>noop</mousemove>
</mouse>
Into it. Saved, exited, rebooted.

No dice. The mouse now doesn't work AT ALL. Before I edited the mouse.xml file, I could get some kind of control from the upper left of the screen....now, nothing.
I may have completely messed up my mouse.xml file....how do I get the original back?!


RE: Waveshare5/Sainsmart 7" HDMI with GPIO touch - Nachteule - 1st Nov, 2016 10:24 PM

What did you do exactly?

I suppose you just added the lines to the end of the files /home/xbian/.kodi/userdata/advancedsettings.xml and /usr/local/share/kodi/system/keymaps/mouse.xml

ExclamationExclamationExclamation That is definitively wrong ExclamationExclamationExclamation

Here is my working version of mouse.xml and advancedsettings.xml:

mouse.xml:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!-- This file contains the mapping of mouse keys to actions within Kodi.                 -->
<!--                                                                                      -->
<!-- The format is:                                                                       -->
<!--  <window>                                                                            -->
<!--    <device>                                                                          -->
<!--      <button>action</button>                                                         -->
<!--    </device>                                                                         -->
<!--  </window>                                                                           -->
<!--                                                                                      -->
<!-- The <global> section is a fall through - they will only be used if the button is     -->
<!-- not used in the current window's section.                                            -->
<!--                                                                                      -->
<!-- Actions can be built-in functions.                                                   -->
<!--  eg <middleclick>ActivateWindow(Music)</middleclick>                                 -->
<!-- would automatically go to Music on the press of the middle mouse button.             -->
<!--                                                                                      -->
<!--                                                                                      -->
<!-- An empty action removes the corresponding mapping from default and parent keymaps.   -->
<!-- This is different from a "noop" action, which disables a button.                     -->
<!--                                                                                      -->
<!--  Button Ids:                                                                         -->
<!--    0: left                                                                           -->
<!--    1: right                                                                          -->
<!--    2: middle                                                                         -->
<!--    3/4/5/6: extra                                                                    -->
<!--                                                                                      -->
<!-- More documentation on keymaps can be found on http://kodi.wiki/view/keymaps          -->
<keymap>
  <global>
    <mouse>
      <leftclick>leftclick</leftclick>
      <rightclick>rightclick</rightclick>
      <middleclick>middleclick</middleclick>
      <doubleclick id="0">noop</doubleclick>
      <longclick id="0">contextmenu</longclick>
      <wheeldown>wheeldown</wheeldown>
      <wheelup>wheelup</wheelup>
      <mousedrag>mousedrag</mousedrag>
      <mousedragend>leftclick</mousedragend>
      <mousemove>noop</mousemove>
    </mouse>
  </global>
  <SlideShow>
    <mouse>
      <leftclick>Pause</leftclick>
      <rightclick>PreviousMenu</rightclick>
      <wheelup>PreviousPicture</wheelup>
      <wheeldown>NextPicture</wheeldown>
    </mouse>
  </SlideShow>
  <FullscreenVideo>
    <mouse>
      <rightclick>Info</rightclick>
    </mouse>
  </FullscreenVideo>
</keymap>

You can use this mouse.xml as it is. And again: would be good idea to copy this file into folder /home/xbian/.kodi/userdata/keymaps and edit it there because if you don't, those changes will be overwitten by xbian-package-xbmc update


advancedsettings.xml:

Code:
<advancedsettings>
    <loglevel hide="false">1</loglevel>

    <network>
        <buffermode>0</buffermode>
        <cachemembuffersize>20971520</cachemembuffersize>
        <readbufferfactor>5</readbufferfactor>
    </network>

    <fanartres>720</fanartres>
    <imageres>540</imageres>
    <gputempcommand>echo "$(/opt/vc/bin/vcgencmd measure_temp | grep -o "[0-9]\{2\}") C"</gputempcommand>
    <cputempcommand>echo "$(/opt/vc/bin/vcgencmd measure_temp | grep -o "[0-9]\{2\}") C"</cputempcommand>
    <lookandfeel>
         <webserver>true</webserver>
         <guires>720</guires>
    </lookandfeel>
    <bginfoloadermaxthreads>5</bginfoloadermaxthreads>
    <video>
        <smallstepbackseconds>10</smallstepbackseconds>
        <usetimeseeking>true</usetimeseeking>               <!-- Whether to use time based or percentage based seeking. -->
        <timeseekforward>30</timeseekforward>               <!-- Time to seek forward in seconds when doing a short seek.  Defaults to 30. -->
        <timeseekbackward>-30</timeseekbackward>            <!-- Time to seek backward in seconds when doing a short seek.  Defaults to -30. -->
        <timeseekforwardbig>300</timeseekforwardbig>        <!-- Time to seek forward in seconds when doing a long seek.  Defaults to 600 (10 minutes). -->
        <timeseekbackwardbig>-300</timeseekbackwardbig>     <!-- Time to seek forward in seconds when doing a long seek.  Defaults to -600 (10 minutes). -->
  
        <excludefromlisting>                                <!-- Regular expressions that if evaluated to true won't be displayed in Files View -->
            <regexp>[-\._ ](working)</regexp>
            <regexp>[-\._ ](pyLoad)</regexp>
            <regexp>(subs)</regexp>
            <regexp>[-\._ ](sample|trailer)[-\._ ]</regexp>
         </excludefromlisting>
    </video>

    <pvr>
        <minvideocachelevel>5</minvideocachelevel>          <!-- Cache up to this level in the video buffer buffer before resuming playback if the buffers run dry. -->
        <minaudiocachelevel>5</minaudiocachelevel>          <!-- Cache up to this level in the audio buffer before resuming playback if the buffers run dry. -->
        <cacheindvdplayer>false</cacheindvdplayer>          <!-- Cache PVR stream in DVDPlayer. -->
    </pvr>    
    
    <gui>
        <algorithmdirtyregions>3</algorithmdirtyregions>
        <nofliptimeout>0</nofliptimeout>
        <visualizedirtyregions>false</visualizedirtyregions>
    </gui>
    <destroywindowcontrols>0</destroywindowcontrols>
    <useddsfanart>0</useddsfanart>

    <videodatabase>
        <type>mysql</type>
        <host>192.168.1.6</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xbmc</pass>
    </videodatabase>

    <musicdatabase>
        <type>mysql</type>
        <host>192.168.1.6</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xbmc</pass>
    </musicdatabase>

    <videolibrary>
        <importwatchedstate>true</importwatchedstate>
    </videolibrary>

    <touchscreen>
        <x_offset>-32</x_offset> <!-- cursor pixel x offset -->
        <y_offset>-35</y_offset> <!-- cursor pixel y offset -->
        <x_stretch_factor>0.209</x_stretch_factor> <!-- stretch factor -->
        <y_stretch_factor>0.131</y_stretch_factor> <!-- stretch factor -->
    </touchscreen>
</advancedsettings>

Note: Please do NOT replace my advancedsettings.xml with your version it is just an example how to insert the touchscreen section into this file (before !!! </advancedsettings> and not behind)


RE: Waveshare5/Sainsmart 7" HDMI with GPIO touch - Matt Larose - 11th Apr, 2018 01:03 PM

I absolutely HATE to revive a long dead thread.
However: This is a problem again.
I have the exact same setup from my initial problem, Except Now I've reinstalled the latest xbian for Rpi3, and changed the pi2 to a pi3.
I'm trying to run the Sainsmart 7" touchscreen with the latest xbian.

I tried booting it without doing anything, it runs, but the screen doesn't display. Plug into a tv, it works fine.
SSH into the box, add the /boot.config.txt configuration, boot plugged into a tv, change the resolution, And the screen works great!

Cannot get the touch screen working properly. I remembered this thread, and I had it working on the jukebox I made, but the same steps taken have no effect - the touch screen senses touch, but the cursor is all over the place.

HELP?