#
#asahi-dev · 2023-02-06 14:24
marcanassuming it doesn't change like several times per second, it doesn't really matter if the safety daemon doesn't sync perfectly
#asahi-dev · 2023-02-06 14:24
marcanor just communicate it via a control?
#asahi-dev · 2023-02-06 14:23
povikmaybe we can just close the sense pcm from the kernel side, if the rate no longer matches?
#asahi-dev · 2023-02-06 14:23
povikmaybe we can relax the rate symmetry condition, but then the safety daemon needs to know the rate changed
#asahi-dev · 2023-02-06 14:21
povikbut if sound servers indeed do reopen pcms to change rates, then that race is an issue
#asahi-dev · 2023-02-06 14:21
povikyeah, i was wondering if the current solution isn't good enough already
#asahi-dev · 2023-02-06 14:20
marcanotherwise you'd fail if you try to change rates on the TX path too fast
#asahi-dev · 2023-02-06 14:19
marcanso I think we need to make the capture PCM rate effectively able to change arbitrarily
#asahi-dev · 2023-02-06 14:19
marcanI think we're always going to have races if we don't solve that in the kernel
#asahi-dev · 2023-02-06 14:19
poviksince that would constrain the rates on the playback pcm
#asahi-dev · 2023-02-06 14:19
povikwe still wouldn't want the safety daemon to keep the sense pcm open unnecessarily
#asahi-dev · 2023-02-06 14:18
povikbut even if this weren't the case
#asahi-dev · 2023-02-06 14:18
povikso that's an artifact of the way it's handled with the separate frontends
#asahi-dev · 2023-02-06 14:18
marcanahh
#asahi-dev · 2023-02-06 14:17
povikif you open the pcm device without it, it's dead, there's no samples
#asahi-dev · 2023-02-06 14:17
povikthe tx path needs to be up for the sense rx path to work
#asahi-dev · 2023-02-06 14:17
povikand to my surprise you haven't ran into it
#asahi-dev · 2023-02-06 14:17
povikyeah, there's one thing i haven't pointed out
#asahi-dev · 2023-02-06 14:17
marcanpovik: what's the current plan for syncing device usage between the tx/rx sides? I saw that speaker ready flag thing
#asahi-dev · 2023-02-06 14:15
marcan:D
#asahi-dev · 2023-02-06 14:15
poviki hope i made my calculus professor proud :p
#asahi-dev · 2023-02-06 14:14
marcanawesome :)
#asahi-dev · 2023-02-06 14:14
povik return (A + B*eta, B)
#asahi-dev · 2023-02-06 14:14
povik B = np.exp(-t/tc_mag) * T_mag
#asahi-dev · 2023-02-06 14:14
povik A = np.exp(-t/tc_vc) * (T_vc - eta*T_mag)
#asahi-dev · 2023-02-06 14:14
povik eta = 1 + tc_vc/tc_mag
#asahi-dev · 2023-02-06 14:14
povik # All temperatures relative to ambient
#asahi-dev · 2023-02-06 14:14
povikdef catchup(T_vc, tc_vc, T_mag, tc_mag, t):
#asahi-dev · 2023-02-06 14:14
povikhm, still doesn't do newlines
#asahi-dev · 2023-02-06 14:14
povikdef catchup(T_vc, tc_vc, T_mag, tc_mag, t): # All temperatures relative to ambient
#asahi-dev · 2023-02-06 14:13
povikhuh, that didn't work
#asahi-dev · 2023-02-06 14:13
povikdef catchup(T_vc, tc_vc, T_mag, tc_mag, t): # All temperatures relative to ambient eta = 1 + tc_vc/tc_mag A = np.exp(-t/tc_vc) * (T_vc - eta*T_mag) B = np.exp(-t/tc_mag) * T_mag return (A + B*eta, B)
#asahi-dev · 2023-02-06 14:13
povikokay, got it
#asahi-dev · 2023-02-06 14:01
marcanso maybe tmag increasing by less than 1/30 of the tvc delta is something we can just ignore
#asahi-dev · 2023-02-06 14:01
marcanOTOH those ratios are like 2:60 for the tweeters and even higher for the woofers
#asahi-dev · 2023-02-06 14:00
marcansince that's related to thermal mass
#asahi-dev · 2023-02-06 14:00
marcanactually not thermal resistance, ratio of the time constants
#asahi-dev · 2023-02-06 13:59
marcanif the model the constants are calibrated for is the dumb model I used, then it'd be more correct to leave it as is
#asahi-dev · 2023-02-06 13:58
marcanI'm not sure if it matters much though, because it's symmetric (it also starts rising before t_vc properly rises)
#asahi-dev · 2023-02-06 13:57
povikyeah, that would be my guess too
#asahi-dev · 2023-02-06 13:57
marcanpovik: yes, it's a simplification, but I wasn't sure how/if to fix it. I guess it would be proportional to the ratio of thermal resistance or so?
#asahi-dev · 2023-02-06 13:55
poviknot sure how large the introduced error is though
#asahi-dev · 2023-02-06 13:54
povikthe tc_vc relaxation should be raising t_mag a bit
#asahi-dev · 2023-02-06 13:54
povikhm, maybe the update step isn't exactly right since if t_mag=t_ambient and p=0, t_mag never raises even if t_vc is initially high
#asahi-dev · 2023-02-06 13:29
povikyeah
#asahi-dev · 2023-02-06 13:28
marcan(the inputs are the time constants, not the raw alpha, I just do alpha_vc = step / (tc_vc + step))
#asahi-dev · 2023-02-06 13:27
marcanappetit :)
#asahi-dev · 2023-02-06 13:27
povikor however it's spelled...
#asahi-dev · 2023-02-06 13:27
povikmarcan: bon apetite!
#asahi-dev · 2023-02-06 13:26
marcanI can commit it in a bit, dinner first :)

plus ›