프로그램 사용/wayland2022. 8. 17. 16:49

weston_screenshooter_shoot()을 따라오는데 영 어딜 파야 나올지 감이 안온다.

아무튼.. libweston의 screenshooter.c가 실제적으로 수행되는 부분 같은데

//git\include\libweston\libweston.h
int
weston_screenshooter_shoot(struct weston_output *output, struct weston_buffer *buffer,
   weston_screenshooter_done_func_t done, void *data);

//git\libweston\screenshooter.c
WL_EXPORT int
weston_screenshooter_shoot(struct weston_output *output,
   struct weston_buffer *buffer,
   weston_screenshooter_done_func_t done, void *data)
{
struct screenshooter_frame_listener *l;

if (!wl_shm_buffer_get(buffer->resource)) {
done(data, WESTON_SCREENSHOOTER_BAD_BUFFER);
return -1;
}

buffer->shm_buffer = wl_shm_buffer_get(buffer->resource);
buffer->width = wl_shm_buffer_get_width(buffer->shm_buffer);
buffer->height = wl_shm_buffer_get_height(buffer->shm_buffer);

if (buffer->width < output->current_mode->width ||
    buffer->height < output->current_mode->height) {
done(data, WESTON_SCREENSHOOTER_BAD_BUFFER);
return -1;
}

l = malloc(sizeof *l);
if (l == NULL) {
done(data, WESTON_SCREENSHOOTER_NO_MEMORY);
return -1;
}

l->buffer = buffer;
l->output = output;
l->done = done;
l->data = data;
l->listener.notify = screenshooter_frame_notify;
wl_signal_add(&output->frame_signal, &l->listener);
weston_output_disable_planes_incr(output);
weston_output_damage(output);

return 0;
}

 

아무튼 추적을 계속해보면 아래와 같이 event_loop에 wl_event_loop_add_idle() 실행해서 추가해주고 끝.

//git\libweston\compositor.c
static void
weston_schedule_surface_protection_update(struct weston_compositor *compositor)
{
struct content_protection *cp = compositor->content_protection;
struct wl_event_loop *loop;

if (!cp || cp->surface_protection_update)
return;
loop = wl_display_get_event_loop(compositor->wl_display);
cp->surface_protection_update = wl_event_loop_add_idle(loop,
       notify_surface_protection_change,
       compositor);
}

WL_EXPORT void
weston_output_disable_planes_incr(struct weston_output *output)
{
output->disable_planes++;
/*
 * If disable_planes changes from 0 to non-zero, it means some type of
 * recording of content has started, and therefore protection level of
 * the protected surfaces must be updated to avoid the recording of
 * the protected content.
 */
if (output->disable_planes == 1)
weston_schedule_surface_protection_update(output->compositor);
}

 

struct content_protection은 누가 만드나 하면서 따라가보니

weston_compositor_enable_content_protection() 함수에서 만들어 주고 해당 함수는

//git\libweston\content-protection.c
WL_EXPORT int
weston_compositor_enable_content_protection(struct weston_compositor *compositor)
{
struct content_protection *cp;

cp = zalloc(sizeof(*cp));
if (cp == NULL)
return -1;
cp->compositor = compositor;

compositor->content_protection = cp;
wl_list_init(&cp->protected_list);
if (wl_global_create(compositor->wl_display,
     &weston_content_protection_interface, 1, cp,
     bind_weston_content_protection) == NULL)
return -1;

cp->destroy_listener.notify = cp_destroy_listener;
wl_signal_add(&compositor->destroy_signal, &cp->destroy_listener);
cp->debug = weston_compositor_add_log_scope(compositor, "content-protection-debug",
    "debug-logs for content-protection",
    NULL, NULL, NULL);
return 0;
}

 

drm_backend_create() 시에 b->atomic_modeset 조건에 의해서 생성된다.

//git\libweston\backend-drm\drm.c
static struct drm_backend *
drm_backend_create(struct weston_compositor *compositor,
   struct weston_drm_backend_config *config)
{
if (b->atomic_modeset)
if (weston_compositor_enable_content_protection(compositor) < 0)
weston_log("Error: initializing content-protection "
   "support failed.\n");
}

 

 

이름이 비슷한건지 걸려나오는 다른 녀석.

//protocol\weston-screenshooter-client-protocol.h
#define WESTON_SCREENSHOOTER_SHOOT 0

