#
…

2022-10-23

00:43thelounge7571340 has joined #asahi-dev
00:43thelounge7571340 has quit [Remote host closed the connection]
00:59whistlingoat has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
00:59whistlingoat has joined #asahi-dev
01:07whistlingoat has quit [Ping timeout: 480 seconds]
01:10Etrien__ has joined #asahi-dev
01:15Etrien_ has quit [Ping timeout: 480 seconds]
01:15Etrien__ has quit [Read error: Connection reset by peer]
01:15Etrien_ has joined #asahi-dev
01:25chadmed has joined #asahi-dev
01:45thelounge7571340 has joined #asahi-dev
01:46thelounge7571340 has quit [Remote host closed the connection]
02:48thelounge7571340 has joined #asahi-dev
02:48thelounge7571340 has quit [Remote host closed the connection]
02:51chadmed has quit [Quit: Konversation terminated!]
02:52chadmed has joined #asahi-dev
02:56chadmed has quit []
02:57chadmed has joined #asahi-dev
03:23chadmed has quit [Quit: Konversation terminated!]
03:25chadmed has joined #asahi-dev
03:33Etrien has joined #asahi-dev
03:33Etrien_ has quit [Read error: Connection reset by peer]
03:42chadmed has quit [Quit: Konversation terminated!]
03:44chadmed has joined #asahi-dev
03:48thelounge7571340 has joined #asahi-dev
03:48thelounge7571340 has quit [Remote host closed the connection]
03:57argonaut has joined #asahi-dev
04:02chadmed has quit [Quit: Konversation terminated!]
04:04chadmed has joined #asahi-dev
04:08chadmedpovik, marcan: thoughts on deactivating the * Mux kctls on the laptops? i dont see any need for a user to change them, and having them statically set in the driver eliminates one more avenue for misconfiguration
04:10chadmedalso fwiw the amp gain kctls dont have Volume in their name, so those gain caps in the fixup methods werent applying
04:12chadmed has quit [Quit: Konversation terminated!]
04:14chadmed has joined #asahi-dev
04:14chadmed has quit []
04:15chip_x has joined #asahi-dev
04:16chadmed has joined #asahi-dev
04:16chadmedignore that last message
04:22chipxxx has quit [Ping timeout: 480 seconds]
04:54thelounge7571340 has joined #asahi-dev
04:54thelounge7571340 has quit [Remote host closed the connection]
05:06thelounge7571340 has joined #asahi-dev
05:07thelounge7571340 has quit [Remote host closed the connection]
05:42gaudem has joined #asahi-dev
06:12thelounge7571340 has joined #asahi-dev
06:12thelounge7571340 has quit [Remote host closed the connection]
06:29Etrien_ has joined #asahi-dev
06:33Etrien has quit [Ping timeout: 480 seconds]
06:39Etrien has joined #asahi-dev
06:46Etrien_ has quit [Ping timeout: 480 seconds]
07:00duban6 has quit []
07:05duban6 has joined #asahi-dev
07:23thelounge7571340 has joined #asahi-dev
07:23thelounge7571340 has quit [Remote host closed the connection]
07:51gaudem has quit [Quit: Connection closed for inactivity]
07:55Etrien_ has joined #asahi-dev
07:57Etrien has quit [Ping timeout: 480 seconds]
08:10Etrien_ has quit [Read error: Connection reset by peer]
08:11Etrien has joined #asahi-dev
08:29thelounge7571340 has joined #asahi-dev
08:29thelounge7571340 has quit [Remote host closed the connection]
09:06jeffmiw has joined #asahi-dev
09:07povikchadmed: well, there's one weak case for when they could be useful: user not employing speaker EQ, feeding speakers directly, having both speakers and headphones on primary, switching between one and the other using 'pin' controls (which enable the endpoints) instead of restarting playback on different device
09:07povikthat's the geneeral case for it
09:08povikarguably it's more useful on mac mini/studio than on the laptops, but i would rather not introduce additional differences into macaudio across models
09:08povik06:10 < chadmed> also fwiw the amp gain kctls dont have Volume in their name, so those gain caps in the fixup methods werent applying
09:08chadmed^ yeah that was the message to ignore, i realised what it was doing immediately after i sent that
09:09poviki guess you figured out some tools don't show the control name in full. if the caps weren't being applied, the driver would refuse probe. really, you should be giving more credit to the driver ;)
09:11chadmedheh yeah, i think i have a better idea of whats going on now that ive spent all day staring at macaudio.c
09:11povikhaha, hope it wasn't too bad an experience :p
09:12chadmedonce i got my head around the OF parsing functions it was fine :)
09:13povikthose are beefy. patches to ease reading of them welcome
09:13chadmedlooking at other drivers though, it seems like everyone else hard codes TDM slots based on the hardware. obviously we cant do that since we have lots of different devices to support, but theres also the dai-tdm-slot-num DT property that we may be able to take advantage of
09:13chadmedbut since the problem is on the frontends and not the backend DAIs, i cant really see how we would enforce the number of TDM slots unless we could make the safe assumption that the secondary frontend is always the internal speakers, which is why i asked about it
09:16jeffmiw has quit [Remote host closed the connection]
09:23povikre dai-tdm-slot-num. i know it's there. i moved away from the approach of describing the DAI links in full in the DT since there's just too many details and they are tied to internal ASoC representation instead of being inherent to the hardware, so compatible="apple,j313-macaudio" must be where all those details are hidden in
09:23povikincluding, as you point out, not having a DT representation for the frontend links, since those are an ASoC vehicle
09:24povik11:13 < chadmed> but since the problem is on the frontends and not the backend DAIs, i cant really see how we would enforce the number of TDM slots unless we could make the safe assumption that the secondary frontend is always the internal speakers, which is why i asked about it
09:24povikwe shouldn't enforce the slots (which would constrain the number of channels in mca.c), we should constrain the number of channels from macaudio.c directly
09:25povikand that we can do to the maximum number of channels on a backend link, so to the number of speaker channels
09:25povikso there's not much we need to assume
09:27chadmedso basically look at the backends, get the max number of channels on any one backend, then set a constraint to that number on secondary?
09:27povikexactly. you can set the constrain on all frontends
09:27povikon the primary, it will be a no-op, since it's already constrained by slots
09:27povikbut it's better than to special-case
09:35thelounge7571340 has joined #asahi-dev
09:35thelounge7571340 has quit [Remote host closed the connection]
09:36povikchadmed: if you want to give implementing it a go, i think you should apply the constrain in .startup of macaudio_fe_ops
09:37povikthen call the alsa constraint function like in the recent channels-according-to-slots MCA patch
09:38chadmedack, ill have a go of it on tuesday
09:58jannausven: does apple-dart miss a check to prevent .domain_alloc or at least .attach_dev if there's already a device attached to a specific dart sid?
10:01svenuhh… maybe. Not sure if that’s indirectly enforced by the iommu groups
10:01jannauI started looking into switching piodma to an unmanaged domain. I've currently just create the domain and attach piodma to it. everything still works since the dart is locked but if it wasn't it would be completely broken
10:02svenDoesnt the iommu api look up the piodma group and then just switches the domain on attack for that group?
10:03sven*attach
10:06jannauthe group in sysfs still says DMA as type but I end up apple_dart_attach_dev() with domain->type IOMMU_DOMAIN_UNMANAGED
10:07jannauso I think the default domain is still there and keeps working
10:07svenAnd I assume dart_attach_dev succeeded?
10:09jannauit doesn't prevent iommu_attach_device() from succeeding
10:10svenhm, weird
10:11sventhis sounds like something the iommu api should enforce tbh
10:11svenit knows which device belongs to which group and shouldn’t allow a group to be attached to two domains
10:12jannauI think I spotted in the path in iommu.c just a check if there's just a single device in the group
10:15svenit just sounds like an issue every driver would have
10:15svenand something that can be easily caught in the iommu core
10:15svenand also something that should already work tbh
10:16svenvfio more or less does the same thing: create a domain and then attach a device to it that probably still had the default dma domain
10:21jannauI guess it works as long as just the last domain which has device attached is used
10:22svenyeah, but that's by design
10:23sveni'm more concerned that sysfs still shows DMA after attaching the unmanaged domain
10:23svendomain really just means "pagetables with some mappings"
10:23sventechnically a domain doesn't need to know about which devices it will be attached to
10:23svenand it's perfectly fine to have two domains with valid mappings to you keep switching
10:24sven+which
10:26sven(the iommu api is a bit confusing because dart has to hack around it quite a bit. this will all get better once robin's cleanup series is done)
10:29jannauthere is a check in iommu.c __iommu_attach_group(), the default and blocking domains can be replaced this way
10:30jannauexcept there is nothing in in apple-dart which can switch between two pagetables
10:31jannauapple_dart_hw_set_ttbr() is only called from attach_dev path
10:32svenisn't attach_dev called from attach group eventually?
10:38thelounge7571340 has joined #asahi-dev
10:38thelounge7571340 has quit [Read error: Connection reset by peer]
10:38jannausysfs shows the type of the default domain
10:45jannauI think everything is working more or less as expected, the default_domain handling is a little surprising and that dma_map_sgtable() still works with the unmanaged domain
10:48svenhuh, dma_map_sgtable should go through the dma-api code and create the mapping there
10:48svenso they shouldn’t appear in the unmanaged domain
10:49r0ni has joined #asahi-dev
10:55jannauit ends up in the dart pagetable, not sure how it gets there but the default domain and the unmanaged can write both there
10:58svennow that sounds broken
10:58svenonly the currently attached domain should be able to write there
10:59svenbut that’s also related to the part where the dart driver has to hack around the iommu so it’s quite possible I messed that up
11:00jannauI don't see how we can enforce that if we map the L1 table for locked darts and the devices is not detached from the default domain
11:00jannauit's only a problem for locked darts and how they are handled right now
11:03jannaustill a strange that dma_map_sgtable continues to work. I would have expected errors
11:03svendma_map_sgtable will just create a mapping in the default domain that's not attached anymore
11:03svenand creating mappings in unattached domains is totally fine
11:04svenone way around this for locked darts is to have a shadow copy of the L0 pagetable that's used by iopgtbl the entire time and not memmap anything. then whenever there's a map/unmap you just memcpy(locked-l0, shadow-l0)
11:05svenyou can even optimize that with the flush/invalidate callbacks to only memcpy the required entries
11:05sventhen device attach is just "memcpy(locked-l0, domain-l0)" and each domain has its own domain-l0
11:06sven(maybe s/L0/L1/, i don't remember the terminology. in the above line L0 = "first level pagetable that sits in memory and is configured in the locked TTBR register")
11:06jannauyes, we still need a way to figure out which is the active
11:07svenfor each domain you always have a valid allocated shadow-l0
11:07svenand iopgtbl only writes to that
11:07jannauonly the active domain can sync to the real L0 table
11:08svenand then only the flush/invalidate callback moves the required pointers to the real l0
11:08svenoh.. true
11:08svenso for the default domain detach is never called?
11:09svenyou could probably stash the currently active domain into the group data and only do the l0 sync in flush/invalidate if domain == get_group(dev)->domain
11:10jannaudetach_dev doesn't seem to be called at all, even for an explicit iommu_detach_device()
11:11svenhuh, I wonder if that's intentional or a bug inside the iommu core
11:11jannauon the other hand there seems to be an attach_dev for the default domain after detach
11:12sventhat makes sense
11:15jannau"New drivers should support default domains and so the detach_dev() op will never be called"
11:17svenso essentially stuffing the currently active domain into the group data on attach and then only syncing to the locked table in attach/flush/inval should work for locked darts
11:17svennot great.. but oh well
11:18svenor maybe even stuff it into something in struct apple_dart. dart->fake_ttbr = domain; :-P
11:18sven(or actually dart->fake_ttbr[sid])
11:21sven[ 2.610175] apple-mailbox 271c08000.mbox: Try increasing MBOX_TX_QUEUE_LEN *sigh*
11:22svenmarcan: ^-- so I can reliably overflow the mailbox queue with just lots of dcp debug spam. kinda surprised lina hasn't run into this with the gpu yet
11:41thelounge7571340 has joined #asahi-dev
11:42thelounge7571340 has quit [Remote host closed the connection]
11:49Adelphos has joined #asahi-dev
11:49Adelphos was kicked from #asahi-dev by ChanServ [You are not permitted on this channel]
11:49Adelphos was banned on #asahi-dev by ChanServ [*!*@169.150.196.*]
12:02svenhrm, when tracing I can see the dcp->ap call that sets all modes but for some reason they aren't propagated to drm correctly I think
12:09svenhuh, looks like parse_mode fails for all of them
12:28pg12 has quit [Quit: pg12]
12:29marcansven: lina's GPU stuff is synchronous right now, so you can't run into it unless you have MBOX_TX_QUEUE_LEN/2 apps actively rendering simultaneously I guess
12:29marcanso... that's a global define?
12:29marcancan we just yeet this thing already?
12:29marcanthis is a giant mess
12:30svenyup, global define
12:30svenand apparently the three(?) context switches in the tx path are enough to overflow that queue
12:30marcankill it with fire please.
12:31marcanif you come up with something to migrate RTKit to an internal implementation in soc/apple I will merge it and push for it upstream
12:32svenyeah, it should be simple enough
12:32svenive hacked the define to 200 for now to debug DCP
12:33marcanalso for lina, I think she can make the hardware tx queue unable to ever block, since she has 12 pipes I think? and 12 < 16
12:34marcanthe shared mailbox code can keep a ring log of the last 16 submissions, and then a special TX function could poll the pending ones (reading the rptr from the hardware) and elide the send if there is already an identical message queued
12:35marcan(since mbox messages for AGX are just doorbells)
12:36svenfor DCP syslog the rx path seems to be much faster than the tx one which results in that overflow
12:36svenprobably because the rx one doesn’t have those additional context switches in there
12:36marcanyeah lol
12:36pg12 has joined #asahi-dev
12:51jannauhow does the parsing fails? I hope it's not the color mode check I added for lina's capture card / glmark2-drm
13:05thelounge7571340 has joined #asahi-dev
13:05svennot sure yet, went for lunch and now i'm gonna add more tracepoints to see what's going on
13:06thelounge7571340 has quit [Remote host closed the connection]
13:19sveniomfb_parse_mode_success: id: 70d, best_color_mode: -1, virtual: 0, score: 119
13:19svenlooks like they all have best_color_mode = -1
13:19svenlet me also add tracepoints to the color modes
13:26jannauI think we're just parsing id and score for the color modes and skip other fields. the python parsing code does more
13:27jannauI should have asked lina for the data the parse stumbles over
13:35svenhuh, looks like dcp_parse_foreach_in_array(handle, outer_it) never does a single iteration
13:35svenin parse_color_modes
13:39jannaumaybe it's not an array if it's just a single entry?
13:39sventrying to dump the raw dcp->chunks.data, dcp->chunks.length now
13:40jannauthe extra tracer logs it and saves it as hex string
13:41jannaupython m1n1.fw.dcp.parse_log dcp.log parses it
13:43jannauand prints it if uncomment "#pprint.pprint(self.dcpav_prop[key])"
13:43svenhrm, let me see if I can get the tracer to work
13:44svenwhat's the "extra tracer"?
13:44jannauthe commented line at the end of trace_dcp.py
13:45jannaujust extra logging
13:47svenpython: Relative module names not supported
13:47svenurgh..
13:48jannauis there a ColorElements dcpav_prop?
13:49svenwhere's dcpav_prop?
13:51jannauthe chunks, iirc dcp sends 3 different types of chunks
13:51svenright, but how can I get that from a trace?
13:51jannau >d[0x0] D124 UnifiedPipeline2::setDCPAVPropEnd(key='ColorElements') = True
13:51jannauit's in the trace
13:54sven(also, lol, I just realized I reimplemented dcp's parse.c in much dumber because I didn't realize it's the same format)
13:55jannaubut judging from your trace it looks like there are no color modes
13:56jannaudo you have a macos with the same "monitor"? please look at the parameters for set_digital_out_mode
13:58svenhm... I guess something with the DPTX code is broken
13:58svenset_digital_out_mode(arg0=82, arg1=38) <-- that's what happened when I used this capture card with dcpext.py
13:59kettenisupdated the asahi-next and asahi-bootmenu u-boot branches to the upstream master
13:59kettenisstill looking for somebody to test asahi-bootmenu on a system with multiple ESPs
14:00kettenis(without applying the distroboot hack on top of that)
14:01svenuhhhh.... now DCP crashes when running macos
14:02jannausven: python code parses ColorElements and selects the best scored ID
14:02jannausee get_color_mode()
14:03jannauI wonder what those "UnsafeColorElementIDs"
14:05svenokay, macos uses Message: A412 (IOMobileFramebufferAP::set_digital_out_mode(unsigned int, unsigned int)): (in 0x8, out 0x4)
14:05svener.. wait.. that's not actually the mode ids
14:06sven 00000a10 0a 00 00 09 43 6f 6c 6f 72 4d 6f 64 65 73 02 00 |....ColorModes..|
14:06sven 00000a20 08 00 00 02 0d 00 00 01 05 00 00 09 53 63 6f 72 |............Scor|
14:06sven 00000a30 65 01 00 00 40 00 00 04 37 b5 03 00 00 00 00 00 |e...@...7.......|
14:06sven 00000a40 02 00 00 09 49 44 02 00 40 00 00 04 48 00 00 00 |....ID..@...H...|
14:06svenlooks like it gets color modes though. guess something on the dptx side is broken then
14:06thelounge7571340 has joined #asahi-dev
14:07thelounge7571340 has quit [Read error: Connection reset by peer]
14:12jannauif you uncomment "#pprint.pprint(self.dcpav_prop[key])" dcpext.py will print the parsed Color/Timing Elements
14:14svendcpext.py is kinda broken now :D
14:14svenbut i already don’t see all the dptx calls that I expect in Linux
14:22mpskettenis: any hint or doc how would multiple esp work? create two or or more esp on same disk?
14:23kettenistwo proper installs using the Asahi installer
14:23mpsaha, thanks
14:24kettenisI don't want to be rude, but this probably should be tested by somebody who understands how multiple ESPs work
14:27mpsnp, I just wanted to get idea how it would work, not to test it now
14:48henry has joined #asahi-dev
14:59jannaukettenis: booting works. any idea how to handle "/chosen/asahi,efi-system-partition"?
14:59jannauwhat would be required to have labels for the boot entries
15:04kettenisjannau: see the "HACK: Use designated ESP" commit on that branch
15:06kettenisregarding labels, that can be done through UEFI variables
15:06kettenisthose can be created from u-boot and will land on a file on the designated ESP
15:07jannauthat didn't work for me, it was still the m1n1 set one although I booted a different partition
15:07kettenisubootefi.var is the name of the file
15:09kettenisjannau: oh you mean if you deliberately boot from a different disk, u-boot should change "/chosen/asahi,efi-system-partition"?
15:09thelounge7571340 has joined #asahi-dev
15:10thelounge7571340 has quit [Remote host closed the connection]
15:11jannauyes, asahi-scripts uses that variable
15:12jannauthe better option would be to prevent booting from other ESPs
15:13kettenisHow would you boot an installer on a USB stick?
15:13jannauprevent booting from other nvme ESPs
15:18ketteniswell, I think having a single ESP and use that to boot multiple OSes should be allowed
15:20amarioguy has joined #asahi-dev
15:22jannauI have no problem with the allowed but I don't think it will be an supported config and the boot menu makes it far to easy
15:26kettenisanyway, I'll look at what needs to be done to update the value
15:57kettenis_ has joined #asahi-dev
15:59kettenis_ has quit [Remote host closed the connection]
15:59kettenis has quit [Ping timeout: 480 seconds]
16:08kettenis has joined #asahi-dev
16:11thelounge7571340 has joined #asahi-dev
16:11thelounge7571340 has quit [Remote host closed the connection]
16:53marcansingle ESP with multiple OSes installed is "supported" in the "you get to keep the pieces when it breaks" sense
16:53marcanthere's a single set of DTs, a single firmware bundle, and I bet a world of pain once SEP support is in
16:53marcanbooting via USB is a special case where the USB OS should not be mucking around with the system ESP in principle
16:54marcanhaving several co-habitating OSes with a single ESP probably won't be a supported config ever if you want to have everything work as expected with automation
16:54marcanif you're hacking around manually, sure
16:54marcanbut I don't think it's something we ever want to offer to end users by default
16:55marcanand given the DT mismatch, I don't think we should allow booting from other nvme ESPs, yeah
16:55marcanthat means the user did something wrong
17:10henry has quit [Read error: No route to host]
17:17jakebot6022 has quit [Ping timeout: 480 seconds]
17:20tobhekettenis: bootmenu works here too. labels would be nice
17:23tobheand it looks like aplaudio doesn't like my 6.0 DT
17:23thelounge7571340 has joined #asahi-dev
17:23thelounge7571340 has quit [Remote host closed the connection]
17:25kettenistobhe: yes that's a know issue (it doesn't crash does it?)
17:25kettenisbut aplaudio(4) doesn't work yet on the M2 anyway ;)
17:25tobheit does on my m2
17:26tobhewell ;)
17:39pthariensflame has joined #asahi-dev
17:39pthariensflame has quit []
17:43thelounge7571340 has joined #asahi-dev
17:44thelounge7571340 has quit [Remote host closed the connection]
17:44amarioguy has quit [Remote host closed the connection]
17:47ChaosPrincesswhat does the aop do that would be useful in linux? Do you have to enable to enable it to even get the built-in mic signals?
17:56jannaupovik: any idea what could cause "apple-admac 238200000.dma-controller: missing or invalid apple,internal-irq-destination property" on j457
18:02___nick___ has joined #asahi-dev
18:02___nick___ has quit []
18:05___nick___ has joined #asahi-dev
18:17povikjannau: yes. old driver seeing recent devicetree
18:17povikthere's been a breaking change in the binding some time ago, dropping that irq-destination property
18:17povikChaosPrincess: yes. at least that's how macos does it
18:17poviki would love to skip it and "access" the mics directly
18:18povikit's easy to do other than we should write our own LEAP firmware in that case, instead of needing the one that's embedded in AOP firmware
18:18povikwhat's LEAP you ask? it's another processor i discovered is on the SoCs!
18:18jannaupovik: yes, neverming. I had EFI_ZBOOT enabled causing me using an Image.gz
18:19povikLEAP does signal processing we probably don't want to skip over, and apple's firmware for it clocks at ~500 instructions
18:19j`eyjannau: whats the usae case for zboot for you?
18:19povikand it's mostly repetitive
18:19jannauj`ey: compressed kernels with systemd-boot
18:20povik(i have been thinking the past few days about how we could crowdsource the description of the custom ISA it seems to have. we can single-step on the processor)
18:20amarioguy has joined #asahi-dev
18:53thelounge7571340 has joined #asahi-dev
18:54thelounge7571340 has quit [Remote host closed the connection]
19:17jluthra_ has quit [Remote host closed the connection]
19:17jluthra_ has joined #asahi-dev
19:59thelounge7571340 has joined #asahi-dev
19:59thelounge7571340 has quit [Remote host closed the connection]
19:59ljs has joined #asahi-dev
20:08___nick___ has quit [Ping timeout: 480 seconds]
21:00thelounge7571340 has joined #asahi-dev
21:01thelounge7571340 has quit [Remote host closed the connection]
21:03ljs has quit [Remote host closed the connection]
21:14Etrien_ has joined #asahi-dev
21:18Etrien has quit [Ping timeout: 480 seconds]
21:33Etrien has joined #asahi-dev
21:37Etrien_ has quit [Ping timeout: 480 seconds]
21:47SSJ_GZ has joined #asahi-dev
22:00yrlf has quit [Quit: The Lounge - https://thelounge.chat]
22:01yrlf has joined #asahi-dev
22:13thelounge7571340 has joined #asahi-dev
22:14thelounge7571340 has quit [Remote host closed the connection]
22:20SSJ_GZ has quit [Ping timeout: 480 seconds]
23:30thelounge7571340 has joined #asahi-dev
23:30thelounge7571340 has quit [Read error: Connection reset by peer]
23:31zkrx has quit [Read error: Connection reset by peer]
23:31zkrx has joined #asahi-dev
23:33zkrx has quit [Read error: Connection reset by peer]
23:49zkrx has joined #asahi-dev
…