'프로그램 사용'에 해당되는 글 2311건

  1. 2022.02.23 uinput absolute mouse
  2. 2022.02.21 xmodmap
  3. 2022.02.21 uinput
  4. 2022.02.17 wayvnc 실행 실패
  5. 2022.02.16 wayland-scanner
  6. 2022.02.15 libvncserver 사용예
  7. 2022.02.14 lvm as ssd cache
  8. 2022.02.07 wayland wl_fixed_t 변수
  9. 2022.02.07 static link
  10. 2022.02.07 google coral with tpu, cpp 4
프로그램 사용/uinput2022. 2. 23. 14:55

 

[링크 : https://www.kernel.org/doc/Documentation/input/event-codes.txt]

[링크 : https://stackoverflow.com/questions/5190921/simulating-absolute-mouse-movements-in-linux-using-uinput]

 

+

2022.02.25

 

// uinput.h
#define UI_SET_EVBIT _IOW(UINPUT_IOCTL_BASE, 100, int)
#define UI_SET_KEYBIT _IOW(UINPUT_IOCTL_BASE, 101, int)
#define UI_SET_RELBIT _IOW(UINPUT_IOCTL_BASE, 102, int)
#define UI_SET_ABSBIT _IOW(UINPUT_IOCTL_BASE, 103, int)

#define UI_DEV_CREATE _IO(UINPUT_IOCTL_BASE, 1)
#define UI_DEV_DESTROY _IO(UINPUT_IOCTL_BASE, 2)
#define UI_DEV_SETUP _IOW(UINPUT_IOCTL_BASE, 3, struct uinput_setup)

// input-event-codes.h
#define EV_KEY 0x01
#define EV_REL 0x02
#define EV_ABS 0x03

#define REL_X 0x00
#define REL_Y 0x01

#define ABS_X 0x00
#define ABS_Y 0x01

[링크 : https://github.com/aosp-mirror/platform_bionic/blob/master/libc/kernel/uapi/linux/input-event-codes.h]

[링크 : https://github.com/torvalds/linux/blob/master/include/uapi/linux/uinput.h]

[링크 : https://github.com/nmelihsensoy/virtual-hid-tcp/blob/master/server/src/server.c]

'프로그램 사용 > uinput' 카테고리의 다른 글

uinput 터치 스크린 예제  (0) 2022.08.05
evbug - 키보드/마우스 입력 디버깅 하기  (0) 2022.08.05
uinput 장치 확인  (0) 2022.03.04
xmodmap  (0) 2022.02.21
uinput  (0) 2022.02.21
Posted by 구차니
프로그램 사용/uinput2022. 2. 21. 15:43

키코드 확인하는 명령어

여전..히 키코드와 키입력은 헷갈리네

 

$ xmodmap -pke
keycode   8 = Mode_switch NoSymbol Mode_switch
keycode   9 = Escape NoSymbol Escape
keycode  10 = 1 exclam 1 exclam
keycode  11 = 2 at 2 at
keycode  12 = 3 numbersign 3 numbersign
keycode  13 = 4 dollar 4 dollar
keycode  14 = 5 percent 5 percent
keycode  15 = 6 asciicircum 6 asciicircum
keycode  16 = 7 ampersand 7 ampersand
keycode  17 = 8 asterisk 8 asterisk
keycode  18 = 9 parenleft 9 parenleft
keycode  19 = 0 parenright 0 parenright
keycode  20 = minus underscore minus underscore
keycode  21 = equal plus equal plus
keycode  22 = BackSpace BackSpace BackSpace BackSpace
keycode  23 = Tab ISO_Left_Tab Tab ISO_Left_Tab
keycode  24 = q Q q Q
keycode  25 = w W w W
keycode  26 = e E e E
keycode  27 = r R r R
keycode  28 = t T t T
keycode  29 = y Y y Y
keycode  30 = u U u U
keycode  31 = i I i I
keycode  32 = o O o O
keycode  33 = p P p P

[링크 : https://forums.raspberrypi.com/viewtopic.php?t=21804]

'프로그램 사용 > uinput' 카테고리의 다른 글

uinput 터치 스크린 예제  (0) 2022.08.05
evbug - 키보드/마우스 입력 디버깅 하기  (0) 2022.08.05
uinput 장치 확인  (0) 2022.03.04
uinput absolute mouse  (0) 2022.02.23
uinput  (0) 2022.02.21
Posted by 구차니
프로그램 사용/uinput2022. 2. 21. 14:57

잘 되려나..

 

라즈베리에서 해당 디바이스가 root:root 라서 server를 root 권한으로 돌려야 한다.

$ ls -al /dev/uinput
crw------- 1 root root 10, 223 Jan 27 11:33 /dev/uinput

[링크 : https://01.org/linuxgraphics/gfx-docs/drm/input/uinput.html]

[링크 : https://github.com/nmelihsensoy/virtual-hid-tcp]

 

/usr/include/linux/input-event-codes.h 에서 KEY_로 시작하는 선언들 발견

 

+

2022.02.23

[링크 : https://www.freedesktop.org/software/libevdev/doc/latest/]

'프로그램 사용 > uinput' 카테고리의 다른 글

uinput 터치 스크린 예제  (0) 2022.08.05
evbug - 키보드/마우스 입력 디버깅 하기  (0) 2022.08.05
uinput 장치 확인  (0) 2022.03.04
uinput absolute mouse  (0) 2022.02.23
xmodmap  (0) 2022.02.21
Posted by 구차니
프로그램 사용/wayland2022. 2. 17. 12:04

weston 에서 억지로 빌드해서 돌렸더니 에러 똬닥!

# ./wayvnc
wl_registry@2: error 0: invalid version for global zxdg_output_manager_v1 (4): have 2, wanted 3
ERROR: Virtual Pointer protocol not supported by compositor.
ERROR: Failed to initialise wayland

 

이제 보니.. wlroots 기반의 wayland compositor에서 돌아가는 녀석이었군..

About
A VNC server for wlroots based Wayland compositors

[링크 : https://github.com/any1/wayvnc]

 

freedesktop.org 에서 관리하는 녀석

[링크 : https://gitlab.freedesktop.org/wlroots/wlroots/]

[링크 : https://github.com/swaywm/wlroots]

'프로그램 사용 > wayland' 카테고리의 다른 글

weston debug message  (0) 2022.03.18
weston drm atomic  (0) 2022.03.17
wayland-scanner  (0) 2022.02.16
wayland wl_fixed_t 변수  (0) 2022.02.07
wayvnc  (0) 2022.01.24
Posted by 구차니
프로그램 사용/wayland2022. 2. 16. 14:09

동일 이름의 xml 파일은 보이는데 헤더나 소스가 없어서

build 관련 스크립트를 뒤져보다 보니 빙고

./wayvnc/build/build.ninja:205:build protocols/libclient_protos.a.p/wlr-virtual-pointer-unstable-v1.h: CUSTOM_COMMAND ../protocols/wlr-virtual-pointer-unstable-v1.xml | /opt/toolchain/usr/bin/wayland-scanner

 

This tool is used to generate C headers & glue code from the Wayland protocol XML files discussed in chapter 2.3

[링크 : https://wayland-book.com/libwayland/wayland-scanner.html]

[링크 : https://makersweb.net/linux/18842]

'프로그램 사용 > wayland' 카테고리의 다른 글

weston drm atomic  (0) 2022.03.17
wayvnc 실행 실패  (0) 2022.02.17
wayland wl_fixed_t 변수  (0) 2022.02.07
wayvnc  (0) 2022.01.24
weston client 메모리 누수  (0) 2022.01.17
Posted by 구차니
프로그램 사용/VNC2022. 2. 15. 16:33

-lvncserver 해주고 나면 의외로 건드릴게 별로 없다.

 

#include <rfb/rfb.h>

int main(int argc,char** argv)
{                                                                
  rfbScreenInfoPtr server=rfbGetScreen(&argc,argv,400,300,8,3,4);
  if(!server)
    return 1;
  server->frameBuffer=(char*)malloc(400*300*4);
  rfbInitServer(server);           
  rfbRunEventLoop(server,-1,FALSE);
  return(0);
}

[링크 : https://github.com/LibVNC/libvncserver/blob/master/examples/simple.c]

'프로그램 사용 > VNC' 카테고리의 다른 글

libvncserver websocket example  (0) 2022.08.12
libvncserver 마우스 이벤트  (0) 2022.02.25
rfb(remote framebuffer) protocol  (0) 2022.01.26
gconf-editor / ubuntu 14.04 LTS vino + VNC 접속불가  (0) 2015.03.22
VNC web 버전?  (0) 2014.12.11
Posted by 구차니
프로그램 사용/LVM2022. 2. 14. 14:15

SSD + HDD로 구성해서 write back cache를 SSD에 적용가능하다고 들었는데

mdadm에서 하는게 아니라 lvm 에서 설정이 가능하다고 해서 검색

 

lvm 관련 명령어를 이용해 nvme/ssd 등을 생성하고

volume group에 묶고 해당 vg를 cachepool 로 등록하는 걸로 되는 것 같긴하다.

# pvcreate /dev/sda
# pvcreate /dev/nvme0n1
# pvcreate /dev/nvme1n1
# vgcreate vg_data1 /dev/sda /dev/nvme0n1 /dev/nvme1n1
# lvcreate -l 19071823 -n lv_data1 vg_data1 /dev/sda
# lvcreate -i2 -L 16G -n lv_cache_meta1 vg_data1 /dev/nvme0n1 /dev/nvme1n1
# lvcreate -i2 -I2048 -l 100%FREE -n lv_cache1 vg_data1 /dev/nvme0n1 /dev/nvme1n1
# lvconvert --type cache-pool /dev/vg_data1/lv_cache1 --poolmetadata /dev/vg_data1/lv_cache_meta1 --chunksize 2048
# lvconvert --type cache /dev/vg_data1/lv_data1 --cachepool /dev/vg_data1/lv_cache1
# dmsetup status

[링크 : https://umount.net/ssd-caching-dm-cache-setting/]

[링크 : https://jabriffa.wordpress.com/2019/08/23/using-a-ssd-to-cache-data-volume-on-ubuntu-18-04-lts/]

[링크 : https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/logical_volume_manager_administration/lvm_cache_volume_creation]

 

'프로그램 사용 > LVM' 카테고리의 다른 글

LVM 관리  (0) 2019.03.05
애증의.. LVM? centos 기본값 설치에서 변형했더니...  (0) 2019.03.05
lvm raid  (0) 2019.01.15
LVM - Logical Volumegroup Management  (0) 2009.01.22
Posted by 구차니

23bit 비트의 정수고 8bit의 십진수 정확도 라고 하니 먼가 감이 안오는데

 

0 ~ 8388608(2^23) 범위를

0  ~ 32768 로 사용한다는 것. (그럼 이론상 FHD 17*17개 UHD 8*8 까지 가능하려나)

 

정확도는 어떤 의미로 쓰려나.. 나중에 확대했을때를 대비해서 소수점 포인트를 주는건가?

 

/**
 * Fixed-point number
 *
 * A `wl_fixed_t` is a 24.8 signed fixed-point number with a sign bit, 23 bits
 * of integer precision and 8 bits of decimal precision. Consider `wl_fixed_t`
 * as an opaque struct with methods that facilitate conversion to and from
 * `double` and `int` types.
 */
typedef int32_t wl_fixed_t;

[링크 : https://code.woboq.org/qt5/include/wayland-util.h.html]

 

typedef int32_t wl_fixed_t;

static inline int wl_fixed_to_int(wl_fixed_t f)
{
    return f / 256;
}

static inline wl_fixed_t wl_fixed_from_int(int i)
{
    return i * 256;
}

[링크 : https://github.com/nobled/wayland/blob/master/src/wayland-util.h]

'프로그램 사용 > wayland' 카테고리의 다른 글

wayvnc 실행 실패  (0) 2022.02.17
wayland-scanner  (0) 2022.02.16
wayvnc  (0) 2022.01.24
weston client 메모리 누수  (0) 2022.01.17
wayland buffer  (0) 2022.01.13
Posted by 구차니
프로그램 사용/gcc2022. 2. 7. 16:07

전부 정적으로 묶고 일부만 동적으로 묶는거나

동적으로 묶을건 냅두고 필요한(나머지) 것을 정적으로 묶는거나 그게 그건가?

 

-static-libgcc 한다고 해서 glibc 버전 안 맞다고 발생하는 에러를 해결할 순 없다

[링크 : https://stackoverflow.com/questions/26304531]

 

[링크 : https://kldp.org/node/136157]

  [링크 : https://enst.tistory.com/entry/liblibcso6-version-GLIBC27-not-found]

 

 

[링크 : https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html]

  [링크 : https://www.codeproject.com/Questions/1241890/How-to-link-to-libc-statically]

 

-lm 버전 문제 있으면 걍 해당 라이브러리를 static link 해버리면 되니까!

$ g++ -std=c++11 -o classify classify.cc -I/home/pi/work/coral/libedgetpu/tflite/public -I/home/pi/work/coral/tensorflow -I/home/pi/work/coral/tensorflow/tensorflow/lite/tools/make/downloads/flatbuffers/include -L/home/pi/work/coral/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv7l/lib -L/home/pi/work/coral/pycoral/libedgetpu_bin/throttled/armv7a -ltensorflow-lite -static-libgcc -l:libedgetpu.so.1.0 -lpthread -ldl /usr/lib/arm-linux-gnueabihf/libm.a

[링크 : http://www.iamroot.org/xe/index.php?mid=Programming&document_srl=13406]

'프로그램 사용 > gcc' 카테고리의 다른 글

gcc vectorization 실패  (0) 2022.06.02
gcc / 문자열 선언  (0) 2022.03.17
구조체 타입과 변수명은 구분된다?  (0) 2021.11.18
gcc unsigned to signed upcast 테스트  (0) 2021.07.08
gcc vectorized loop  (0) 2021.06.30
Posted by 구차니

해당 cpp 예제는 label_image를 수정한 것 같고, 이미지는 bmp 24bit만 받아들일 수 있을 것으로 생각된다.

그리고 이미지는 알아서 resize 해주지 않아 244*244로 리사이즈 한 이미지를 넣어주어야 한다.

 

netron 웹 사이트에서  모델을 불러들여서 확인해보니 input tensor 사이즈가 [1,244,244,3] 이다.

 

아.. 놔.. threshold는 0~1 사이 실수로 입력해야 한다. (도움말 좀만 더 친절히 해줘 ㅠㅠ)

(대충 봐서 thread로 보고 4를 넣었으니 결과가 나올리가..)

./classify <model_file> <label_file> <image_file> <threshold>

 

그리고 edgetpu용으로 돌리나 일반용으로 돌리나 시간 차이가 좀 나긴 한데 무슨 차이인진 모르겠다.

$ time ./classify models/mobilenet_v2_1.0_224_inat_bird_quant.tflite models/inat_bird_labels.txt images/parrot_re.bmp 0.2
0.79297923 Ara macao (Scarlet Macaw)

real    0m3.914s
user    0m0.612s
sys     0m0.132s

 

쥐꼬리 만큼 줄긴했는데... user쪽이 많이 줄어들긴 했다.

$ time ./classify models/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite models/inat_bird_labels.txt images/parrot_re.bmp 0.1
0.79297923 Ara macao (Scarlet Macaw)

real    0m3.542s
user    0m0.108s
sys     0m0.171s

 

 

'프로그램 사용 > google coral' 카테고리의 다른 글

google coral with tpu, python  (0) 2022.02.07
edgetpu_c.h 파일 내용 분석  (0) 2022.02.07
tensorflow brace-enclosed initializer list  (4) 2022.02.07
google coral, tpu yolo  (0) 2022.01.27
coral tpu delegate example  (0) 2022.01.25
Posted by 구차니