#
✕ nick:chadmed
#asahi-dev · 2022-12-02 06:06
chadmedtpw_rules: yeah that seems saner and extremely obvious :P
#asahi-dev · 2022-12-02 06:01
chadmedthe keyword being released
#asahi-dev · 2022-12-02 06:01
chadmedi.e. packaging and maintenance of _released_ asahi software on other distros to make them work
#asahi-dev · 2022-12-02 06:01
chadmed#asahi-alt is for discussing non-reference distributions
#asahi-dev · 2022-12-02 06:00
chadmedah wait no theyre 16 bit pcm samples right
#asahi-dev · 2022-12-02 06:00
chadmedtas2764 page 28
#asahi-dev · 2022-12-02 05:59
chadmedthe datasheet literally says theyre 16-bit floats
#asahi-dev · 2022-12-02 05:56
chadmedspeaker DRM :P
#asahi-dev · 2022-12-02 05:54
chadmedit should be fine if theyre on their own pcm, i had issues earlier this week trying to open the speaker pcm while pipewire had it open at the same time
#asahi-dev · 2022-12-02 05:53
chadmedyeah
#asahi-dev · 2022-12-02 05:52
chadmedyeah
#asahi-dev · 2022-12-02 05:52
chadmedright. ive modeled them as read only elems on the ctl interface but that probably doesnt make a lot of sense. shouldnt be too hard to change if we have a dedicated pcm to open
#asahi-dev · 2022-12-02 05:50
chadmedah so V/ISENSE will be channels on a PCM?
#asahi-dev · 2022-12-02 05:48
chadmedawesome
#asahi-dev · 2022-12-02 05:48
chadmedoh okay, so as long as the process dies and does nothing else to the CTL interface the kernel will handle the rest?
#asahi-dev · 2022-12-02 05:46
chadmedgnight!
#asahi-dev · 2022-12-02 05:44
chadmedV/ISENSE are lines hooked up to the amp output. ISENSE is a shunt resistor and VSENSE just measures the voltage across the voice coil
#asahi-dev · 2022-12-02 05:43
chadmedmacos does it inside coreaudio as part of the DSP graph
#asahi-dev · 2022-12-02 05:43
chadmedunpack this and do floating point maths in the kernel?
#asahi-dev · 2022-12-02 05:43
chadmed bits as padding.
#asahi-dev · 2022-12-02 05:42
chadmed This is expressed by the driver as a byte array, with rightmost 16
#asahi-dev · 2022-12-02 05:42
chadmedV/ISENSE are 16-bit floats sent in a 32-bit TDM slot by the codec.
#asahi-dev · 2022-12-02 05:39
chadmedim more worried about getting V/ISENSE out of the driver and making sure we can catch over temp situations in a controlled state at the moment
#asahi-dev · 2022-12-02 05:37
chadmedalso we should probably make sure it, yknow, actually does what it says on the tin first
#asahi-dev · 2022-12-02 05:36
chadmedand to me it seems silly to implement something that unorthodox in the kernel to cover a failure mode with such a slim possibility
#asahi-dev · 2022-12-02 05:34
chadmeda quick search hasnt revealed anything similar
#asahi-dev · 2022-12-02 05:34
chadmedi guess with a keepalive signal its just a matter of the implementation difficulty and whether or not such things are tolerated in the kernel
#asahi-dev · 2022-12-02 05:27
chadmedwe can handle all signals
#asahi-dev · 2022-12-02 05:13
chadmedso theres like 0.00000000001% chance that we enter a state where a keepalive would be useful
#asahi-dev · 2022-12-02 05:13
chadmedwe can handle sigterm
#asahi-dev · 2022-12-02 05:13
chadmedso the only way that wouldnt happen is if its killed by segfaulting _itself_ or ooming
#asahi-dev · 2022-12-02 05:12
chadmedif the daemon is killed by any means we already have our panic and fail handlers that would theoretically do the IOCTL to put them into safemode
#asahi-dev · 2022-12-02 05:12
chadmedhell with the IRs alone the speakers are impossible to blow up, so not only does the daemon have to fail but you have to be accessing it via the raw alsa device AND doing so at sustained full volume
#asahi-dev · 2022-12-02 05:11
chadmedagain though, its a case of this only _ever_ being a possible failure mode in a vanishingly small set of circumstances
#asahi-dev · 2022-12-02 05:09
chadmedand then someone will come along and say "ok but what if they use ssh"
#asahi-dev · 2022-12-02 05:09
chadmedwe could run this treadmill all day and all night and end up with a 30MB binary that has a firewall built into it to stop people breaking in via telnet to run aplay -D hw:0,1
#asahi-dev · 2022-12-02 05:08
chadmedyeah but do you see my point
#asahi-dev · 2022-12-02 05:07
chadmedyeah and what if evil ninjas sent by tim apple break into my house and killall speakersafetyd while im not looking? should speakersafetyd have an aperture science turret built in to it?
#asahi-dev · 2022-12-02 05:05
chadmedits more a case of how much overengineering do we want to do to prevent an edge case of an edge case of an edge case (someone not using a DE on the laptops -> the daemon crashing -> someone blaring bass boosted amogus trap nightcore remix at full volume)
#asahi-dev · 2022-12-02 05:03
chadmedtheres a PR in AsahiLinux/linux that makes power management work for the tas codecs, so we dont have to worry about the hardware doing undefined stuff
#asahi-dev · 2022-12-02 04:30
chadmedmy main concern apart from that anyway was the maths for the actual safety stuff, but i cant really test any of that until the driver has V/ISENSE support anyway
#asahi-dev · 2022-12-02 04:24
chadmedsomething has gone very wrong if any of the values we get back from the CTL interface are bad, we cant guarantee safety for machines we dont have the config data for, etc
#asahi-dev · 2022-12-02 04:23
chadmedit makes sense to me in this case since (imo) we should put the speakers in safe mode and die if we encounter any error
#asahi-dev · 2022-12-02 04:17
chadmedyeah that was the missing piece, didnt realise you could tell panic! to do things
#asahi-dev · 2022-12-02 04:14
chadmedi was under the impression that they just unconditionally panic on failure and i wanted to handle whatever alsa-lib returned in a controlled manner
#asahi-dev · 2022-12-02 04:13
chadmedah see i was trying to avoid unwrap()s and expect()s thinking it would be better to explicitly handle each Option and Result from the alsa lib bindings but if thats acceptable then that works and is less gross
#asahi-dev · 2022-12-02 04:10
chadmedyeah
#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
chadmedah and that would negate the need for those superfluous exit()s

plus ›