static inline void
weston_screenshooter_shoot(struct weston_screenshooter *weston_screenshooter, struct wl_output *output, struct wl_buffer *buffer)
{
wl_proxy_marshal((struct wl_proxy *) weston_screenshooter,
 WESTON_SCREENSHOOTER_SHOOT, output, buffer);
}

 

 wl_proxy_marshall()은 또 멀까해서 따라가 보지만.. 답이 안나온다 -_ㅠ

//wayland-main\src\wayland-client.c
WL_EXPORT struct wl_proxy *
wl_proxy_marshal_array_constructor_versioned(struct wl_proxy *proxy,
     uint32_t opcode,
     union wl_argument *args,
     const struct wl_interface *interface,
     uint32_t version)
{
return wl_proxy_marshal_array_flags(proxy, opcode, interface, version, 0, args);
}

WL_EXPORT struct wl_proxy *
wl_proxy_marshal_array_constructor(struct wl_proxy *proxy,
   uint32_t opcode, union wl_argument *args,
   const struct wl_interface *interface)
{
return wl_proxy_marshal_array_constructor_versioned(proxy, opcode,
    args, interface,
    proxy->version);
}


WL_EXPORT void
wl_proxy_marshal(struct wl_proxy *proxy, uint32_t opcode, ...)
{
union wl_argument args[WL_CLOSURE_MAX_ARGS];
va_list ap;

va_start(ap, opcode);
wl_argument_from_va_list(proxy->object.interface->methods[opcode].signature,
 args, WL_CLOSURE_MAX_ARGS, ap);
va_end(ap);

wl_proxy_marshal_array_constructor(proxy, opcode, args, NULL);
}

 

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

wayland hdmi - touch 연결  (0) 2023.09.08
wayland atomic commit 패치?  (0) 2022.08.22
wayland glreadpixels 실패  (0) 2022.08.16
sway + wayvnc  (0) 2022.08.10
wayvnc 0.5 릴리즈  (0) 2022.08.09
Posted by 구차니
embeded/raspberry pi2022. 8. 17. 15:54

SPI 통신시

2MHz 클럭에 3200Hz / 1600Hz 사용 가능

 

I2C 통신시

400kHz(고속 i2c)일 경우 800 Hz

100kHz(표준 i2c) 200 Hz에

SPI
The maximum SPI clock speed is 5 MHz with 100 pF maximum loading, and the timing scheme follows clock polarity (CPOL) = 1 and clock phase (CPHA) = 1.

Use of the 3200 Hz and 1600 Hz output data rates is only recommended with SPI communication rates greater than or equal to 2 MHz. The 800 Hz output data rate is recommended only for communication speeds greater than or equal to 400 kHz, and the remaining data rates scale proportionally. For example, the minimum recommended communication speed for a 200 Hz output data rate is 100 kHz

I2C
Due to communication speed limitations, the maximum output data rate when using 400 kHz I2C is 800 Hz and scales linearly with a change in the I2C communication speed. For example, using I2C at 100 kHz would limit the maximum ODR to 200 Hz

 

4 wire는 CS / SCLK / SDI / SDO를 쓴다면

3 wire는 CS / SCLK / SDIO 로 쓰는 듯.

(SDIO Serial Data Input Output의 약자 Secure Digital I/O의 약자이기도 하니.. 주의!)

