研發(fā)課堂丨帶你配置OK3399-C開發(fā)板Ubuntu雙屏顯示&異觸

原創(chuàng) 2021-01-29 10:57:00 RK3399


本文以飛凌嵌入式RK3399開發(fā)板為基礎(chǔ)講解,主要介紹了Ubuntu系統(tǒng)下雙屏顯示及異觸,其它RK3399平臺(tái)請(qǐng)參考使用!

文章目錄

xrandr命令

雙屏擴(kuò)展顯示

xinput命令

雙屏異觸

xrandr命令

“xrandr”是一款官方的 RandR擴(kuò)展配置工具,它可以設(shè)置屏幕顯示的大小、方向、鏡像等。對(duì)于多屏幕顯示的情況,可以使用xrandr進(jìn)行管理。

參考鏈接:
https://wiki.archlinux.org/index.php/xrandr_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)


forlinx@forlinx:~$ xrandr --help
usage: xrandr [options]
  where options are:
  --display <display> or -d <display>
  --help
  -o <normal,inverted,left,right,0,1,2,3>
            or --orientation <normal,inverted,left,right,0,1,2,3>
  -q        or --query
  -s <size>/<width>x<height> or --size <size>/<width>x<height>
  -r <rate> or --rate <rate> or --refresh <rate>
  -v        or --version
  -x        (reflect in x)
  -y        (reflect in y)
  --screen <screen>
  --verbose
  --current
  --dryrun
  --nograb
  --prop or --properties
  --fb <width>x<height>
  --fbmm <width>x<height>
  --dpi <dpi>/<output>
  --output <output>
      --auto
      --mode <mode>
      --preferred
      --pos <x>x<y>
      --rate <rate> or --refresh <rate>
      --reflect normal,x,y,xy
      --rotate normal,inverted,left,right
      --left-of <output>
      --right-of <output>
      --above <output>
      --below <output>
      --same-as <output>
      --set <property> <value>
      --scale <x>x<y>
      --scale-from <w>x<h>
      --transform <a>,<b>,<c>,<d>,<e>,<f>,<g>,<h>,<i>
      --off
      --crtc <crtc>
      --panning <w>x<h>[+<x>+<y>[/<track:w>x<h>+<x>+<y>[/<border:l>/<t>/<r>/<b>]]]
      --gamma <r>:<g>:<b>
      --brightness <value>
      --primary
  --noprimary
  --newmode <name> <clock MHz>
            <hdisp> <hsync-start> <hsync-end> <htotal>
            <vdisp> <vsync-start> <vsync-end> <vtotal>
            [flags...]
            Valid flags: +HSync -HSync +VSync -VSync
                         +CSync -CSync CSync Interlace DoubleScan
  --rmmode <name>
  --addmode <output> <name>
  --delmode <output> <name>
  --listproviders
  --setprovideroutputsource <prov-xid> <source-xid>
  --setprovideroffloadsink <prov-xid> <sink-xid>
  --listmonitors
  --listactivemonitors
  --setmonitor <name> {auto|<w>/<mmw>x<h>/<mmh>+<x>+<y>} {none|<output>,<output>,...}
  --delmonitor <name>


雙屏擴(kuò)展顯示

OK3399-C Ubuntu系統(tǒng)支持xrandr命令管理多屏擴(kuò)展顯示。同時(shí)接入eDP屏幕和HDMI屏幕,系統(tǒng)會(huì)默認(rèn)非熱插拔顯示設(shè)備作為主屏,所以eDP會(huì)被識(shí)別為primary screen。默認(rèn)會(huì)設(shè)置兩個(gè)屏幕為擴(kuò)展顯示。



forlinx@forlinx:~$ xrandr
Screen 0: minimum 320 x 200, current 2560 x 1440, maximum 8192 x 8192
eDP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 276mm x 156mm
   1920x1080     60.00*+
HDMI-1 connected 2560x1440+0+0 (normal left inverted right x axis y axis) 597mm x 336mm
   2560x1440     59.95* 
   1920x1080     60.00    50.00    59.94  
   1680x1050     59.88  
   1280x1024     75.02    60.02  
   1440x900      59.90  
   1280x960      60.00  
   1280x720      60.00    50.00    59.94  
   1024x768      75.03    70.07    60.00  
   832x624       74.55  
   800x600       72.19    75.00    60.32    56.25  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       75.00    72.81    66.67    60.00    59.94  
   720x400       70.08


可以使用xrandr在兩個(gè)屏幕中選擇哪個(gè)做主屏,哪個(gè)做副屏。


xrandr --output eDP-1 --right-of HDMI-1 --auto
也可以將兩個(gè)屏幕設(shè)置成同顯


xrandr --output HDMI-1 --same-as eDP-1 --auto

xinput命令

xinput命令用于管理系統(tǒng)的輸入設(shè)備。

