2021-10-29
00:13amw has joined #asahi-dev
01:31user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
01:47psykose has quit [Remote host closed the connection]
01:48psykose has joined #asahi-dev
02:07phiologe has joined #asahi-dev
02:08marcanjmr2: linux.py is unaffected by the DT selection thing, it assumes you know what you're doing
02:10user982492 has joined #asahi-dev
02:10PhilippvK has quit [Ping timeout: 480 seconds]
02:32rkt has joined #asahi-dev
02:41jmr2 has joined #asahi-dev
02:42jmr2 has quit []
02:43marcan has left #asahi-dev [#asahi-dev]
02:43marcan has joined #asahi-dev
02:53rkt has quit [Quit: rkt]
03:24rkt has joined #asahi-dev
03:54kov has quit [Quit: Coyote finally caught me]
03:54kov has joined #asahi-dev
04:16rkt has quit [Quit: rkt]
04:27rkt has joined #asahi-dev
04:30rkt has left #asahi-dev [#asahi-dev]
04:47rohin2 has joined #asahi-dev
05:19rohin2 has quit [Ping timeout: 480 seconds]
05:35kenzie has quit [Quit: Ping timeout (120 seconds)]
05:36kenzie has joined #asahi-dev
06:29rkt has joined #asahi-dev
06:40rkt is now known as Guest4338
06:40rkt_ has joined #asahi-dev
06:40rkt_ is now known as rkt
06:45Guest4338 has quit [Ping timeout: 480 seconds]
07:02chadmed has quit [Quit: Konversation terminated!]
07:03chadmed has joined #asahi-dev
07:29aleasto has joined #asahi-dev
08:42nsklaus has joined #asahi-dev
08:56rkt has quit [Quit: rkt]
09:12rkt has joined #asahi-dev
09:34user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
09:42rkt has quit [Quit: rkt]
09:49rkt has joined #asahi-dev
09:52chadmed has quit [Quit: Konversation terminated!]
09:53chadmed has joined #asahi-dev
09:58povikturns out macos writes to its ranges, it's just that they also resolve as error-handler[15] that i didn't notice the writes earlier
10:02poviknow i would like to know to relationship between the outputted frequency and the nco's registers
10:03povikon the contrary, i now am really curious what the dependence is, because that plot is nuts
10:07rkt has quit [Quit: rkt]
10:15rkt has joined #asahi-dev
10:19marcannormally an NCO would be using some kind of accumulator design, followed by some kind of cleanup pass or something like that
10:22marcanI see the setFrequency proto in the kext, but this is the kind of code I don't want to look at before trying to blackbox it
10:26marcanso it looks like we have 4 NCO clock inputs, 5 NCOs (selectable I guess?), and 6 MCA clock selects
10:29skipwich has quit [Quit: DISCONNECT]
10:29skipwich has joined #asahi-dev
10:31rkt has quit [Quit: rkt]
10:33rkt has joined #asahi-dev
10:33poviknumbers here: https://paste.gg/p/anonymous/ec71e113e19c44999461381c18b6a571/files/4f1c509dedb44db696ed035ef6975479/raw
10:40marcanso one thing to keep in mind is that if there is a PLL or similar cleanup pass after it, the other reg values might affect it and that might cause insanity for some ranges
10:55rkt has quit [Quit: rkt]
11:13rkt has joined #asahi-dev
11:45rkt has quit [Quit: rkt]
11:51rkt has joined #asahi-dev
12:08svenbut at least the locked DART makes sense now. otherwise you could just switch the mapped firmware region to bypass-dapf i guess
12:31vivg[m] has joined #asahi-dev
12:36marcanso the register values are kind of crazy but we are enumerating integer dividers of the refclk here after all
12:47mikebeaton[m] has joined #asahi-dev
12:47marcanI'm not sure if there is an easy way of generating the LFSR value other than a table, though
13:06jixmarcan: you can use modular exponentiation by squaring to directly compute the n-th step of a lfsr, but for 11 bits I wouldn't bother
13:08mikebeaton[m] has quit [Quit: issued !quit command]
13:10jixwithout using carryless (i.e. polynomial over F_2) multiplication instructions (which I assume arm also has these days) it might even be slower than the naive approach for 11 bits
13:10jixwith those instruction it's probably faster than generating the table, but that's a lot of added complexity
13:40marcanpovik, jix: want to take a crack at this relation for the NCO fractional part register? https://mrcn.st/p/8L7N8zW5
14:03jixoh and it's not close for the small values, I assumed they are noise because they jump all over the place in a log plot, but that might not be the case?
14:04chadmedis this lfsr used to derive the dac's sample rate? if so values not between 8000 and 384000 should never ever matter
14:07chadmedoh yeah for sure im just saying that noise causing inaccuracy in low values shouldnt be too much of an issue unless the hardware is doing double duty for something else
14:35nsklaus has quit [Quit: Textual IRC Client: www.textualapp.com]
14:36nsklaus has joined #asahi-dev
14:38jixhmm not a small factor but a small offset... if you use 0x60ae00 and then add 2**(-13) at the end it's really close (but that offset might also be measurement error? no idea how you measure this)
14:45jixcan you do the measurement over a longer interval or so to figure out if the 2**(-13) are just measurement error? I expect it to be... but a constant offset could also be plausible
14:48rkt has quit [Quit: rkt]
14:50marcanok, so small values take a while to converge, which tells me these are accumulator increments indeed
14:52marcanso basically the logic would be a state flip-flop driving a mux that selects the increment register
14:54marcanand that's all of the data registers then, reg0 is presumably control, might want to poke around the bits there at some point
14:55marcanso the first register is the increment for the ddiv = +0 state, and the second for the ddiv = +0.5 state
14:56marcanwhich means there's an inverse relationship, if r2 is 2*r1, then it spends half as long at 0.5, so the overall div is 0.16666
15:00marcanmaybe the third one is just some initializer, perhaps it needs a control reg kick to set?
15:06brentr123[m]So hyped for the m1 pro stream
15:06marcanthat way you can use small incs without having to wait for the accumulator to wrap back across the midpoint
15:08marcanso really that register can just always be set to 0x80000000 I guess, I have no idea why you'd bother with anything else?
15:10jixI guess it's always a good idea to avoid small incs anyway... i.e. multiply them by the largest constant that still fits
15:16jixwait is it doing a zigzag around the midpoint or is it always wrapping around in one direction? (or I guess you could do it either if the increment regs are as wide as the accumulator reg)
15:39povikfunny thing is yesterday i noticed the similarities in frequency of shifted bit patterns, in couple instances
15:49marcanso I measure 47999.3839 but I calculate that macos should be setting 48000.5586 and I don't know if that's measurement error or what
15:50marcanI'd *think* my timer and this thing would be frequency-locked to some extent, which is a bit weird
15:57jixso this is used to adjust the fractional period of the lfsr divider? (just making sure I understand the whole chain here)
16:03marcanNCO1: #156: 900000000 0 0xa8/0x23b048000: nco: 0x80300000 0x45e 0x5ad200 0xff9f5200 0x7f9f5200 0x0
16:05jixuh I think the math for the values you said mac os sets checks out? (also not quite following the last thing you said)
16:06jixI get that it should set a fractional value of 31/64 and that's what 5952000 / (5952000 + 6336000) reduces to... except wait is it actually the right thing to do? it matches what mac os does but uh not sure
16:11jixI also totally don't trust that what I'm computing is the right thing, just that it ends up telling me mac os is setting 48k exactly
16:14jixhmm but no it should be fine I think... now let me try to do this the other way around to get from freq to incs
16:18jixah yeah, what I did was just to use high_inc and low_inc to directly match the fractional part of the divider period ... and that should check out if it's per output cycle as the formula for the fractional part already takes into account that the longer output cycles are longer
16:27jixah and that's why the difference is fout... by scaling both values by fout you can use an integer division here, that also explains why they're not using a reduced fraction
16:43bps2 has quit [Ping timeout: 480 seconds]
16:44stzsch has quit [Remote host closed the connection]
17:03user982492 has joined #asahi-dev
17:06marcanpovik: so to do this "properly" in linux we need two clock drivers: one for the NCOs and one for the clocksels that go after them
17:16user982492 has quit [Quit: Textual IRC Client: www.textualapp.com]
17:22agraf has quit [Ping timeout: 480 seconds]
17:56gig has joined #asahi-dev
19:18jeffmiw has joined #asahi-dev
19:22aleasto has quit [Remote host closed the connection]
20:07agraf has joined #asahi-dev
20:13agraf has quit [Quit: ZNC 1.7.2 - https://znc.in]
20:22X-Scale` has joined #asahi-dev
20:28agraf has joined #asahi-dev
20:28X-Scale has quit [Ping timeout: 480 seconds]
20:53jacoxon has joined #asahi-dev
22:30rohin2 has joined #asahi-dev
23:01bps2 has joined #asahi-dev
23:06jacoxon has quit []
23:26X-Scale has joined #asahi-dev
23:31X-Scale` has quit [Ping timeout: 480 seconds]
23:31doggkruse has joined #asahi-dev
23:47doggkruse has quit [Ping timeout: 480 seconds]
23:54rohin2 has quit [Ping timeout: 480 seconds]