#
…

2022-03-07

00:44chadmed has quit [Quit: Konversation terminated!]
00:54amarioguy has quit [Remote host closed the connection]
00:55chengsun has quit [Quit: Quit]
00:55chengsun has joined #asahi-dev
00:58TheLink has quit [Quit: ZNC 1.8.2 - https://znc.in]
00:58TheLink has joined #asahi-dev
01:10dlssscr^ has joined #asahi-dev
02:11vbob[m] has joined #asahi-dev
02:52chadmed has joined #asahi-dev
03:10user982492 has joined #asahi-dev
03:29phiologe has joined #asahi-dev
03:31PhilippvK has quit [Ping timeout: 480 seconds]
03:33kov has quit [Quit: Coyote finally caught me]
03:33kov has joined #asahi-dev
05:44gladiac has joined #asahi-dev
05:51gladiac is now known as Guest1510
05:51gladiac has joined #asahi-dev
05:57Guest1510 has quit [Ping timeout: 480 seconds]
06:11bpye has quit [Ping timeout: 480 seconds]
06:30bpye has joined #asahi-dev
06:40nfranco[m] has joined #asahi-dev
07:34the_lanetly_052 has joined #asahi-dev
07:36joske has joined #asahi-dev
08:07user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
08:23mazj`ey: there is something in the spec for link-up, but this is not necessarily the right value for the HW at hand. once we have the SMC driver up and running independently of the rest of the stack, I'll have a look at just handling hotplug events without ever waiting for anything.
08:24j`eycool. also someone ran into a case where the link came up.. but didnt do much else https://github.com/AsahiLinux/linux/issues/18
08:29MajorBiscuit has joined #asahi-dev
08:32mazthey could try and make the timeout longer, but thatt's just papering over the core problem.
08:33mazin this case, it looks like the device wasn't really there.
08:35mazalso, there is zero indication of how this kernel was build the first place, with what configuration and what source code...
08:35mazonce this is upstream, I'll be able to reason about. until then, I can't do much.
08:36j`eyI think this was using marcan's reference build
08:51kamila has joined #asahi-dev
09:22the_lanetly_052 has quit [Ping timeout: 480 seconds]
09:48svendoes anyone have a t8103 and a dumb displayport cable? my dp->hdmi adapter apparently also shows up as a usb device but i'd like to see XNU's serial output when just a display port connection is established and these bootargs are present: https://f.svpe.de/877e608ff9591ec7cd32455634816d18b927189f8bf8571230295e2b6a16e4fd_usb-debugargs.txt
09:48svenerm, *usb-c->hdmi
09:51Dcow[m]1I do have Baseus C->HDMI, not sure if it dumb
09:52Dcow[m]1NP021180R01BS
09:52svenplug it into a linux machine and take a look at lsusb :)
09:52svenif nothing shows up it's dumb enough
09:53Dcow[m]1any linux pc?
09:53svenanything that has a working usb c port, yes
09:59joske has quit [Quit: Leaving]
10:03Dcow[m]1Yeah, it’s shows up in lsusb
10:04Dcow[m]1sven: Can’t help?
10:06svenno, it's the as my adapter then i guess
10:06sven*the same as
10:07tanty has quit [Remote host closed the connection]
10:09tanty has joined #asahi-dev
10:14kamila has quit [Ping timeout: 480 seconds]
10:26chengsun_ has joined #asahi-dev
10:31akemin_dayo has joined #asahi-dev
10:32chengsun has quit [Ping timeout: 480 seconds]
10:33mini_sven: fwiw, the usb-c -> DP cables I have available also show up in USB
10:34mini_I don't know if you'll see ones that are just 'dumb', I've not seen any
10:34svenhrm, maybe they just don't exist and for some reason need a usb interface? i wonder why though
10:34svenand i really don't want to read the USB spec to figure out ;)
11:03_jannau_sven: I have one which which doesn't show up as usb device but iirc it was the one which does not work with m1/macos. I'll check tonight
11:07mpsmy son have usb-c dongle with hdmi, will this help if I plug it and post lsusb output?
11:09sveni'm only interested in what XNU does with a dongle that _doesn't_ show in lsusb
11:27tanty has quit []
11:28MajorBiscuit has quit [Ping timeout: 480 seconds]
11:28tanty has joined #asahi-dev
11:32tanty has quit []
11:34tanty has joined #asahi-dev
11:39the_lanetly_052 has joined #asahi-dev
11:57akemin_dayo has quit [Ping timeout: 480 seconds]
12:13alyssa has quit [Quit: leaving]
13:29marcanisn't the USB thing a billboard device?
13:30marcanwhich is probably required per spec?
13:30marcanlet me try mine
13:30j`eybillboard device is what I got in macOS when I plugged in my USB C monitor directly to my mac
13:30j`ey(it didn't work)
13:32svenoh.. that makes thing easier if there can't be a device that only wants DP but no USB
13:33sven*things
13:41povikon t6000 iboot doesn't leave the right values in clock muxes on input of MCA
13:41povik(untested, i am about to test it)
13:41povikan alternative is having m1n1 put the values there
14:01povikCLK_SET_RATE_NO_REPARENT | CLK_SET_RATE_PARENT
14:01povikof course, we were missing ^, duh :)
14:02povikaaand with that, speakers are up on t6000 with no outside help
14:02povik(well, almost)
14:02povikin the baseline variant of left/right only, needs to be said
14:07marcanpovik: m1n1 should probably do that if it's a one-time thing
14:08marcanare the required settings represented somewhere in the ADT, or is it hardcoded?
14:08svenpovik: awsome! :)
14:09Shiz has quit [Ping timeout: 480 seconds]
14:09svenalso lol, i just realized why apple split their tunables into so many properties: they are all based on a different entry in the regs array
14:09sventhat probably explains why nothing was working :D
14:10j`eyso you were applyin the tunables to the wrong addresses?
14:10svenyeah... i was kinda applying them all to the usb2 phy
14:10svenwhich uh... probably did nothing
14:11povik has quit [Remote host closed the connection]
14:11j`eysven:good luck then!
14:13sveni'll only get to try again this evening. that idea just came to my mind and i quickly confirmed it by looking at a stored XNU log I had around :D
14:13povik has joined #asahi-dev
14:13povikmarcan: it's hardcoded
14:14povikit is that narrow reg range in mca-switch node, if you remember
14:14povikthat tells you the addresses, the values cannot be derived from ADT as far as i can tell
14:14povikalso, it's a one-time thing
14:14marcanfair enough
14:16the_lanetly_052__ has joined #asahi-dev
14:20Shiz has joined #asahi-dev
14:22the_lanetly_052 has quit [Ping timeout: 480 seconds]
14:24Dcow[m]1povik: great news! what do you mean by "baseline variant of left/right only" ? only two speakers of array are working or what?
14:26Dcow[m]1also, just curious, what about capture?
14:31povikDcow[m]1: as you said, only two speakers alive
14:31povikno capture on t600x
14:32akemin_dayo has joined #asahi-dev
14:32marcanpovik: if you think it's good enough I could sneak it into the first release, plus the m1n1 change
14:32marcanwould be really cool to have the speakers working to some extent on all models
14:32povikwhen do you plan that release?
14:32povikdepends on that
14:32marcanthis week :)
14:33marcanalso, even if the kernel part isn't ready, if the DT bits are and I add the m1n1 thing we can ship that and then people just have to upgrade their kernel package to get it later
14:33poviklet's start with that
14:34poviklet me send you a python script with what i think we should do in m1n1
14:43povikmarcan: something like that: https://tpaste.us/Yrnr
14:43povikon t8103 it should be a no-op and on t600x it should do the right thing
14:43povikwill test it in a minute on both
14:43marcancool, is it always reg[2]?
14:43povikyes, with N=2
14:44povikweird thing is on t6000 the reg[2] has 6 clusters worth of clocks, but it only has 4 clusters
14:44povikmaybe we should remove that last 0x09
14:46marcanthere is also AOP_MCA0/1, is it possible it's those?
14:47povikdon't think so
14:47povikit's possible but would be very surprising
14:47marcanmaybe it's just a leftover then
14:47marcanthey have some of those
14:47marcan(e.g. the two die thing is in m1pro AIC even though obviously it can't use it)
14:47povikAOP_MCA is on t8103 also, and there the 5th and 6th clock is for vanilla MCA
14:48marcanalright, let me implement that
14:48marcandoes it make sense to have all the settings for t8103 too? and I guess the 6th doesn't make sense since we don't have a dedicated NCO for it?
14:51poviki would clip the presets at the fourth or fifth (as i posted it)
14:51povikshouldn't matter in the end
14:52povikhmm, don't we have 6th NCO channel? what i did in the DT for t8103, then? :)
14:52povikah, i shared the 5th channel between mca4 and mca5
14:52povikwhich is how it indeed is
14:53povik(with iboot values in muxes on t8103)
15:00marcanah, I'll do the same then I guess
15:01povikscript appears to be okay
15:02marcanpovik: pushed
15:02marcanI initialize all muxes, but clamp the mux values to 5..9
15:02marcanso anything beyond 5 will repeat 9
15:04kettenisnote that adding clocks further up the hierarchy is hard/impossible to do without breaking backward compatibility in the DT
15:04marcanthe problem is we don't really know anything about the clock tree until apple uses it anyway
15:05marcanbut I'd say if we end up needing to do this "properly", it'll be in a new machine anyway, at which point we just need a minimum kernel for that one to get audio (which, shrug)
15:07marcanhard to imagine a reason why we'd need to make these dynamic though...
15:11ketteniswe may need to restore these when resuming, but I guess we already anticipate m1n1 being in the loop there
15:11marcanactually I'd be surprised
15:11marcandoubt that will be necessary
15:11marcanclock muxes are part of PMGR and that definitely stays alive during sleep
15:12ketteniseven better
15:12povikmarcan: i had to set the NCO's input clock (in DT) to be half of what's in clock_frequencies in ADT
15:12povikon t8103 it's the clock_frequencies value exactly
15:12poviki worry that there is a divider-by-half in the way
15:12marcanthe mux regs have a divider setting
15:12marcanhave you tried clearing the lower bits?
15:12marcanI think some are hardcoded to
15:12poviknot exntesively
15:12povikmaybe we should settle that too before we start caring about backwards compatibility
15:13marcandoes macOS do the same thing?
15:13poviki don't know
15:16marcanthe NCOs have 4 input clocks but we only use the first one, right?
15:16povikthat's the only one that seems to matter
15:16marcan# 72: 900000000 0 0xa0/0x23b04002c: regval: 0x86100000
15:16marcan User: /device-tree/arm-io/nco.clk[0]
15:16marcan# 73: 900000000 0 0xa0/0x23b040030: regval: 0x86100100
15:16marcan User: /device-tree/arm-io/nco.clk[1]
15:16marcan# 74: 200000000 0 0xa0/0x23b040034: regval: 0x85100000
15:16marcan User: /device-tree/arm-io/nco.clk[2]
15:16marcan# 75: 200000000 0 0xa0/0x23b040038: regval: 0x85100100
15:16marcan User: /device-tree/arm-io/nco.clk[3]
15:16marcanI think those are actually using /1 /2 /1 /2 dividers
15:16marcanso the freq seems to be pre-divider
15:17marcan# 84: 1068000000 0 0xa4/0x28e038028: regval: 0x85100100
15:17marcan User: /device-tree/arm-io/nco.clk[0]
15:17marcan# 85: 1068000000 0 0xa4/0x28e03802c: regval: 0x85100100
15:17marcan User: /device-tree/arm-io/nco.clk[1]
15:17marcanand those have the divider set to /2
15:17marcanso indeed setting the NCO input to that /2 seems correct
15:17povikthe second is on t6000?
15:17povikthat checks out then
15:18svenhttps://f.svpe.de/78654b5e27f615929065f192a8f7938679a6e716d174f11ec34e588bd2078c21_atcphy-regs.txt atcphy regs + the names i know. note how most of these entries are just 0x4000 apart *sigh*
15:18povikbut wait if 0x100 is /2, then the MCA input has it too (on t600x)
15:18povikmaybe the frequency is indded after div
15:18svenand then sometimes they map different offsets inside a single page for some reason
15:18marcanbut it's the same freq for both /1 /2 there
15:20marcan#112: 900000000 0 0xa0/0x23b0400d4: regval: 0x85100100
15:20marcan#113: 900000000 0 0xa0/0x23b0400d8: regval: 0x86100000
15:20marcan#115: 900000000 0 0xa0/0x23b0400e0: regval: 0x88100100
15:20marcan#114: 900000000 0 0xa0/0x23b0400dc: regval: 0x87100100
15:20marcan#116: 900000000 0 0xa0/0x23b0400e4: regval: 0x89100100
15:20marcan#117: 900000000 0 0xa0/0x23b0400e8: regval: 0x89100100
15:20marcanon t8103 it would seem like only mca1 is not divided
15:20marcanare you seeing that?
15:21poviklet me play with this for a while
15:21poviki have a t6000 target set up right now
15:21marcan#112: 24000000 0 0xa4/0x28e038098: regval: 0x80100000
15:21marcan#113: 1068000000 0 0xa4/0x28e03809c: regval: 0x86100100
15:21marcan#115: 1068000000 0 0xa4/0x28e0380a4: regval: 0x88100100
15:21marcan#114: 1068000000 0 0xa4/0x28e0380a0: regval: 0x87100100
15:21marcan#116: 1068000000 0 0xa4/0x28e0380a8: regval: 0x89100100
15:21marcan#117: 1068000000 0 0xa4/0x28e0380ac: regval: 0x89100100
15:21marcanalso looks like on t6k only the first one is set weird (and not divided)
15:22marcanmaybe we should just also set the dividers to 2 everywhere?
15:22povikokay, i take that back, on t6000 the div-by-2 on MCA input is not set
15:22povikah, i was looking at the first one :)
15:22marcanon mca0 only!
15:22poviklet me see if that div is even implemented
15:23povikdoesn't seem to be
15:23povikwriting 0x05000100 doesn't do anything, in place of 0x05000000
15:23povikwatching the data rates
15:23marcanis it implemented for the NCO inputs?
15:24povikhandy you posted the dumps
15:24povikalso not
15:25povikis it a sure thing that 0x100 is div-by-2?
15:25marcanI'm not even sure if that bit is the divider any more, tbh
15:25marcanah, could be bits 7:0
15:26poviktried setting 1,2,4,8 there on NCO and MCA0
15:26poviknothing
15:26marcanI have no idea then :)
15:26marcanor maybe it needs bit 8 set and also one of the others?
15:26marcanlike div enable
15:30povikstill nothing, tried a bunch of things
15:32amw has quit [Ping timeout: 480 seconds]
15:33marcanthere's one way of figuring out if the divider is before or after the NCO; deliberately making the fractional counter take a while to converge and measuring how long it takes
15:34povikcan't say i want to go into that... :)
15:34povikalthough it sure is a way
15:35povikbtw remember how the NCO output frequencies were inexplicably measured a bit off?
15:35povikon t600x it doesn't happen anymore
15:36povik(estimated rate: 24000.01 dwords/s)
15:36marcanhm, I thought it was accurate in the end?
15:36marcanafter we worked out the NCO formula
15:37povikno, there was still a bit of error
15:37povikand it is there up to this day
15:37marcanhow much?
15:37povikit was there for macos values too
15:37poviksomething like 47997 vs 48000
15:37povikthat's what our measurement gave us for iboot/macos values as well
15:37poviknow it measures exactly
15:38povikseems like something that was fixed in the chip
15:38marcan47997 vs 48000 is 60ppm, which is not unheard of for xtal tolerance
15:39marcanif it's a different reference clock, that would be down to individual variance
15:39marcanif it's the same clock then it's possible somewhere higher up in the clock tree there's just an inaccurately specified clock
15:39povikmakes sense, both explanations
15:40marcan24000.01 certainly sounds like the same reference, it's too good for two xtals :)
15:40dlssscr^ has quit [Remote host closed the connection]
15:43poviki would bet my money on inaccurately specified clock then, as the error was similar for both of us
15:43povikanyway...
16:41MajorBiscuit has joined #asahi-dev
17:43eragon has quit [Quit: WeeChat 3.4]
17:48eragon has joined #asahi-dev
17:49MajorBiscuit has quit [Ping timeout: 480 seconds]
18:48joske has joined #asahi-dev
18:49joskepovik: I just built your branch and with the DT and m1n1 changes, I now have working speakers on MBA!!
18:59Glanzmannjoske: Wow, nice.
19:07Glanzmann has quit [Quit: leaving]
19:07yuyichao has quit [Ping timeout: 480 seconds]
19:08poviki though i told you you are not supposed to do that :-p
19:08povikanyway i am happy it works for you
19:09the_lanetly_052__ has quit [Ping timeout: 480 seconds]
19:13joskepovik: what will happen? will it explode? ;-)
19:13kettenispovik: no clarity yet on how to handle multiple speakers per channel?
19:14kettenis(in the DT I mean)
19:16yuyichao has joined #asahi-dev
19:17povikjoske: no, but it is best to make sure first that the code is even worth letting people test
19:17joskedon't worry, I won't complain if it doesn't work/breaks/whatever, but I will cheer if it does :-)
19:18povikokay, then you are certified free to test anything you want :)
19:19povikkettenis: not yet
19:19joskeit sounded like you weren't sure if it works on t8103, so I tested myself ;-)
19:19povikkettenis: other then finding this
19:19povik sound-name-prefix = "Left Rear";
19:20joske has quit [Quit: Leaving]
19:22joske has joined #asahi-dev
19:31the_lanetly_052__ has joined #asahi-dev
19:33povikkettenis: maybe we should have a textual descriptions for speaker position, and let sound-name-prefix fallback to that?
19:34joske has quit [Ping timeout: 480 seconds]
19:43the_lanetly_052__ has quit [Ping timeout: 480 seconds]
19:56joske has joined #asahi-dev
20:09gladiac has quit [Quit: k thx bye]
20:10Glanzmann has joined #asahi-dev
20:34user982492 has joined #asahi-dev
20:50kettenisit seems that sound-name-prefix is only used to provide names for userland, but doesn't actually encode the topology
20:55ketteniswhat I would like to do in OpenBSD is have a single stereo sample stream and be able for the amplifier codecs to pick the right channel out of that stream
21:01roxfan has quit [Remote host closed the connection]
21:03roxfan has joined #asahi-dev
21:06poviki am proposing e.g. sound-speaker-position="Left Rear"
21:11roxfan has quit [Remote host closed the connection]
21:13roxfan has joined #asahi-dev
21:16kettenisyes, something like that
21:16kettenisshould be a closed vocabulary
21:16kettenisso a choice from a number of strings in the binding
21:17kettenisand maybe lower-case
21:17kettenismaybe it makes sense to use the "label" property for this
21:20poviklabel being the name-prefix, or something else?
21:20povik'label' verbatim?
21:30kettenis"label" is a generic device tree property to label a device and is often used to express the function of that device
21:31kettenisbut I guess this all highly depends on the views/preferences of the linux sound system maintainers
21:31kettenisand it isn't cear to me where such conversations happen
21:45joske has quit [Read error: Connection reset by peer]
21:50jannausigh, I should not use the virtual uart to upload retina display framebuffers
21:51jannauthat said experiments/dcp.py works on t6001
22:01jannauwithout HV dcp crashes with "Message 1: MMU out of tables: 200,200,0"
22:26user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
23:09user982492 has joined #asahi-dev
23:15yuyichao has quit [Ping timeout: 480 seconds]
23:15boardwalk has quit [Quit: Ping timeout (120 seconds)]
23:16boardwalk has joined #asahi-dev
23:26pFalken has quit [Quit: WeeChat 3.0]
23:31yuyichao has joined #asahi-dev
23:48user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
23:57King_InuYasha has quit [Read error: Connection reset by peer]
…