#
#asahi-dev · 2022-12-02 04:10
chadmedyeah
#asahi-dev · 2022-12-02 04:10
tpw_rulescertainly a lot less likely than in C but it's not absolutely impossible. just saying you would have to register a separate signal handler for that case
#asahi-dev · 2022-12-02 04:09
chadmedand we dont use the mixer or pcm alsa lib interfaces which are the ones prone to such nonsense
#asahi-dev · 2022-12-02 04:09
chadmedyeah but ideally the daemon itself should never segfault
#asahi-dev · 2022-12-02 04:08
tpw_rules(though a real segfault will not go through the panic mechanism)
#asahi-dev · 2022-12-02 04:08
tpw_rulesand save you if some library or the runtime itself explodes
#asahi-dev · 2022-12-02 04:08
chadmedah and that would negate the need for those superfluous exit()s
#asahi-dev · 2022-12-02 04:07
tpw_rulesthe fail() function, yes. instead of calling it
#asahi-dev · 2022-12-02 04:07
chadmedso i hook that into panic!
#asahi-dev · 2022-12-02 04:07
chadmedthats what helpers::fail() will do eventually
#asahi-dev · 2022-12-02 04:07
tpw_rulesyou would also want to register a panic hook to do your emergency ioctl
#asahi-dev · 2022-12-02 04:06
tpw_rulesnot sure off the top of my head how to best put the device name in there
#asahi-dev · 2022-12-02 04:06
tpw_rulese.g. all of https://github.com/chadmed/speakersafetyd/blob/main/src/types.rs#L138-L145 would idiomatically be let val: i32 = self.level.val.get_integer(0).expect("level is readable")
#asahi-dev · 2022-12-02 04:06
chadmedoh right
#asahi-dev · 2022-12-02 04:06
tpw_rulesi mean doing it idiomatically
#asahi-dev · 2022-12-02 04:06
chadmedwhat needs more handling
#asahi-dev · 2022-12-02 04:05
tpw_ruleslook into error handling
#asahi-dev · 2022-12-02 04:05
chadmedi know it needs major work
#asahi-dev · 2022-12-02 04:05
chadmedyes absolutely thats why i posted it :P
#asahi-dev · 2022-12-02 04:04
tpw_rulesalso are you ready for rust criticism
#asahi-dev · 2022-12-02 04:04
chadmedthe keepalive would only be useful in the case of the daemon segfaulting (should be impossible) or being forced dead by oomd or whatever
#asahi-dev · 2022-12-02 04:03
chadmedit depends on exactly what we're trying to prevent from happening. if the daemon encounters a runtime error (all possible ones are currently handled) then it can just send a single IOCTL to the driver to enable codec safe mode
#asahi-dev · 2022-12-02 04:02
tpw_rulesisn't that exactly when you would want the check to fire though?
#asahi-dev · 2022-12-02 04:01
chadmedbecause the driver would have to be running a time check on the last access to the IOCTL. how would that play out with suspend etc?
#asahi-dev · 2022-12-02 04:00
tpw_rules"This seems like it would suck to implement." why?
#asahi-dev · 2022-12-02 03:56
chadmedan attempt was made but im not sure how good it is. it builds and it runs and its fast but idk if its very "rust"y
#asahi-dev · 2022-12-02 03:55
chadmedhttps://github.com/chadmed/speakersafetyd
#asahi-dev · 2022-12-01 17:20
dsharshakovAnd then things go much complex since it will also need to keep track of user logins, seat and VT management etc...
#asahi-dev · 2022-12-01 17:19
dsharshakovHowever, it's necessary to know how should it access the device and will it be root or not. Likely needs to be either root or a system daemon getting uinput access permission
#asahi-dev · 2022-12-01 17:18
dsharshakovmarcan: yes, uinput + many decent things daemon is what we want likely. I wanted to discuss some of its working principles. It could be done with Rust and egui (just see it, appears to be a nice toolkit which can be shaped into a touchsceen-first UI for constrained space)
#asahi-dev · 2022-12-01 17:07
svenok, will take a look later
#asahi-dev · 2022-12-01 16:58
marcanand yes we'll need a libinput quirk similarly, to keep it from being interpreted as a regular touchscreen
#asahi-dev · 2022-12-01 16:57
marcanbut I expect we'll have a daemon doing uinput to emulate F keys and that's that for a while
#asahi-dev · 2022-12-01 16:57
marcanusing those flags to keep it out of compositor's reach sounds like a plan (or maybe new flags or something, maybe discuss with #dri-devel?)
#asahi-dev · 2022-12-01 16:56
marcandsharshakov: it's DRM, it has to be DRM (the legacy framebuffer stuff is deprecated)
#asahi-dev · 2022-12-01 16:54
marcansven: you've got mail :)
#asahi-dev · 2022-12-01 11:13
dsharshakovthis type of quirk appears to be able to just discard the unwanted events for all libinput users: https://gitlab.freedesktop.org/libinput/libinput/-/blob/main/quirks/30-vendor-wacom.quirks#L28
#asahi-dev · 2022-12-01 11:09
dsharshakovmaybe hwdb or libinput quirks can be used to disable the touchscreen input from being mapped, so touch part can be exposed as a touchscreen
#asahi-dev · 2022-12-01 11:01
dsharshakov(and the USB driver could easily live in userspace as well)
#asahi-dev · 2022-12-01 11:01
dsharshakovpovik: I mean if they're interested they know how to do a driver and then try out userspace stuff
#asahi-dev · 2022-12-01 11:00
dsharshakovSome more integration than virtual keys is possible: volume + brightness controls (sliders) and global menu can be done relatively easily
#asahi-dev · 2022-12-01 11:00
povikhuh? "how to get the display working" and "the userspace part" sound unrelated :D
#asahi-dev · 2022-12-01 10:59
dsharshakovThe userspace part could be discussed in T2 chats, since apparently there's a knowledge on how to get the display working on those machines
#asahi-dev · 2022-12-01 10:58
_jannau_the hardware ought to use standard interfaces. if user space can not deal with that we have to and can fix user space
#asahi-dev · 2022-12-01 10:58
dsharshakov_jannau_: +1, first we need an understanding of the device to know how to hook it up in kernel
#asahi-dev · 2022-12-01 10:58
sven_jannau_: +1
#asahi-dev · 2022-12-01 10:57
ChaosPrincessif there is support for f-keys and maybe 1 alternative layer with the fn+f-keys, i'd be happy
#asahi-dev · 2022-12-01 10:57
_jannau_please don't start worrying about this before there is at least a PoC mipi drm/kms driver
#asahi-dev · 2022-12-01 10:57
povikright, better not make grandiose plans with it and instead head for some minimal usable integration
#asahi-dev · 2022-12-01 10:57
dsharshakovMaybe the question should be postponed to when there's understanding of the display controller such as a m1n1 experiment, so that we see the properties better and know whether it's DRM or not

plus ›