#
…

2023-01-16

02:32amarioguy has quit [Remote host closed the connection]
04:29ricekot has joined #asahi-dev
04:29ricekot has quit []
06:14greguu has joined #asahi-dev
08:03hertz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
08:07hertz has joined #asahi-dev
08:24bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
08:55chadmed_ has quit [Remote host closed the connection]
09:03d4vehey all- I need CONFIG_FTRACE=y for some eBPF observability work. So far I've just been recompiling the kernel with a modified config, but that gets tedious. Is there any chance of getting that enabled, and how would I go about proposing that?
09:13tim has joined #asahi-dev
09:14tim is now known as Guest1483
09:22balor has quit [Ping timeout: 480 seconds]
09:28povikdsharshakov: basically the argument against AOP is: (1) i would rather support a hardware interface than a firmware interface; (2) we have more control over the stream if we program LEAP ourselves
09:29povikas to your other question, AOP doesn't do beamforming, it hands over an isolated stream from each mic
09:30bps2 has joined #asahi-dev
09:37hertz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
09:58leitao has joined #asahi-dev
10:16pg12_ has joined #asahi-dev
10:18pg12 has quit [Ping timeout: 480 seconds]
10:44jluthra has quit [Remote host closed the connection]
10:45jluthra has joined #asahi-dev
10:57bps2 has quit [Ping timeout: 480 seconds]
10:57tim has joined #asahi-dev
10:58tim is now known as Guest1490
11:05Guest1483 has quit [Ping timeout: 480 seconds]
11:05bisko has joined #asahi-dev
11:12dsharshakov_ has joined #asahi-dev
11:13dsharshakov_povik: thanks. (1) is obvious (likely the firmware is changing continuously with each macOS version). However, what (2) gives you extra?
11:14dsharshakov_ has quit []
11:24povikwell, we don't know how likely it is for the firmware interface to change...
11:25povikand a counterargument is that the apple's firmware might abstract away a hardware difference on future models
11:25povikso it's not so clearcut
11:25povikanyway, re (2), we can at least disable some of the channels, if a single mic is all userspace can cope with
11:26bps has joined #asahi-dev
11:26povikand then there's the option of inserting more processing onto LEAP
11:26dsharshakov has joined #asahi-dev
11:26chadmedcould LEAP do multiband compression :P
11:27dsharshakovare other AOP nice features useful for us? AFAIK it can wake the system up on some events, what else?
11:27chadmed"hey siri" functionality (useless)
11:28dsharshakovsince if it will be needed later, its introduction will duplicate the works and block us from access to LEAP
11:28chadmedand probably airtag-like functionality for Find My (also useless)
11:28dsharshakovairtag-like functionality is likely to live on its own broadcasting everytime
11:29povikyeah, i am curious to what degree is "hey siri" implemented on LEAP
11:29povikmy guess is that it gives some initial low-confidence signal
11:29povikthat then wakes up AOP which confirms the detection
11:30svenAirTag stuff might also be mostly implemented inside the Bluetooth firmware
11:30dsharshakovsven: I've read it's shared between AOP and BT. Likely they be beaconing 100% independently from the OS
11:31dsharshakovAOP somehow sets configs and gives keys as well
11:31svenhrm, that sounds weird because then AOP would need a backchannel to the bt module
11:32povikdsharshakov: well, as to the other features of AOP: the only thing that comes to mind is that it reports the lid angle to the OS
11:32povikthat's at least on j316 i am experimenting on
11:33povikbut then there's a gpio line on gpio-aop which reports opened/closed lid
11:33povikwhich might be good enough for all our purpouses
11:34poviknot sure if wake-on-lid-open doesn't work already
11:36chadmednot under linux no
11:36hightower2 has quit [Ping timeout: 480 seconds]
11:36povikah, i can give the gpio we need to wake on :p
11:37chadmedthe smc has the hid event for the lid closing/opening but hid events seem to get suspended and the only way to wake the thing is with the hard power button
11:37chadmedjust like my old northwood p4 machine :P
11:38* poviklooks for a binding we may get away with filling it in
11:41poviknothing obvious so far
11:43dsharshakov has quit [Quit: Page closed]
11:47povikhm, not sure how this stuff is exposed internally in the kernel or to userspace
11:47poviki will leave it be for now
11:50chadmeddsharshakov: on mb compressor optimisation, all the dsp paths in lsp-plugins are written in assembly
11:54dsharshakov has joined #asahi-dev
11:55ChaosPrincesssven: apparently it does on iphones
11:56chadmedyeah, the headers in include are the assembly
11:56dsharshakoveither the core capacity for icestorm is lower or it still lacks some opt on AArch64
11:56svenChaosPrincess: that’s… very odd
11:57povikthere's the backchannel?
11:57svenI could maybe see AOP doing some power Management but I’d be very surprised if it did more than that for bt
11:57dsharshakovMaybe make compressor only kick in when loudness is higher than x? Might be clicky in that case...
11:58chadmedyeah that seems sus and would ruin lookahead
11:59svenlike, the sane way to do this is to have the AP pre-program the find my beacons in the BT chip and then put the BT chip to sleep. and then either BT has a timer to wake itself up or AOP wakes it up periodically to send those beacons
11:59chadmedin my testing the core power use is less than 4 W playing music through vlc with the dsp active, and this is without cpuidle so the pcores are still freewheeling
11:59chadmedits not that big of a deal at the end of the day, there are bigger targets to attack for power savings
12:01dsharshakovyes. However, let it sit in our thoughts, maybe I or you can figure out a newer option
12:03dsharshakovProbably when WirePlumber loads that filter it should be run within one wakeup (sound from pw-pulse -> *WKUP* -> filter in in wp -> ALSA plugin in WP -> *switch to kernel*
12:04dsharshakovwhat's the net power difference when removing the mb compressor?
12:04hightower2 has joined #asahi-dev
12:04chadmedfalls into noise since the pcores freewheeling are using most of the measurable power
12:04ChaosPrincesssven: schematic says that there is a spmi link between aop and wifi chip. could that be the 'backchannel'?
12:05chadmedthe smc's meters are pretty accurate but not THAT accurate
12:05chadmedi think itll be a bigger deal once we have deep idle
12:05chadmedbut for now its all academic but worth talking about
12:06dsharshakovyes. worth thinking (since I'm frequently thinking about whatever sound processing)
12:06dsharshakovwithout PSCI we don't even seem to have wakeups as a power measure
12:06dsharshakov has quit [Quit: Page closed]
12:06chadmedwell the cores never sleep :P
12:07chadmedthey just get put into their lowest pstate and freewheel there
12:21bps has quit [Remote host closed the connection]
12:42eiln has joined #asahi-dev
12:42Dementor has quit [Read error: Connection reset by peer]
12:42Dementor1 has joined #asahi-dev
12:42eilnmy very preliminary numbers show 0.010734896 sec/batch for inception_v3
12:42eilnpytorch (cpu) takes 1.61288843667 sec/batch
12:42eiln150x speedup, i'll take that :PP
12:45povikah, that's the gpu, not the neural coprocessor, right?
12:45j`eyno thats the ANE
12:45eilnno ANE!
12:46povikreally? that progressed pretty far then, being able to run a full network
12:48eilnstill relatively shallow networks only though, currently working on chaining buffers
12:48cylm has quit [Ping timeout: 480 seconds]
12:53hightower2 has quit [Ping timeout: 480 seconds]
12:56chadmed_ has joined #asahi-dev
13:18faruk has joined #asahi-dev
13:29svenChaosPrincess: sounds like AOP maybe takes care of waking up BT then
13:41faruk has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
13:46chadmed_ has quit [Remote host closed the connection]
13:49chadmed_ has joined #asahi-dev
14:18faruk has joined #asahi-dev
14:22kit_ty_kate has joined #asahi-dev
14:25seeeath has joined #asahi-dev
14:42flying_sausages has quit []
14:51faruk_ has joined #asahi-dev
14:52faruk has quit [Ping timeout: 480 seconds]
14:53flying_sausages has joined #asahi-dev
15:12marcanpovik: AIUI AOP also reports accelerometer data on at least some models
15:13marcanpersonally I'm more of the opinion that we should do whatever macOS does, even if it involves firmware, because diverging from that is more likely to come crashing down in bad ways with updates
15:13marcane.g. consider what happens if AOP starts talking to other firmwares or doing something special
15:14marcanthat depends on the specific hardware involved though
15:14marcanwhy do we care about LEAP even? if we're bypassing things, can't we just get the raw mic data before LEAP?
15:15hightower2 has joined #asahi-dev
15:16marcan< sven> like, the sane way to do this is to have the AP pre-program the find my beacons in the BT chip and then put the BT chip to sleep. <- this is exactly how it works or at least how it worked at some point, for iPhones when they *shut down*
15:16marcanhowever I don't know what happens during normal idle, clearly not that
15:16marcanmaybe AOP is in charge during normal idle and the AP programs the beacons for full standalone mode on transition to actual shutdown?
15:17svenhrm, or maybe the BT chip stays somewhat alive in normal idle for wake-on-bluetooth anyway and does everything itself?
15:17marcanchadmed: the cores don't "freewheel", they do go into idle, just not deep idle
15:17marcanwe aren't spinning lol
15:18marcanI think what happens is the cores shut down their clocks when you do that but not the cluster uncore
15:18marcan(and everything remains powered)
15:19marcanthe major reason why we have power usage proportional to pstate is probably just leakage current that comes with the higher voltage, not the actual frequency
15:19marcangoing into deep idle should power gate individual cores or the whole cluster if all cores are in that state, which will save all the leakage current
15:21marcan< chadmed> not under linux no <- what yes it does
15:21marcanwake on lid works perfectly fine
15:22marcan(using the SMC event)
15:22marcanif it doesn't work on some machines I'd like to know :p
15:24kettenismarcan: In case you missed it, I pushed a branch with my current u-boot PCI XHCI work
15:24marcankettenis: saw that, was going to mention we should probably blacklist the asmedia controllers until we support the firmware loading, and we need to talk about how to pass the firmware to u-boot
15:24kettenisI'm a little bit worried about what happens on the asmedia controllers without loading firmware though
15:25kettenisreading the firmware from NVMe will be a challenge
15:25marcanAIUI they play dead and time out a bunch of things, so best case it slows everything down, worst case it triggers badness
15:25marcankettenis: right, can we pass it to u-boot directly? it wouldn't be hard to append it to the m1n1 image (e.g. as a ramdisk) as part of the install process / m1n1 update
15:25kettenispassing the firmware in memory and putting the addresses in the device tree would make things easier on my end
15:25marcancan u-boot do anything useful with an initramfs passed to it?
15:26marcaninitramfs would be easiest because we already have that functionality in and it mirrors how it works for linux
15:26kettenisdon't think u-boot does initramfs, but I can have a look
15:26marcanIIRC it's just a /chosen property with the address/size
15:27marcanwould be nice if we taught u-boot how to minimally parse cpio (it's a very dumb format, and specifically only the version Linux understands) so we can just give it a subsetted vendorfw.cpio with just the components it needs (USB for now) and avoid a totally divergent mechanism
15:27kettenisbut it is in cpio format isn't it?
15:27marcancpio is really dumb
15:28marcankettenis: see driver-api/early-userspace/buffer-format.rst for a formal spec of the specific variant we care about
15:29faruk_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
15:30marcanwe can skip hardlink support for u-boot (I can at least guarantee we either never omit file contents or duplicate them for u-boot archives if it ever becomes necessary)
15:30marcanat that point parsing it is just parsing some hex numbers and looking for the filename you want
15:30kettenisright, sound doable
15:31kettenisand then the idea is to just cat the initramfs to boot.bin on the ESP?
15:31marcanand since m1n1 will uncompress the initramfs for us (if compressed) you don't need to care about that either
15:31marcanthe installer can just build a uboot-subset initramfs and tack it on at install time, update-m1n1 can do the same at update time
15:32povikmarcan: i thought the accelerometer is unpopulated
15:32povikor is it on m2 macbooks that they started to put it in?
15:32marcanpovik: I think it might be populated on at least some models
15:32marcanI've seen it in some ADTs I think
15:32povikanyway we don't want to bypass LEAP because it does the PDM-to-PCM decimation
15:32povikthe raw data it processes is a 2.4 MHz PDM stream
15:32ChaosPrincessmarcan: if you have time, mind looking at the z2 driver draft and checking if im not doing anything super dumb
15:33kettenisI'll need to teach the OpenBSD installboot about this trick, but that should be doable
15:33kettenis(not sure I mentioned it here, but OpenBSD now automatically updates boot.bin on the ESP)
15:35kettenisanyway, if someone could test my current u-boot branch on an iMac or Mac Studio I would be grateful
15:35marcanpovik: j314/j316/j493 have accel/gyro nodes under aop
15:36marcaninterestingly so does the m1 studio... which makes me wonder, but I wouldn't put it past apple to put an accelerometer in a desktop
15:36kettenisit's probably just part of one of the chips they need for other purposes
15:37marcannah, I think it was a discrete part in the schematics
15:37marcanIIRC it was designed in but unpopulated in the original m1 series, but it looks like they actually started populating it in m1pro/max unless the ADT lies
15:37povikhuh, i got the impression on j314 it's unpopulated
15:37povikat least i haven't seen anything that looks like imu data that AOP sends to macos
15:38povikthere were periodic lid angle measurements, so if the accelerometer was there, i would expect something similar
15:38marcanthey probably don't actually enable it?
15:38povikthere's an endpoint for it, i think it gets enabled, not sure anymore
15:39marcanchadmed: tested wake on lid open on j314 too, works fine
15:42kettenisbtw, we (OpenBSD) have gone execute-only .text on arm64
15:42kettenisbeen an interesting experience (and yes I know about the PAN issue)
15:47hertz has joined #asahi-dev
15:48sven$ boltctl list
15:48sven ? Apple Thunderbolt to Gigabit Ethernet Adapter
15:49svenstill doesn't show up in pcie though
15:49kettenishmm, how can it identify the adapter without pcie config space access?
15:49svenhuh.. good question
15:50mazseparate enumeration mechanism?
15:50mazover usb? (making things up...)
15:50svenlet me test again, maybe i just confused myself and it did show up
15:50marcandoesn't thunderbolt have its own enumeration at the thunderbolt level?
15:50svenI think there might be a separate enumeration at tbt level though
15:51marcanso it'd be identifying the TB device connected, not the PCIe device behind it
15:51svenprobably, it does have a UUID in boltctl as well that had to come from *somewhere*
15:51kettenisheh, shows how little I know about thunderbolt
15:51marcanyeah, pretty sure it's the idrom thing or whatever they call it
15:52mazfeels like it needs to trigger a rescan of the PCIe config space -- hotplug style.
15:52povikbtw, how does the wake on lid open work? does userspace configure hid events that should wake the system, and kernel does some filtering and possibly returns to sleep?
15:52svenyeah, i have code for the hotplug that "works" for the bt/wifi thing but doesn't for thunderbolt for some reason
15:52svenprobably another magic bit that needs to be set somewhere
15:53kettenissven, this is using your 2-3 converter?
15:53kettenismaybe I should get one since I have an old thunderbolt 2 ethernet dongle lying around
15:54mazdoes writing to "/sys/bus/pci/rescan" trigger anything?
15:55svennope. I've also never seen a port up event for the tbt root port so far
15:55sventhis smells like some "enable pcie tunnel" poke is missing somewhere
15:55marcanpovik: it's hardcoded in the SMC driver :p
15:55marcanit just considers the power button and lid open as unconditional resume events
15:56svenkettenis: the apple one is pretty cheap these days (50 eur or so) fwiw
15:56kettenisnot my definition of cheap ;)
15:56svenheh, fair
15:56povikmarcan: so you can't not wake at the moment?
15:56kettenisbut probably my cheapest option to get a thunderbolt 3 device
15:57marcanI think there is some general wakeup source control we could implement, not sure if there is a mechanism to outright pick specific HID events though
15:57povikhm, how can it not work for chadmed though
15:57marcanno idea :p
15:57povikis it possible this depends on some setting from macos?
15:57marcannot really
15:57marcanthese are standard SMC events
15:57marcanremember this isn't real idle
15:58marcanif the HID events work while the thing is running there's no reason they'd stop working during s2idle
15:58marcanSMC doesn't know the difference
16:10Guest1490 has quit [Quit: Guest1490]
16:25eiln has quit [Quit: Page closed]
16:28faruk has joined #asahi-dev
16:28leitao has quit [Ping timeout: 480 seconds]
16:29leitao has joined #asahi-dev
16:37hightower2 has quit [Read error: Connection reset by peer]
16:38bcrumb has joined #asahi-dev
16:42bcrumb has quit []
16:42bcrumb has joined #asahi-dev
16:42bcrumb has quit []
16:43bcrumb has joined #asahi-dev
16:43bcrumb has quit []
16:44bcrumb has joined #asahi-dev
16:44bcrumb has quit []
16:45cylm has joined #asahi-dev
16:48svenokay, with sone ugly hacks it also shows up on the pcie bus now. now I’ll just have to see how to work around the „dart MMIO only comes up after the pcie port is up“ and add support for that tbt dart MMIO layout
16:58hightower2 has joined #asahi-dev
17:31eiln has joined #asahi-dev
18:00bcrumb has joined #asahi-dev
18:00bcrumb has quit []
18:02bcrumb has joined #asahi-dev
18:36faruk has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
18:46hightower2 has quit [Ping timeout: 480 seconds]
18:52bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
19:10leitao has quit [Ping timeout: 480 seconds]
19:20tim has joined #asahi-dev
19:21tim is now known as Guest1517
19:23zzywysm has quit [Quit: Textual IRC Client: www.textualapp.com]
19:23zzywysm has joined #asahi-dev
19:26faruk has joined #asahi-dev
19:26bcrumb has quit [Quit: WeeChat 3.8]
19:27bcrumb has joined #asahi-dev
20:02bcrumb has quit [Read error: Connection reset by peer]
20:03bcrumb has joined #asahi-dev
20:05hightower2 has joined #asahi-dev
20:16cylm has quit [Ping timeout: 480 seconds]
20:53chadmed_marcan: mb, wake on lid does work
20:53chadmed_its the kb that doesnt work on my machine
21:03bcrumb has quit [Remote host closed the connection]
21:03bcrumb has joined #asahi-dev
21:30Guest1517 has quit [Quit: Guest1517]
21:31bcrumb has quit [Ping timeout: 480 seconds]
21:39bcrumb has joined #asahi-dev
21:49bcrumb has quit [Quit: WeeChat 3.8]
21:51hightower3 has joined #asahi-dev
21:51hightower2 has quit [Ping timeout: 480 seconds]
21:54roxfan has quit [Ping timeout: 480 seconds]
22:01zzywysm has quit [Quit: Textual IRC Client: www.textualapp.com]
22:05hightower4 has joined #asahi-dev
22:12hightower3 has quit [Ping timeout: 480 seconds]
22:29eiln has quit [Remote host closed the connection]
22:48chadmed_ has quit [Remote host closed the connection]
22:48chadmed_ has joined #asahi-dev
23:04seeeath has quit [Ping timeout: 480 seconds]
23:22faruk has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
23:33faruk has joined #asahi-dev
23:47roxfan has joined #asahi-dev
23:56hightower3 has joined #asahi-dev
…