#
#asahi-dev · 2022-11-23 08:12
eilngithub is still giving me hell
#asahi-dev · 2022-11-23 08:01
dsharshakovOfc not a protection from malware running as root, but a measure against messing with sudo alsactl
#asahi-dev · 2022-11-23 08:01
chadmeds/how/out
#asahi-dev · 2022-11-23 08:01
chadmedcan you make alsa lock how kcontrols from userspace?
#asahi-dev · 2022-11-23 08:00
dsharshakovAnd after daemon shakes hands no one can take over hw gain control while it's running. Even root
#asahi-dev · 2022-11-23 07:59
dsharshakovAlso ensure robust panic and hang handling
#asahi-dev · 2022-11-23 07:59
dsharshakovYes, that is the proper approach when all the safety mechanisms are in place to make sure every single moment amps work there's strict observation to keep things safe. When no daemon is present, set low hardware volume caps unless it appears and starts monitoring.
#asahi-dev · 2022-11-23 07:59
dottedmagyeah, the driver should fail-safe, obviously.
#asahi-dev · 2022-11-23 07:59
chadmedthe point dsharshakov is making is that the kernel driver should do something _like_ that if the daemon isnt running to stop the speakers from melting if the daemon crashes or is killed
#asahi-dev · 2022-11-23 07:58
chadmedwell again we havent gotten that far but thats one way to do it
#asahi-dev · 2022-11-23 07:57
dottedmagI still don't get it. Is it something like "unless we have a heartbeat, volume is capped to overall-safe level, but as long as the monitoring daemon is live, the volume can go beyond the statically-safe limit, based on output from that daemon"?
#asahi-dev · 2022-11-23 07:56
chadmedbeing able to do that dynamically means that we get to keep all the headroom available when its safe to do so and only start capping stuff when we need to
#asahi-dev · 2022-11-23 07:55
chadmedb) is easy and we do this in DSP already, a) is harder and is what we're talking about
#asahi-dev · 2022-11-23 07:55
chadmedb) dynamically control the volume based on the strength of the input to stop the cones "bottoming out" on the chassis
#asahi-dev · 2022-11-23 07:55
chadmeda) be able to dynamically control the volume based on how hot the driver is
#asahi-dev · 2022-11-23 07:54
chadmedso we need to do two things
#asahi-dev · 2022-11-23 07:54
chadmedwe cant just brute force a lower volume in the kernel because then you lose headroom and things sound bad at low volume etc
#asahi-dev · 2022-11-23 07:54
chadmedthats exactly what im saying though
#asahi-dev · 2022-11-23 07:53
dottedmagThis is not what is in the latest blog update, isn't it? «Of course, you could limit the volume to a known-safe level, but this would result in significantly reducing the overall volume and leave a lot of unused headroom for most normal music and audio signals!»
#asahi-dev · 2022-11-23 07:42
chadmedwith the DSP chain in place and the latest kernel driver im confident enough to say its impossible to break the speaker array. what we need extra stuff for is to _guarantee_ that safety to _everyone_
#asahi-dev · 2022-11-23 07:42
dsharshakovYep, will work on that! Need to port things to new wp 0.5 and fix validity issues
#asahi-dev · 2022-11-23 07:41
chadmedas far as a standard asahi install goes now that we have pipewire we can make things "safe enough" OOB for brave users to try out
#asahi-dev · 2022-11-23 07:41
dsharshakovpovik: my idea for enhanced speaker safety is to also have a panic handler disabling TAS2764 in case of kernel panic. I think admac will keep sending a stuck audio fragment in case cpu hangs
#asahi-dev · 2022-11-23 07:40
chadmedlets get the stuff we're actively working on ready to ship before we start worrying about this in too much detail anyway
#asahi-dev · 2022-11-23 07:39
dsharshakovGot it
#asahi-dev · 2022-11-23 07:39
svenand again, just make it ping the kernel and the kernel shutdown on timeout
#asahi-dev · 2022-11-23 07:39
dsharshakovNeed better protection against fails
#asahi-dev · 2022-11-23 07:38
chadmedyeah but we cant help users messing with it, to paraphrase qui gon jinn, theres always a stupider user
#asahi-dev · 2022-11-23 07:38
svenI don’t think anyone proposed an api yet and it doesn’t make much sense to discuss it before that
#asahi-dev · 2022-11-23 07:38
dsharshakovNo way
#asahi-dev · 2022-11-23 07:38
dsharshakovWhat if it get OOM killed?
#asahi-dev · 2022-11-23 07:38
dsharshakov* or users messing with it as well
#asahi-dev · 2022-11-23 07:37
chadmedi think at some point we just need to say "look, we have taken every reasonable precaution but if you run 'killall do-not-kill-this' then youre beyond saving sorry"
#asahi-dev · 2022-11-23 07:37
dsharshakovI understand it's not to be in kernel. But userspace monitoring should be very robust and resilient against failures
#asahi-dev · 2022-11-23 07:36
chadmedbut ^, we just cannot implement this modelling in the kernel and you cannot rely on V/I alone even as an estimation because impedance/resistance change with temperature which is what we are trying to measure
#asahi-dev · 2022-11-23 07:35
dsharshakovWhat would be the api for watchdog? Where would watchdog be?
#asahi-dev · 2022-11-23 07:35
sven*some
#asahi-dev · 2022-11-23 07:35
svenbecause you generally want to avoid floating point in the kernel. you can also just make the watchdog ping it and if it hasn’t seen any feedback in aome time just kill the output
#asahi-dev · 2022-11-23 07:34
chadmedyeah, it would be nice to just emergency kill output if the daemon is not running
#asahi-dev · 2022-11-23 07:33
dsharshakovKernel driver is less prone to that
#asahi-dev · 2022-11-23 07:33
dsharshakovBut what if it hangs or get killed by megabrain users?
#asahi-dev · 2022-11-23 07:33
chadmedwe just need to implement it, verify once that it actually does turn the mixer controls down when its meant to, then we can just leave it alone
#asahi-dev · 2022-11-23 07:32
chadmedwe know the formula, we know the coefficients we need to plug into it, we know it works in macos
#asahi-dev · 2022-11-23 07:32
dsharshakovMath principles of the thing are pretty clear to me
#asahi-dev · 2022-11-23 07:32
chadmedit only needs to be tested once, all the values for the temperature model come from apple so its not like we're flying blind
#asahi-dev · 2022-11-23 07:32
dsharshakovI cannot imagine a proper solution to monitor the speakersafety daemon to be sure it's doing well and we're safe to use the amps
#asahi-dev · 2022-11-23 07:31
chadmedwith the derived coil temperature we can just determine when theyre getting too hot and taper down the mixer controls until they cool down again
#asahi-dev · 2022-11-23 07:31
chadmedwdym
#asahi-dev · 2022-11-23 07:31
dsharshakovHow is watchdogging planned to be done?
#asahi-dev · 2022-11-23 07:30
chadmedsure and thats why the kernel driver already handles _obviously_ wrong stuff, like clamping down the amp gains so that you cant drive enough current through them to _instantly_ pwn them

plus ›