marcan changed the topic of #asahi to: Asahi Linux: porting Linux to Apple Silicon macs | Not ready for end users / self contained install yet. Soon. | General project discussion | GitHub: https://alx.sh/g | Wiki: https://alx.sh/w | Topics: #asahi-dev #asahi-re #asahi-gpu #asahi-stream #asahi-offtopic | Keep things on topic | Logs: https://alx.sh/l/asahi
joske has quit [Remote host closed the connection]
jbowen has quit [Ping timeout: 480 seconds]
aleasto has quit [Quit: Konversation terminated!]
<povik>
yeah, that's right, i meant MIXER knob on the low-level audio card
<povik>
anyway i may have found where the i2c issues lie
andi-[m] has left #asahi [#asahi]
<j`ey>
povik: ooh
<povik>
hm?
<povik>
oh, the i2c issues
yuyichao_ has quit [Ping timeout: 480 seconds]
<povik>
the codec may be upset because it transitions to an external MCLK clock before it
<povik>
* it's ready
<povik>
(the clock)
<povik>
reading the datasheet it looks like that can spill over to failed register accesses
<Glanzmann>
povik: With the patch the system feels faster, I had the feeling that it was hanging before. Sound works. Here is the dmesg: https://pbot.rmdir.de/yvxoM7hZr_BQ8_H_ezhhfg
<Glanzmann>
The sound was working without modifying the knob after the reboot and it was a little bit loud. So I had move the volume down. The volume and mute keys work.
<Glanzmann>
povik: Thank you for your patch and sound support.
<Glanzmann>
also check pavucontrol that the right card is selected.
<joske>
the 2 first, the others don't move
<Glanzmann>
and use mpv to play a sound or so.
<joske>
gotta go help get the kids ready for school brb
<mps>
Glanzmann: that is why I don't use such things like pulseaudio/pipewore/systemd and other 'smart' solutions. these are not solutions but are the problem
<mps>
I use plain alsa fpr audio
<mps>
(perfection is not when you don't have anything more to add but when you don't have anything more to remove - ascribed to Leonardo da Vinchi)
<joske>
mps: you're the one that uses fvwm? ;-)
<mps>
Glanzmann: would you mind to post your kernel config to me, I would like to compare or build straight with your config
<mps>
joske: no, this one is Glanzmann, I use awesome wm (similar window managers to some degree)
marvin24_ has joined #asahi
<joske>
well if you use debian it makes sense that you use some ancient WM ;-)
<mps>
joske: no, I use alpine linux
<joske>
I meant Glanzmann
<joske>
alpine linux user are also a special bunch I'd say
<mps>
joske: :-)
<joske>
I used to run gentoo, but that got tiring very quickly
<mps>
joske: what then are your thoughts about alpine developers ;)
<joske>
well, I think they are a knowledgable bunch, alpine fills a specific need very well
<joske>
but it's not a desktop OS
<joske>
very useful for docker
marvin24 has quit [Ping timeout: 480 seconds]
<mps>
joske: I use it as desktop for more than 3 years (also my daughter use it as desktop) and there are a lot of other people
<joske>
yes, like I used fvwm in 1996 ;-)
<joske>
you *can*
<mps>
joske: postmarketOS is is distro for phones and tablets and it is based on alpine
<joske>
I only ever ran it in containers, never actually installed it on hardware
<joske>
mps: sure, it's a lite base OS
<mps>
joske: nowadays it has kde, gnome and other similar things, which I don't like to have on alpine repo but I lost this batle where I was fighting against adding these
<joske>
povik: My system seemed to freeze during playing with alsamixer
joske has quit [Remote host closed the connection]
joske has joined #asahi
<joske>
disabled pulseaudio and reboot and now I have sound via audio jack :-)
<mps>
joske: heh nice (I told pulseaudio is problem not a solution :-) )
<joske>
well I haven't had any problem with it until now
<marcan>
pulseaudio is kind of required for a smooth audio experience these days (e.g. automatic jack/speaker switching) and we're going to have to build something around that for speaker EQ... but there's also PipeWire which I very much look forward to using
<marcan>
so maybe I'll focus on PW first :)
<joske>
marcan: for me there is only 1 thing stopping me from using asahi as daily driver: 4k pages support so I can use vs code
<joske>
battery indicator and sleep would be nice though ;-)
<marcan>
battery indicator I might make work in a stream starting in a few minutes, after I finish eating a snack ;)
<marcan>
sleep... that's a much longer term problem :p
<joske>
marcan: yay :-D
<joske>
sleep not such a big deal, it boots fast enough
<joske>
shutdown would be nicer I'd say
<marcan>
shutdown should be easy
<joske>
:-)
<marcan>
also, I'd like to hear about what kind of battery drain rate people get with an up, but idle system, especially with no userspace processes waking things up (powertop etc)
<marcan>
macOS can do insanely well there
<marcan>
and I want us to be the same, but that will take some polishing
<joske>
well with Xorg taking 50% cpu all the time...
<marcan>
all the time? even when not doing anything?
<joske>
yes
<ChaosPrincess>
joske: boots fast if you set asahi as primary, but otherwise the stock macos boot picker is super slow
<marcan>
that sounds like a bug
<marcan>
like some app is rendering something at full blast or something
<joske>
can try to kill firefox
<marcan>
that's another big thing: getting battery life to be as good as macOS, partially, means policing userspace and fixing that kind of nonsense
<marcan>
I want to build per-process power stats stuff like macOS has some day
<marcan>
ideally display-off idle should be not much worse power consumption than true sleep mode
<joske>
yes still 50% on 1 core, with just hexchat and a few terminals open
<marcan>
on macOS I get like 1% battery drain per hour with the OS up and an active SSH session printing stuff every minute
<marcan>
which is excellent
<marcan>
(I don't think any intel system can do that)
<marcan>
but that's only ever going to work if the userspace UI isn't doing dumb things
<joske>
the battery life is quite nice despite the 50% xorg
<marcan>
yeah
<marcan>
also consider you're running at 2GHz right now, still need to rewrite the cpufreq patches
<joske>
but as there's no battery indicator I can't really say
<marcan>
pcores can go up to 3.2GHz
<joske>
I think I'm running with 3GHz
<marcan>
ah, you changed something?
<joske>
can I check that?
<joske>
I used a patch posted here
<marcan>
if you're using stock m1n1 and nothing special in the kernel, everything is at 2GHz
<povik>
joske: in the dmesg it looks like your system tries to suspend. that could be the freeze and hopefully that's not related to audio stuff
<joske>
povik: it's working now
<povik>
as to why you had to disable pulseaudio, i don't know
<marcan>
I just picked 2GHz as a nice "faster than low, but not full blast" point, that also happens to make the e-cores and p-cores about ~equal in frequency
<joske>
well it's still early days
<marcan>
but that shouldn't matter much once cpufreq is done
<povik>
my hunch is that it was the reboot that helped, and communication with cs42l83 is simply still not reliable
<marcan>
"You are not allowed to use the contents of this document unless you openly publish
<marcan>
all the new information found with a single exception of having NDA with Apple."
<marcan>
not that "what SMC keys do" is copyrightable, but that statement sets off my legally dubious license detector
aleasto has joined #asahi
<joske>
kettenis: I knew that already (I hackintosh also ;-))
<sven>
lol
<kettenis>
legally totally unenforcable
<kettenis>
and I openly publish my source code ;)
<landscape15[m]>
joske: I guess everyone here has ever built an Hackintosh :) but I can’t understand how virtualSMC can help.
<nico_32>
mapping a keyname to something readable
bisko has joined #asahi
<kettenis>
I noticed there is a whole cottage industry of closed source Mac Apps that display temperatures and let you tweak fans
<povik>
haha, i guess one can make a living off that
<kettenis>
I bet that notice is just a misguided attempt by the VirtualSMC guy to have those folks rip him off
<kettenis>
I ran across one of those guys using the github issue tracker for hist closed source app
<nico_32>
that's Microsoft approved since they do it for windows component
<nico_32>
i wonder if vmware is going to port their ESXi-arm to the m1
<landscape15[m]>
nico_32: m1n1 is already an hypervisor. The porting shouldn’t need too much effort for vmware
<maz>
nico_32: there are no technical obstacle to it.
<kettenis>
my understanding was that ESXi requires ACPI though
<maz>
that's something they could work around (though shoehorning AIC and DART into ACPI could be... fun...)
FireFox317 has joined #asahi
<nico_32>
they want the platform to be ServerReady compliant so uefi, acpi, etc ...
<maz>
schaha! wrong platform then.
<maz>
it isn't even ARM architecture compliant, so forget about everything else.
<nico_32>
so no more pile of mac mini running esxi for macOS CI :(
<maz>
well, not if they only want to support standard HW.
<ChaosPrincess>
aic and dart are the difficult parts
<ChaosPrincess>
uefi and acpi can be done in software
<maz>
but I wouldn't put it past ARM to create a special ServerReady category just for the M1. that's what they do for every broken HW implementation out there.
<maz>
ChaosPrincess: you can't fit AIC or dart in ACPI without a major revision of the spec.
<kettenis>
I don't think there is any platform that actually meets the spec
<maz>
there are. the Ampere stuff is reasonably correct, for example.
<maz>
a handful of machines, and mostly software models.
<maz>
and ARM will hand out exemptions for each and every broken system anyway.
<maz>
to the point where ServerReady doesn't mean anything.
<kettenis>
eMAG still had PCIe quirks in the Linux kernel, but those may have been for things outside the spec
<maz>
they got an exemtion for it. I think Altra is sort of OK in that respect (I booted fairly old kernels on it without any extra patch).
<maz>
(although their IORT table is... interesting...)
<kettenis>
the _DMA properties also don't make much sense
<kettenis>
OpenBSD runs on eMAG without any PCIe-related quirks, but we largely ignore all the fancy new stuff, so that probably helps
<kettenis>
but yes, ServerReady is mostly just marketing bullshit ;)
<maz>
the fun begins when people use the SR argument to justify adding terrible quirks to support ACPI on HW that really shouldn't use that.
<kettenis>
the raspberry pi was an interesting experiment, but ACPI is still a bad idea on a SoC like that
<maz>
exactly.
<maz>
lx2160a is the poster child of such madness.
<mjg59>
ACPI suffers hugely from being a spec intended to solve a specific problem ("How do we provide some sort of abstraction layer for x86 that isn't int calls") that got kind of out of control
<mjg59>
I'm still confused how Toshiba ended up involved in 1.0
<maz>
that's the core of the problem: instead of an abstraction layer, people want to use it as a quirk description mechanism.
<kettenis>
mjg59: to move japan away from pc-98?
<marcan>
joske: well you did manage to send me down a rabbit hole instead of streaming today... but I just got somewhere
<marcan>
let's see if this yields anything :-)
<mjg59>
Taking an ecosystem that thrives on low-level differentiation and trying to re-model it on an ecosystem that has spent decades trying to be 100% compatible with a computer released in 1981 turns out to be hard
user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
joske has quit [Remote host closed the connection]
kgarrington has joined #asahi
kgarrington has quit [Remote host closed the connection]
joske_ has joined #asahi
<joske_>
marcan: :-(
joske_ has quit []
joske has joined #asahi
Genbuchan[m] is now known as GenbuchanPS5[m]
<mps>
hmm, replugging usb stopped to work for me, dmesg says `dwc3 502280000.usb: Configuration mismatch. dr_mode forced to host`
<Glanzmann>
mps: I'll try later today and let you know if it works for me.
<mps>
Glanzmann: thanks in advance
joske has quit [Remote host closed the connection]
<Glanzmann>
ChaosPrincess: Do you hear clicks in the hadphone when you boot?
<Glanzmann>
head*
<ChaosPrincess>
12.0.1 firmware, asahi installer of version that i no longer remember, and u-boot that looks close enough to what is in that guide
<ChaosPrincess>
no clicks, i think
<Glanzmann>
But you use the device tree that ships with u-boot from kettenis?
<ChaosPrincess>
yes
<Glanzmann>
Strange than I have no idea. If you want, I can incorporate the latest kernel in the debian live image. And test if I get sound withthat, if I do, you can try.
<povik>
there's ^ in the second dmesg, so we are reaching the codec
<povik>
but the card doesn't get initialized, because we need CONFIG_SND_SIMPLE_CARD
<mps>
povik: right, I had to enable it
MajorBiscuit has quit [Ping timeout: 480 seconds]
<mps>
CONFIG_SND_SIMPLE_CARD_UTILS=m
<mps>
CONFIG_SND_SIMPLE_CARD=m
<ChaosPrincess>
see the card now, what did you have to enable in alsamixer to make it work?
<mps>
CONFIG_SND_SOC_CS42L42=m
<povik>
MIXER knob, make sure you switch out of a pulseaudio virtual device, if there's any (use F6)
<ChaosPrincess>
yep, works now
<Glanzmann>
ChaosPrincess: - In order to use sound, start alsamixer, press f6, select the card 'Macbook integrated audio' and move the first controls all the way to the top.
<mps>
povik: knob or just increase level in MIXER
<ChaosPrincess>
well, it was noise since i tried to play a mp3 with aplay, but at least it something
<povik>
great, i will do something about that MIXER business soon, i promise
<povik>
mps: increase level on the knob
<mps>
yes
<mps>
there is no mute switch
<Glanzmann>
mps: I use pulse audio on top of it, and it works just like on any other deivce.
<ChaosPrincess>
and as i can see it does not detect if headphones are not plugged, just assumes they are there
<Glanzmann>
ChaosPrincess: From the backlog I can tell you that is very hard to get the speakers working and also the risk of destroying them while trying ...
<povik>
hm? i wouldn't say that's true
<ChaosPrincess>
well, at least mute if there is nothing plugged in
<mps>
Glanzmann: I think event interface is not yet added to it, because this there is no detect options
<Glanzmann>
povik: Okay, some people in here mentioned that they blow there speaker on other arm devices.
<povik>
ah, i think we may be past that phase, and my mini came out unharmed
<Glanzmann>
povik: I see. And than I heard that there are 6? speakers and you can hook them up differently.
<Glanzmann>
And every speaker has its own chip?
<ChaosPrincess>
i think thats on 14+inch pro
<povik>
the other day i visited #alsa-soc and i think i know what needs to be done for plug events to reach userspace
<kettenis>
13" has 4
<mps>
Glanzmann: I made small lua script for awesome and control it with hotkeys and have text status bar widget to show volume
<Glanzmann>
mps: I had one with text status as well, but it was to much code complexity so that I killed it and now use this one and I now it just works (tm).
<povik>
Glanzmann: that's right, every speaker has its own chip, and we need to orchestrate that, there's just some work, wouldn't say it's very hard
<povik>
at least to get to baseline with 2 speakers as left/right
MajorBiscuit has joined #asahi
<povik>
once we want to have different stream for >2 speakers, there's yet more work
<kettenis>
hardest bit is to come up with an appropriate device tree binding ;)
<povik>
haha, may be
<ChaosPrincess>
anyone here running kde+wayland?
<Glanzmann>
ChaosPrincess: Nope. I have fvwm2 + xorg, and my system is idle (no burning cpu).
<Glanzmann>
ChaosPrincess: But I tried it a few times.
<Glanzmann>
But only for a minute or so.
<Glanzmann>
povik: Nice. I look forward to it.
<Glanzmann>
But if I watch a movie with 1920x960 xorg burns 30% and mpv 70% CPU.
<Glanzmann>
I'm running at 2 GHZ.
MajorBiscuit has quit [Ping timeout: 480 seconds]
<mps>
heh, I build kde when it is released first time and debian pkg didn't existed to try it, deleted it few days later and never tried again
<mps>
similar was the gnome fate on my system, though I was xfce user for nearly full one year
<ChaosPrincess>
its way better than whatever the folks over at gnome are doing, but the wayland support is not it's strongest point
<Glanzmann>
mps: I was only trying gnome and kde because they supported wlan and wanted to compare the video performance to the xorg. In the beginning (when we did not have the modesetting) it was better, but now I use xorg and don't look back.
<Glanzmann>
s/wlan/wayland/g
<mps>
Glanzmann: I do nearly same
<mps>
povik: current audio status is quite fine for me because I mostly listen audio with headphones
* Glanzmann
too.
<mps>
now what is missing for me is battery status, backlight control and maybe RTC (though NTP works fine)
<mps>
but not so important things machine is quite usable now
<Glanzmann>
mps: Yes, backlight control would be nice. Also the camera, mic and gpu accelerated graphics. But if I work, I'm already faster than on macos.
<Glanzmann>
NTP, I don't notice because the lock is already set when I open a terminal.
<mps>
camera, mic and gpu are not things I need
<Glanzmann>
mps: I do a lot of online trainings, so with Linux I can't do that at the moment. But if I work on things, I already have everything that I need.
<povik>
i actually do not know where the mics on macbooks are hooked to, chip-wise
<povik>
also so far i assumed the mini doesn't have an embedded mic, but that may not be true
<povik>
let's see some schematics
<Glanzmann>
povik: I looked at an dissaemble video of the mini and do not recall seeing a mic.
joske has joined #asahi
<povik>
i opened the voice recorder app in macos and it didn't do anything :)
<povik>
oh no, i smell AOP is involved in this, which makes sense
gladiac is now known as Guest1180
gladiac has joined #asahi
<povik>
what's that you said? you don't need a mic?
<mps>
povik: I don't need it, never use it
<j`ey>
povik: no mic needed, i can see what you type :D
<mps>
j`ey: :)
joske_ has joined #asahi
joske has quit [Ping timeout: 480 seconds]
Guest1180 has quit [Ping timeout: 480 seconds]
<povik>
i have it on good authority that AOP has an MCA block of its own, and that seems to be where the mic is hooked to
<povik>
there's also an external FPGA sitting on the mic data lines
<Glanzmann>
povik: What is the fpga for?
joske_ has quit [Ping timeout: 480 seconds]
<povik>
i don't know, low-power keyword/voice detection maybe, or some part of it and AOP doing the other part
<Glanzmann>
I see.
<povik>
or microphone beamforming? shrug
<povik>
of course, on mini /arm-io/admac-aop-audio is unused
<povik>
but on macbooks that's where you get the mic samples from
<povik>
one mystery solved
qm3ster[m] has joined #asahi
<qm3ster[m]>
🐴
joske has joined #asahi
joske has quit [Ping timeout: 480 seconds]
<marcan>
https://mrcn.st/p/jcpn0idA well that's pretty much all the voltages/currents for j314 (and other info I could gather)
<marcan>
mostly process of elimination matching up SMC symbols with known sensors in the schematic...
<marcan>
kettenis: probably would make sense to figure out a way to stuff these names in the device tree
<dottedmag>
"Air Intake Temp" so this thing can also double as a room thermometer
jmr2 has joined #asahi
<kettenis>
marcan: not sure about that
<kettenis>
different OSes may have a different opinion about what sensors are worth showing
<kettenis>
or what description to attach to the different sensors
<marcan>
duplicating this knowledge in every OS seems... suboptimal
<kettenis>
an OS is of course always free to ignore the information
<jmr2>
Question regarding the installer... When selecting the (newly created) boot disk, are you supposed to click on "restart", or just wait?
<marcan>
you click
<jmr2>
Thanks :-)
jmr2 has quit [Quit: Page closed]
jmr2 has joined #asahi
<marcan>
povik/Glanzmann: the FPGA is just a tiny thing that's just used to disable the mic when the lid is closed
<marcan>
(and a few other security-related things)
<jmr2>
(FWIW, I did almost all my installs so far from MacOS, not from RecoveryOS. In that context, you can just relock the lock and wait ~10s, without clicking on restart, and the installer detects the change. Might be a way to avoid the race condition in recoveryOS.)
<marcan>
it's one of the smallest FPGAs you can get (MachXO2), basically a CPLD
<marcan>
and it is not hooked up to be reprogrammable on purpose
<j`ey>
marcan: they probably picked the chip because the name matches the macOS kernel :P
<marcan>
it's a privacy thing
<marcan>
j`ey: I was going to say they probably watched the Smockie MachXO2 ad, but it seems it's been scrubbed from the internet :<
raiaq has quit [Remote host closed the connection]
raiaq has joined #asahi
user982492 has joined #asahi
darkapex2 is now known as darkapex
<Glanzmann>
marcan: Wow, lots of sensors.
<Glanzmann>
marcan: Thank you for the fpga explanation.
<VinDuv>
okay, I figured out why my monitor doesn’t work in m1n1: it looks like it briefly disconnects itself while going out of sleep mode
<VinDuv>
If I call dcp_ib_get_hpd in a loop after dcp_ib_swap_begin I can see connected going back to 0 then to 1. DCP syslog also says “display HPD removed” then “display HPD asserted”
<VinDuv>
and I can “fix” it by waiting 2 seconds after dcp_ib_swap_begin and calling dcp_ib_set_mode again.
<povik>
marcan: makes sense. i like that they did that (re: fpga)
<povik>
is AOP running after handoff from iboot, or do we have to start it?
<sven>
iirc we have to start it
<sven>
it’s also a bit of a misleading name since I think that SMC is more “always on” than AOP
<sven>
only special case might be some of the deeper sleep modes
<jannau>
I guess it's called always-on because it implments the always-on feature. the device acts as if it is always-on even when it is sleeping