#
✕ nick:chadmed
#asahi-dev · 2022-11-23 08:55
chadmedi guess itll take a little while for userspace applications to start making use of it though
#asahi-dev · 2022-11-23 08:55
chadmedaccel seems like a good fit from preliminary reading
#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 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: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: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: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: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: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: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: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:34
chadmedyeah, it would be nice to just emergency kill output if the daemon is not running
#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
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: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: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
#asahi-dev · 2022-11-23 07:28
chadmedthe actual V/I by themselves arent useful
#asahi-dev · 2022-11-23 07:28
chadmedwhats important to prevent meltdown is the temperature of the coils and magnets, and to derive that from V/I we need a bunch of floating point maths
#asahi-dev · 2022-11-23 07:28
chadmedyeah but simpler is not better in this case
#asahi-dev · 2022-11-23 07:26
chadmedalso why bother with a semi-hacky kernel gaffer tape solution when we _know_ what we need to do to implement it properly and can do so with much more freedom in userspace?
#asahi-dev · 2022-11-23 07:25
chadmedsomething something floating point i think idk
#asahi-dev · 2022-11-23 07:24
chadmedthe other thing is having safety stuff outside of any particular audio server means itll work for everyone using bare alsa, pulse, etc
#asahi-dev · 2022-11-23 07:24
chadmedwe already have that, the amps cut out on certain failure conditions and theyve been programmed to bring themselves back up after doing so
#asahi-dev · 2022-11-23 07:22
chadmedbut at the same time that really does sound like good long term goal...
#asahi-dev · 2022-11-23 07:22
chadmedon one hand implementing that in pipewire is probably going to be nightmarish since it has to keep track of _all_ the mixer controls and stuff and then that would need to be generalised for all similar devices with some new system/format for safety rules
#asahi-dev · 2022-11-23 07:21
chadmednope, which im ambivalent about
#asahi-dev · 2022-11-23 07:21
chadmedand simply lowering the max volume to fix it is stupid because you lose a boatload of headroom and make the whole thing quieter when really you just want certain frequencies quieter for tiny fractions of a second at a time
#asahi-dev · 2022-11-23 07:20
chadmedso we dont need to worry about it from a DSP perspective, the compressor is there because the cones flapping against the chassis is not a meltdown problem, its a physical constraint problem
#asahi-dev · 2022-11-23 07:20
chadmedsupposedly a userspace daemon monitoring the V/ISENSEs of the speaker amps that will talk directly to alsa and cut the volumes in alsamixer dynamically to prevent meltdown
#asahi-dev · 2022-11-23 07:13
chadmedso all we need out of wireplumber is hiding the "real" device and loading the filter chain automatically a la UCM
#asahi-dev · 2022-11-23 07:13
chadmedyep, safety et al will be handled elsewhere either in the DSP chain or as an external thing that talks directly to alsa
#asahi-dev · 2022-11-23 07:12
chadmedi.e. linking the volume control to the volume knob on the equal loudness plugin
#asahi-dev · 2022-11-23 07:11
chadmedyeah that problem is all fixed, the final frontier now is just tying the volume control to a port on a plugin in the chain
#asahi-dev · 2022-11-23 07:07
chadmedactually we might want the equal loudness plugin to work properly at some point
#asahi-dev · 2022-11-23 07:06
chadmedthere are none at the moment actually, i figured out how to integrate the compressor in a sane way
#asahi-dev · 2022-11-23 02:25
chadmedpython tries to install /usr/bin/asahi-fwextract now which makes no sense if we have it in asahi-scripts
#asahi-dev · 2022-11-23 02:24
chadmedmarcan: i think 7cf5c453e960 on asahi-installer collides with the latest asahi-scripts
#asahi-dev · 2022-11-22 13:31
chadmedand when you hover over it your cursor becomes a flaming skull
#asahi-dev · 2022-11-22 13:22
chadmedmy eyes literally glazed over, dunno how much of that to attribute to being sick, being exhausted, or 1000 iq humour
#asahi-dev · 2022-11-22 13:20
chadmedthe semiquaver thing took me a couple of seconds to get but the post looks good to me!

plus ›