forlinx@forlinx:~$ xinput --help
usage :
        xinput get-feedbacks <device name>
        xinput set-ptr-feedback <device name> <threshold> <num> <denom>
        xinput set-integer-feedback <device name> <feedback id> <value>
        xinput get-button-map <device name>
        xinput set-button-map <device name> <map button 1> [<map button 2> [...]]
        xinput set-pointer <device name> [<x index> <y index>]
        xinput set-mode <device name> ABSOLUTE|RELATIVE
        xinput list [--short || --long || --name-only || --id-only] [<device name>...]
        xinput query-state <device name>
        xinput test [-proximity] <device name>
        xinput create-master <id> [<sendCore (dflt:1)>] [<enable (dflt:1)>]
        xinput remove-master <id> [Floating|AttachToMaster (dflt:Floating)] [<returnPointer>] [<returnKeyboard>]
        xinput reattach <id> <master>
        xinput float <id>
        xinput set-cp <window> <device>
        xinput test-xi2 [--root] <device>
        xinput map-to-output <device> <output name>
        xinput list-props <device> [<device> ...]
        xinput set-int-prop <device> <property> <format (8, 16, 32)> <val> [<val> ...]
        xinput set-float-prop <device> <property> <val> [<val> ...]
        xinput set-atom-prop <device> <property> <val> [<val> ...]
        xinput watch-props <device>
        xinput delete-prop <device> <property>
        xinput set-prop <device> [--type=atom|float|int] [--format=8|16|32] <property> <val> [<val> ...]
        xinput disable <device>
        xinput enable <device>


分別插入了“wch.cn USB2IIC CTPCONTROL”和“ILITEK ILITEK-TP”兩個(gè)USB電容觸摸屏。


forlinx@forlinx:~$ xinput
? Virtual core pointer                          id=2    [master pointer  (3)]
?   ? Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
?   ? wch.cn USB2IIC_CTP_CONTROL                id=9    [slave  pointer  (2)]
?   ? ILITEK ILITEK-TP                          id=6    [slave  pointer  (2)]
? Virtual core keyboard                         id=3    [master keyboard (2)]
    ? Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ? rk_headset                                id=7    [slave  keyboard (3)]
    ? rk29-keypad                               id=8    [slave  keyboard (3)]
    ? InputEmulator                             id=10   [slave  keyboard (3)]


雙屏異觸

使用xinput對(duì)觸摸設(shè)備和顯示設(shè)備進(jìn)行綁定。ILITEK ILITEK-TP觸摸設(shè)備的id是6,將其與eDP-1綁定。wch.cn USB2IIC CTPCONTROL觸摸設(shè)備的id是9,將其與HDMI-1綁定。


forlinx@forlinx:~$ xinput map-to-output 6 eDP-1
forlinx@forlinx:~$ xinput map-to-output 9 HDMI-1


這樣就可以實(shí)現(xiàn)RK3399下雙屏異觸了。測(cè)試了一下,兩個(gè)屏幕各自的觸摸效果還不錯(cuò)。

▼效果如下:


以上就是小編給大家分享的內(nèi)容,希望能夠幫到您。

進(jìn)入飛凌嵌入式官網(wǎng),了解關(guān)于OK3399-C開發(fā)板的更多信息。




相關(guān)產(chǎn)品 >

  • FET3399-C核心板

    飛凌RK3399安卓高性能核心板采用 采用六核Rockchip RK3399芯片,雙Cortex-A72大核+四Cortex-A53小核結(jié)構(gòu),對(duì)整數(shù)、浮點(diǎn)、內(nèi)存等作了大幅優(yōu)化,在整體性能、功耗及核心面積三個(gè)方面提升。以下將對(duì)瑞芯微芯片RK3399參數(shù),RK3399核心板方案及其性能做具體介紹。如您對(duì)飛凌RK3399系列核心板有興趣,歡迎咨詢了解。

    了解詳情
    FET3399-C核心板
  • OK3399-C開發(fā)板

    飛凌嵌入式RK3399安卓開發(fā)板主芯片采用高性能六核CPU Rockchip RK3399,GPU采用Mail-T860四核 GPU,RK3399作為目RK產(chǎn)品線中低功耗、高性能的代表,可滿足人臉識(shí)別設(shè)備、機(jī)器人、無(wú)人機(jī)、IoT物聯(lián)網(wǎng)領(lǐng)域應(yīng)用。飛凌RK3399開發(fā)板在整體性能、功耗及核心面積做了大幅度優(yōu)化,更加滿足工業(yè)設(shè)計(jì)需求。飛凌RK3399開發(fā)板為進(jìn)一步減少用戶二次開發(fā)難度,開放了底板原理圖,并提供了RK3399用戶手冊(cè)、芯片手冊(cè),加上優(yōu)質(zhì)的技術(shù)服務(wù),讓您的方案從構(gòu)思到上市時(shí)間縮短。

    了解詳情
    OK3399-C開發(fā)板

推薦閱讀 換一批 換一批