[링크 : https://www.analog.com/media/en/technical-documentation/data-sheets/ADXL345.pdf]

Posted by 구차니
embeded/raspberry pi2022. 8. 17. 12:46

핀 피치가 2.54mm가 아닌 2.00mm 인데다가 구멍이 반이 없어서 어떻게 땜을 해야하나 고민하다 전문가에게 토스~

역시 전문가의 손은 다르구만

 

VCC 는 3.3V 라는데

[링크 : https://os.mbed.com/users/edodm85/notebook/radio-fm-tea5767/]

 

TEA5767 칩 자체는 3.0 Typical, 5.0 Max 라서 5V를 넣어도 되지 않나 싶긴 한데.. 그래도 Max 니까.. 참아야겠...지?

AMS1117-3.3을 투입할 시간이 되겠군...

MPXO는 MPX 가 있냐 없냐를 출력해주려나?

[링크 : https://www.sparkfun.com/datasheets/Wireless/General/TEA5767.pdf]

'embeded > raspberry pi' 카테고리의 다른 글

라즈베리 파이4 apm 설치시 php 작동 안될 경우  (0) 2022.08.30
adxl345 spi  (0) 2022.08.17
rpi3b에서 wayvnc 빌드 + 실행하기  (0) 2022.08.10
raspberrypi wayland compositor 설정  (0) 2022.08.10
linux iio adc + rpi  (0) 2022.06.20
Posted by 구차니

독일 규격인가.. 어떻게 저런 약자가 나오는지 감이 안오는데?

Fachkreis Automobil (Automobile Expert Group)

[링크 : https://www.rosenberger.com/product/fakra/]

[링크 : https://www.everythingrf.com/community/what-is-fakra-connector]

[링크 : https://www.amphenolrf.com/connectors/fakra-connectors.html]

'하드웨어 > 커넥터 (Connector)' 카테고리의 다른 글

USB3.0 커넥터  (0) 2022.03.24
m.2 와 mini PCI-e  (0) 2022.01.26
M.2  (0) 2022.01.19
rotary joint / rotary unions  (0) 2017.07.12
micro usb 케이블 수리  (0) 2017.02.21
Posted by 구차니
프로그램 사용/wayland2022. 8. 16. 17:47

 

C Specification
void glReadPixels( GLint x,
GLint y,
GLsizei width,
GLsizei height,
GLenum format,
GLenum type,
GLvoid * data);
Parameters
x, y
Specify the window coordinates of the first pixel that is read from the frame buffer. This location is the lower left corner of a rectangular block of pixels.

width, height
Specify the dimensions of the pixel rectangle. width and height of one correspond to a single pixel.

[링크 : https://docs.gl/es3/glReadPixels]

 

static void
screenshooter_shoot(struct wl_client *client,
    struct wl_resource *resource,
    struct wl_resource *output_resource,
    struct wl_resource *buffer_resource)
{
struct wlsc_output *output = output_resource->data;
struct wl_buffer *buffer = buffer_resource->data;
if (!wl_buffer_is_shm(buffer))
return;
if (buffer->width < output->current->width ||
    buffer->height < output->current->height)
return;
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glReadPixels(0, 0, output->current->width, output->current->height,
     GL_RGBA, GL_UNSIGNED_BYTE,
     wl_shm_buffer_get_data(buffer));
}

[링크 : https://chromium.googlesource.com/chromiumos/third_party/wayland-demos/+/refs/heads/stabilize/compositor/screenshooter.c]

 

You can't take screenshots with glReadPixels!

[링크 : https://stackoverflow.com/questions/37149068/glreadpixels-function-returning-error-1282-gl-invalid-operation]

[링크 : https://stackoverflow.com/questions/44634621/glreadpixels-with-screen-pixels]

 

대충 짰는데 안되는 듯..

$ cat gl_cap.c
#include <stdio.h>
#include <GLES2/gl2.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>

void main()
{
                GLubyte color[1024*768*4];
                glReadPixels(0,0, 1024, 768, GL_RGBA, GL_UNSIGNED_BYTE, &color);
//              printf("R:%d G:%d B:%d A:%d", color[0], color[1], color[2], color[3]);
for(int y =0 ; y<768;y++)
for(int x =0 ; x < 1024; x++)
                printf("%4d,%3d R:%d G:%d B:%d A:%d\n", x,y
                        ,color[y*1024+x+0]
                        ,color[y*1024+x+1]
                        ,color[y*1024+x+2]
                        ,color[y*1024+x+3]
                );
}

 

링크는 아래와 같이 해주면 되긴 한데...

 -lwayland-egl -lGLESv2

 

흐으으으음...

# head dump
   0,  0 R:0 G:0 B:0 A:0
   1,  0 R:0 G:0 B:0 A:0
   2,  0 R:0 G:0 B:0 A:0
   3,  0 R:0 G:0 B:0 A:0
   4,  0 R:0 G:0 B:0 A:0
   5,  0 R:0 G:0 B:0 A:0
   6,  0 R:0 G:0 B:0 A:0
   7,  0 R:0 G:0 B:0 A:0
   8,  0 R:0 G:0 B:0 A:0
   9,  0 R:0 G:0 B:0 A:0
# tail dump
1014,767 R:0 G:0 B:0 A:0
1015,767 R:0 G:0 B:0 A:0
1016,767 R:0 G:0 B:0 A:0
1017,767 R:0 G:0 B:0 A:0
1018,767 R:0 G:0 B:0 A:0
1019,767 R:0 G:0 B:0 A:0
1020,767 R:0 G:0 B:0 A:0
1021,767 R:0 G:0 B:0 A:0
1022,767 R:0 G:0 B:0 A:0
1023,767 R:0 G:0 B:0 A:0

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

wayland atomic commit 패치?  (0) 2022.08.22
weston screen shooter 뜯어보기  (0) 2022.08.17
sway + wayvnc  (0) 2022.08.10
wayvnc 0.5 릴리즈  (0) 2022.08.09
capture drm screen  (0) 2022.08.08
Posted by 구차니
프로그램 사용/VNC2022. 8. 16. 15:02

에러별 디버그 메시지 출력 위치 추적중.

 

24/03/2021 11:06:09 rfbProcessClientNormalMessage: FixColourMapEntries unsupported
24/03/2021 11:06:09 Client 192.168.0.6 gone

[링크 : https://github.com/LibVNC/libvncserver/blob/master/libvncserver/rfbserver.c#L2270]

 

24/03/2021 10:55:30 hybiReadAndDecode: read; Resource temporarily unavailable24/03/2021 10:55:30 hybiReadAndDecode: read; Resource temporarily unavailable24/03/2021 10:55:30 hybiReadAndDecode: read; Resource temporarily unavailable24/03/2021 10:55:30 hybiReadAndDecode: read; Resource temporarily unavailable24/03/2021 10:55:30 hybiReadHeader: got frame without mask; ret=6
24/03/2021 10:55:30 hybiReadAndDecode: unhandled opcode 13, b0: 9d, b1: 41
24/03/2021 10:55:30 rfbProcessClientNormalMessage: read: Protocol error
24/03/2021 10:55:30 Client 192.168.0.6 gone

[링크 : https://github.com/LibVNC/libvncserver/blob/master/libvncserver/ws_decode.c#L374]

 

24/03/2021 11:09:19 Pixel format for client 192.168.0.6:
24/03/2021 11:09:19   87 bpp, depth 5, little endian
24/03/2021 11:09:19   true colour: max r 47360 g 20997 b 2, shift r 179 g 0 b 77
24/03/2021 11:09:19 rfbSetTranslateFunction: client bits per pixel not 8, 16 or 32
24/03/2021 11:09:19 Client 192.168.0.6 gone

[링크 : https://github.com/LibVNC/libvncserver/blob/master/libvncserver/translate.c#L261]

 

+

2022.08.17

rfbRunEventLoop() 에 인자를 TRUE를 주고(background 실행하도록)

main loop 에서 rfbProcessEvents() 을 통해서 처리하게 하다 보니(websocket 처리를 위해)

양쪽에서 fd를 읽어 가려하다보니 데이터가 정상적으로 가져가지지 않아 죽는 것으로 판명됨.

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

libvncserver 종료 절차  (0) 2022.11.01
libvncserver 로그인  (0) 2022.09.26
libvncserver websocket example  (0) 2022.08.12
libvncserver 마우스 이벤트  (0) 2022.02.25
libvncserver 사용예  (0) 2022.02.15
Posted by 구차니
프로그램 사용/VNC2022. 8. 12. 10:58

음.. libvncserver 라이브러리를 이용해서 간단하게 저 인자 하나 주고 만들면 되려나?

int main(int argc,char** argv)
{
  rfbScreenInfoPtr rfbScreen = rfbGetScreen(&argc,argv,maxx,maxy,8,3,bpp);
  if(!rfbScreen)
    return 1;
  rfbScreen->desktopName = "LibVNCServer Example";
  rfbScreen->frameBuffer = (char*)malloc(maxx*maxy*bpp);
  rfbScreen->alwaysShared = TRUE;
  rfbScreen->ptrAddEvent = doptr;
  rfbScreen->kbdAddEvent = dokey;
  rfbScreen->newClientHook = newclient;
  rfbScreen->httpDir = "../webclients";
  rfbScreen->httpEnableProxyConnect = TRUE;

  initBuffer((unsigned char*)rfbScreen->frameBuffer);
  rfbDrawString(rfbScreen,&radonFont,20,100,"Hello, World!",0xffffff);

  /* This call creates a mask and then a cursor: */
  /* rfbScreen->defaultCursor =
       rfbMakeXCursor(exampleCursorWidth,exampleCursorHeight,exampleCursor,0);
  */

  MakeRichCursor(rfbScreen);

  /* initialize the server */
  rfbInitServer(rfbScreen);

#ifndef BACKGROUND_LOOP_TEST
#ifdef USE_OWN_LOOP
  {
    int i;
    for(i=0;rfbIsActive(rfbScreen);i++) {
      fprintf(stderr,"%d\r",i);
      rfbProcessEvents(rfbScreen,100000);
    }
  }
#else
  /* this is the blocking event loop, i.e. it never returns */
  /* 40000 are the microseconds to wait on select(), i.e. 0.04 seconds */
  rfbRunEventLoop(rfbScreen,40000,FALSE);
#endif /* OWN LOOP */
#else
#if !defined(LIBVNCSERVER_HAVE_LIBPTHREAD) && !defined(LIBVNCSERVER_HAVE_WIN32THREADS)
#error "I need pthreads or win32 threads for that."
#endif
  /* catch Ctrl-C to set a flag for the main thread */
  signal(SIGINT, intHandler);
  /* this is the non-blocking event loop; a background thread is started */
  rfbRunEventLoop(rfbScreen,-1,TRUE);
  fprintf(stderr, "Running background loop...\n");
  /* now we could do some cool things like rendering in idle time */
  while (maintain_connection) {
      sleep(5); /* render(); */
  }
  fprintf(stderr, "\nShutting down...\n");
  rfbShutdownServer(rfbScreen, TRUE);
#endif /* BACKGROUND_LOOP */

  free(rfbScreen->frameBuffer);
  rfbScreenCleanup(rfbScreen);

  return(0);
}

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

[링크 : https://github.com/LibVNC/libvncserver]

 

+

먼가 되나 했더니 안되네..

일단은.. noVNC 에서는 ws://ip/websockify 라는 경로를 열려고 하는데

libvncserver.so 에서 해당 경로를 열어주는 부분이 없나...?

[링크 : https://github.com/novnc/websockify]

 

example은 libvncserver의 example/example.c 빌드해서 나온거

revind / revind.so / run / websockify 는 websockify 에서 나온거

libvncserver 와 noVNC와 websockify 의 조합으로 어찌 되긴 하는데..

~/libvncserver/webclients $ ls -al
total 64
drwxr-xr-x  4 pi pi  4096 Aug 12 11:44 .
drwxr-xr-x 16 pi pi  4096 Aug 12 11:03 ..
-rwxr-xr-x  1 pi pi 25372 Aug 12 11:02 example
-rw-r--r--  1 pi pi  1601 Aug 12 10:32 index.vnc
drwxr-xr-x 10 pi pi  4096 Aug 12 11:00 novnc
-rwxr-xr-x  1 pi pi   424 Aug 12 11:39 rebind
-rwxr-xr-x  1 pi pi  7508 Aug 12 11:39 rebind.so
-rwxr-xr-x  1 pi pi    78 Aug 12 11:39 run
drwxr-xr-x  3 pi pi  4096 Aug 12 11:28 websockify

 

인자는 아래와 같이 하고 실행!

$ ./run 5900 -- ./example

 

웹 브라우저에서 http://ip:5800 으로 접속하면 아래와 같이 뜨고

별다른 설정을 하지 않았다면 wss(websocket secure)를 안될테니 위에 "Click here to connect using noVNC"를 누른다.

 

약간의 시간을 기다리면(libvncserver의 웹 서버가 느린지 파일 전송이 좀 느리다)

아래와 같이 쨘~

 

 

+

한번 되더니 websockify 없이도 되네.. 머지?

 

 

+

runInBackground 의 값을 TRUE 로 해주면 웹 서버가 작동을 안한다 -_-

어떻게 해야 할까..

void rfbRunEventLoop ( rfbScreenInfoPtr  screenInfo,
long  usec,
rfbBool  runInBackground  
)

[링크 : http://libvncserver.sourceforge.net/doc/html/group__libvncserver__api.html#ga1f5f3116deec0ab6bb18208c2eb538e6]

 

+

2022.08.17

하하하 안되는게 당연한거 였... ㅠㅠ

static THREAD_ROUTINE_RETURN_TYPE
listenerRun(void *data)
{
    rfbScreenInfoPtr screen=(rfbScreenInfoPtr)data;
    int client_fd;
    struct sockaddr_storage peer;
    rfbClientPtr cl = NULL;
    socklen_t len;
    fd_set listen_fds;  /* temp file descriptor list for select() */

    /*
       Only checking socket state here and not using rfbIsActive()
       because: When rfbShutdownServer() is called by the client, it runs in
       the client-to-server thread's context, resulting in itself calling
       its own the pthread_join(), returning immediately, leaving the
       client-to-server thread to actually terminate _after_ the listener thread
       is terminated, leaving the client list still populated.
     */
    /* TODO: HTTP is not handled */
}

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

libvncserver 로그인  (0) 2022.09.26
libvncserver 접속 끊어짐 문제  (0) 2022.08.16
libvncserver 마우스 이벤트  (0) 2022.02.25
libvncserver 사용예  (0) 2022.02.15
rfb(remote framebuffer) protocol  (0) 2022.01.26
Posted by 구차니
프로그램 사용/uinput2022. 8. 11. 23:42

uinput 에서 절대값을 받기 위해서는 마우스가 아니라 터치로 인식을 시켜야 한다.

 

가장 도움을 받았던 문서가 오히려 함정 카드(?)였는데

1.7.4.2의 내용은 상대좌표를 이용하는 일반적인 마우스의 예라서

[링크 : https://www.kernel.org/doc/html/v4.12/input/uinput.html]

 

struct uinput_setup 구조체를 이용하고 있지만

struct uinput_setup {
struct input_id id;
char name[UINPUT_MAX_NAME_SIZE];
__u32 ff_effects_max;
};

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

 

터치패드의 경우(혹은 터치 스크린) 아래의 구조체 중 absmax, absmin 에  시작, 끝 좌표를 넣어 주어야 한다. 

ABS_CNT(64)가 왜 상당히 크게 잡혀있는지 모르겠지만

absmax[0] = WIDTH, absmax[1] = HEIGHT를 넣고 초기화 해주면 된다.

struct uinput_user_dev {
char name[UINPUT_MAX_NAME_SIZE];
struct input_id id;
__u32 ff_effects_max;
__s32 absmax[ABS_CNT];
__s32 absmin[ABS_CNT];
__s32 absfuzz[ABS_CNT];
__s32 absflat[ABS_CNT];
};

[링크 : https://elixir.bootlin.com/linux/v4.6/source/include/uapi/linux/uinput.h#L222]

 

VID와 PID 혹은 문자열이 영향을 주는진 모르겠다.

[링크 : https://github.com/bendahl/uinput/blob/master/touchpad.go#L172]

 

UI_DEV_SETUP을 ioctl을 이용하여 setup 하는게 아니라

/dev/uinput fd에 write() 함수로 써버리는 것이 EV_REL과의 차이라고 해야하나..?

void init_uinput_touchscreen()
{
    int ret = 0;
    struct uinput_user_dev usetup;
    int keys[] = {BTN_LEFT, BTN_RIGHT, BTN_TOUCH};

    int fd_touch = open("/dev/uinput", O_WRONLY | O_NONBLOCK);
    printf("fd[%d]\n", fd_touch);

    //Custom key events init
    ioctl(fd_touch, UI_SET_EVBIT, EV_KEY);
    for(int i = 0; i < sizeof(keys) / sizeof(int); i++){
        ioctl(fd_touch, UI_SET_KEYBIT, keys[i]);
    }

    //Mouse Pointer events init
    ret = ioctl(fd_touch, UI_SET_EVBIT, EV_ABS);
    printf("EV_ABS ret[%d]\n",ret);
    ret = ioctl(fd_touch, UI_SET_ABSBIT, ABS_X);
    printf("ABS_X ret[%d]\n",ret);
    ret = ioctl(fd_touch, UI_SET_ABSBIT, ABS_Y);
    printf("ABS_Y ret[%d]\n",ret);

    memset(&usetup, 0, sizeof(usetup));
    usetup.id.bustype = BUS_USB;
    usetup.id.vendor = 0x4711;
    usetup.id.product = 0x0817;
    strcpy(usetup.name, "TouchPad");
    usetup.absmax[0] = 1024;
    usetup.absmax[1] = 768;

    // ret = ioctl(fd_touch, UI_DEV_SETUP, &usetup);
    ret = write(fd_touch, &usetup, sizeof(struct uinput_user_dev));
    printf("UI_DEV_SETUP ret[%d]\n",ret);
    printf("sizeof %d\n",sizeof(struct uinput_user_dev));
    ret = ioctl(fd_touch, UI_DEV_CREATE);
    printf("UI_DEV_CREATE ret[%d]\n",ret);
}
Posted by 구차니
embeded/raspberry pi2022. 8. 10. 18:03

패키지 설치

$ sudo apt install cmake ninja meson libpixman-1-0 libpixman-1-dev libdrm-dev libdrm-common libdrm2 libxkbcommon-dev libwayland-dev

[링크 : https://github.com/ammen99/wf-recorder/issues/74]

 

ninja 설치

$ git clone https://github.com/ninja-build/ninja.git
$ cd ninja
$ ./configure.py --bootstrap

[링크 : https://ninja-build.org/]

 

git clone https://github.com/any1/wayvnc.git
git clone https://github.com/any1/neatvnc.git
git clone https://github.com/any1/aml.git

mkdir wayvnc/subprojects
cd wayvnc/subprojects
ln -s ../../neatvnc .
ln -s ../../aml .
cd -

mkdir neatvnc/subprojects
cd neatvnc/subprojects
ln -s ../../aml .
cd -

meson build
ninja -C build

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

 

+

sway를 실행하고

 

sway에서 터미널을 연 다음, wayvnc를 실행

 

tightVNC로 접속 확인.

 

어익 후 라즈베리 3b에서 cpu가 죽어나네

 

rpi3 같은 메모리 대역폭 후달리는 애도 잘 쓰도록 만들었다는데 머.. 3.3%면 양호한건가..

sway가 문제인가?

The OpenGL ES 2.0 based renderer has now been replaced with a pixman based renderer. The new renderer is both simpler and performs better on devices with poor memory bandwidth such as the Raspberry Pi 3.

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

 

+

22.08.11

rpi 4 에서 실행하니 cpu가 착해진다. openGL ES 성능 차이인가..

'embeded > raspberry pi' 카테고리의 다른 글

adxl345 spi  (0) 2022.08.17
tea5767 모듈 땜질  (0) 2022.08.17
raspberrypi wayland compositor 설정  (0) 2022.08.10
linux iio adc + rpi  (0) 2022.06.20
PI 400 써봄  (0) 2022.05.25
Posted by 구차니
프로그램 사용/wayland2022. 8. 10. 16:41

 

sway와 wayfire 라는 녀석이 wlroot 기반의 compositor 인 듯.

 

일단~~은 sway 패키지를 설치하고

$ sudo apt install sway

[링크 : https://installati.one/ubuntu/21.04/sway/]


wayvnc 설치(ubuntu 22.04 LTS/x86)

$ sudo apt install wayvnc

 

로그아웃 후에 세션을 sway로 변경

[링크 : https://llandy3d.github.io/sway-on-ubuntu/]

[링크 : https://www.slant.co/topics/11023/versus/~sway_vs_wayfire_vs_weston]

 

"윈 + D" 누르고 terminal 친 후 방향키로 gnome-terminal 선택 + enter

혹은 "윈 + enter"

 

요건 심심해서 htop 실행. i7-3635QM 이긴 한데

sway와 wayvnc가 동일하게 1.3% 씩 먹는 상황. 이걸 낮다고 봐야하나 높다고 봐야하나..

[링크 : https://swaywm.org/]

[링크 : https://wiki.archlinux.org/title/Sway]

 

터미널에서 wayvnc 접속가능하도록 실행

$ wayvnc 0.0.0.0

 

 

+

sway 단축키

super - shift - space (타일/창 전환)
super - e (가로 / 세로 타일 배치 전환)
super - h (창 전환)
super - enter (터미널 열기)
super - d (프로그램 실행?)

 

+

로그아웃

방법을 못 찾아서, sway 프로세스 kill 하고 다시 로그인 함 -_-

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

weston screen shooter 뜯어보기  (0) 2022.08.17
wayland glreadpixels 실패  (0) 2022.08.16
wayvnc 0.5 릴리즈  (0) 2022.08.09
capture drm screen  (0) 2022.08.08
weston redraw 취소하기  (0) 2022.07.07
Posted by 구차니