t2linux / wiki

Repository for the t2linux.org wiki
https://wiki.t2linux.org
Creative Commons Attribution Share Alike 4.0 International
175 stars 63 forks source link

Wifi guide might need some improvements? #203

Closed igorsantos07 closed 2 years ago

igorsantos07 commented 2 years ago

I have a Macmini8,1 and I'm dual-booting with Mint (Ubuntu-based).

While the wiki helped me with many steps on solving the wifi issues, a few things left me a bit lost / might need correction / improvements:

Redecorating commented 2 years ago

The situation with wifi has been greatly simplified as we now have wifi firmware selection from linux working, and there is a pull request (#198) to update the wifi guide for that (not yet merged as the kernel changes for this aren't in mbp-fedora yet).

The Firmware failed to initialise is because firmware from macos versions after Mojave requires some random data as a seed (the chips don't have a hardware random number generator). The "Big Sur" kernels/patchset provides that seed to the wifi chip.

I would suggest installing this kernel, which has the automatic firmware selection, and fixes the firmware loading issue + some other bugs: https://github.com/AdityaGarg8/T2-Ubuntu-Kernel/releases/tag/v5.15.13-1 you should be able to build it yourself by cloning the repo and using build.sh if you don't want to use the built release there. You would also need firmware with a new naming scheme, you can use this deb or get the firmware in the new format yourself by following the instructions added by #198

igorsantos07 commented 2 years ago

Hmmm got it. I think.

Any guess which OS version are these files (suggested on that thread) from? These initialize fine for me; networks are listed, but connection gets stuck in a password loop.


Nonetheless, I tried installing the 5.15.13 debs you liked - but I can't start from it. Will try building it tomorrow... I guess I spent too many hours on this and my body needs a bed lol Thanks for the quick guidance!

Redecorating commented 2 years ago

The files hosted there are from macOS Mojave.

If you can boot back into a working kernel tomorrow, journalctl -b -1 > last_boots_logs.txt will save the logs from the last boot. Hopefully we can get some logs from whenever it fails to start.

@AdityaGarg8 might know a better release to use.

AdityaGarg8 commented 2 years ago

Technically you will end up having the same files if you use build.sh so no point in building. May I know the issue you are facing with 5.15.13? @igorsantos07

igorsantos07 commented 2 years ago

This is a photo of where it gets stuck, and here is the last_boot_logs.txt.

Do these help identifying anything? I know something on how to get around in Linux but kernels are an empty book in my mental library lol

AdityaGarg8 commented 2 years ago

Oh, you need the efi=noruntime parameter @igorsantos07

AdityaGarg8 commented 2 years ago

Or if you want, I'll make an ISO for you where wifi works out of the box?

AdityaGarg8 commented 2 years ago

What do you think?

igorsantos07 commented 2 years ago

I didn't spend much time installing stuff here, started by the wifi anyway, so it wouldn't hurt reinstalling the whole OS - but isn't that too much trouble for you? haha

That parameter is for.... booting? Any hint on how I should include it with rEFInd which auto-scanned my OSes? It boots fine the other kernels I tried (currently at 5.13.0-23).

Redecorating commented 2 years ago

That looks like a different kernel panic to the one that occurs with nvram writes, the trace has some stuff about crypto, not efi, so I don't think efi=noruntime is the issue. (also go to sleep)

I'll have a look and see if there's a module we can try blacklisting to prevent it (but go sleep first)

Tomorrow could you also check that if you boot it again, the panic (what you took a photo of) is still on the crypto stuff (it's possible that the panic could have a cause that's not specific to one piece of code)

Redecorating commented 2 years ago

possibly also see if a normal 5.15 kernel has the same issue (but no rush, go sleep)

igorsantos07 commented 2 years ago

The latest kernels I can find on the Mint kernel tool is 5.13, but I found some guides on how to get 5.15. Will do tomorrow.

That pic was actually the second try - I installed, rebooted to it, it panicked, and I went back to 5.13, then tried again so I could photograph it... The first take was changing between seemingly two different panics every bunch of seconds? Will try again tomorrow after bed hahaha

Thank you all! Really!

AdityaGarg8 commented 2 years ago

Oh, sorry I didn’t see you used mint

igorsantos07 commented 2 years ago

PS: no need for a new ISO, I guess. I recalled I had a Realtek USB wifi card, plugged it in and got a working driver from a quick googling + build.

This is really a temporary fix (so I can unplug my phone lol), but worst case scenario, it's usable in mid-term until it gets ~easier~ less painful to get the internal wifi working. So I can keep configuring the rest of my environment while I try different approaches, and finally get some work done (after 2 full days lost in this Mac war)......

AdityaGarg8 commented 2 years ago

rEFInd probably must be showing you 2 entries. 1st is the one with the mint logo and second with the one with the Linux penguin logo. You have to use the one with the mint logo (if the linux penguin one entry is not there, needn't worry :) ) Now, boot into the kernel you are able to right now. edit /etc/default/grub and make sure you have GRUB_CMDLINE_LINUX="efi=noruntime pcie_ports=compat acpi=force intel_iommu=on iommu=pt"

AdityaGarg8 commented 2 years ago

after updating, run sudo update-grub. You may take some rest and do it later too :)

igorsantos07 commented 2 years ago

rEFInd shows me Mint (with its multiple kernels by now) and MacOS, no extra Tux :)

Under 5.13, /etc/default/grub only shows this, besides the bunch of comments:

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

Should I add all those commands? Would update-grub mess up with rEFInd somehow?

:sleeping_bed:

AdityaGarg8 commented 2 years ago

A pic of refind would be helpful.

AdityaGarg8 commented 2 years ago

which desktop environment are you using BTW

igorsantos07 commented 2 years ago

I customized refind's interface a bit, actually. Is there anything useful instead in /boot/efi/EFI/refind? Otherwise I can get a list of anything that's bootable in my next reboot.

/boot/efi/EFI has the following folders, btw: APPLE, BOOT, refind, tools, ubuntu.

I'm running Mint Uma, Mate edition.

I guess I should also mention my installer didn't finish 100%, since grub crashed it towards the end. Only later (by googling) I found about rEFIind, which scanned from Mac and it found Mint, surprisingly working(?) Not sure what it's missing, if any, besides some dangling live stuff here and there (apt repo, installer shortcut).

AdityaGarg8 commented 2 years ago

I customized refind's interface a bit, actually. Is there anything useful instead in /boot/efi/EFI/refind? Otherwise I can get a list of anything that's bootable in my next reboot.

/boot/efi/EFI has the following folders, btw: APPLE, BOOT, refind, tools, ubuntu.

I'm running Mint Uma, Mate edition.

I guess I should also mention my installer didn't finish 100%, since grub crashed it towards the end. Only later (by googling) I found about rEFIind, which scanned from Mac and it found Mint, surprisingly working(?) Not sure what it's missing, if any, besides some dangling live stuff here and there (apt repo, installer shortcut).

Installer crashed due to lack of efi=noruntime

You need a custom ISO

AdityaGarg8 commented 2 years ago

I'll see if I am able to make an ISO for Mint.

AdityaGarg8 commented 2 years ago

I customized refind's interface a bit, actually. Is there anything useful instead in /boot/efi/EFI/refind? Otherwise I can get a list of anything that's bootable in my next reboot.

/boot/efi/EFI has the following folders, btw: APPLE, BOOT, refind, tools, ubuntu.

I'm running Mint Uma, Mate edition.

I guess I should also mention my installer didn't finish 100%, since grub crashed it towards the end. Only later (by googling) I found about rEFIind, which scanned from Mac and it found Mint, surprisingly working(?) Not sure what it's missing, if any, besides some dangling live stuff here and there (apt repo, installer shortcut).

So it was that when the installer was trying to install, grub installation crashed, as it was trying to write the NVRAM. Then, you used rEFInd to boot Linux, cause the kernel were installed. But, refind is not at all reliable to directly boot kernels.

AdityaGarg8 commented 2 years ago

@igorsantos07 , Try a reinstallation with https://github.com/AdityaGarg8/mbp-ubuntu/releases/tag/mint-5.15.12. The installer shouldn't probably crash now.

AdityaGarg8 commented 2 years ago

Make sure you cleanup your old installation.

AdityaGarg8 commented 2 years ago

Wifi should work out of the box in this.

igorsantos07 commented 2 years ago

Now I got why you all of sudden asked my DE. I'm really mesmerized you went all the way to create a new Mint release for me to try out. Thanks! I'm downloading it now.

In the meantime, I'm also sobbing because the MacOS decided it doesn't want to run anymore, and I don't recall making any changes to it or rEFInd that would cause Mac issues :sob: Any boot option like safe or single user mode cause the same dump on screen (which I'll append here as soon as I reboot with the Mint pendrive ready). The Apple Recovery option also seems to be gone from rEFInd since I upgraded to Monterey?

Definitely regretting the day I said "ok, I'll get a Mac because I need to debug iPad issues".

igorsantos07 commented 2 years ago

I installed Mint, but it booted to a kernel panic screen, similar to the previous ones. Tried other options inside refind, until I recalled the NVRAM issue you mentioned... Then I edited the Mint boot line to include efi=noruntime and.................. it's working <3 I had to re-modprobe at the first login, but only then.

It's even showing the fan sensor, which wasn't present before (actually, together with other 31 temperature(?) sensors, from TA0V to TW2P and TaRC)


Also: is there a way to make that efi boot option "permanent" in any Mint option from refind (besides permanently editing the current boot line)? I wonder if, in the future, when I upgrade to a newer kernel or something else, it will get lost again and panic.


And no progress with the Mac panic yet (didn't google much yet, though): image

AdityaGarg8 commented 2 years ago

Now I got why you all of sudden asked my DE. I'm really mesmerized you went all the way to create a new Mint release for me to try out. Thanks! I'm downloading it now.

In the meantime, I'm also sobbing because the MacOS decided it doesn't want to run anymore, and I don't recall making any changes to it or rEFInd that would cause Mac issues 😭 Any boot option like safe or single user mode cause the same dump on screen (which I'll append here as soon as I reboot with the Mint pendrive ready). The Apple Recovery option also seems to be gone from rEFInd since I upgraded to Monterey?

Definitely regretting the day I said "ok, I'll get a Mac because I need to debug iPad issues".

To fix macOS, use the startup manager to boot it

https://wiki.t2linux.org/guides/refind/#fixing-blank-screen-on-booting-macos-using-refind

You probably are facing this

AdityaGarg8 commented 2 years ago

I installed Mint, but it booted to a kernel panic screen, similar to the previous ones. Tried other options inside refind, until I recalled the NVRAM issue you mentioned... Then I edited the Mint boot line to include efi=noruntime and.................. it's working <3 I had to re-modprobe at the first login, but only then.

It's even showing the fan sensor, which wasn't present before (actually, together with other 31 temperature(?) sensors, from TA0V to TW2P and TaRC)

Also: is there a way to make that efi boot option "permanent" in any Mint option from refind (besides permanently editing the current boot line)? I wonder if, in the future, when I upgrade to a newer kernel or something else, it will get lost again and panic.

And no progress with the Mac panic yet (didn't google much yet, though): image

Firstly, did the installation crash this time?

If no, is refind showing an entry to boot grub? It probably should be the one with the linux mint logo instead of the linux penguin one.

igorsantos07 commented 2 years ago

Nope, no crash! Installation was successful! It's missing the sound support, though. I've tried adding the PulseAudio files, but no success yet... Gonna reboot soon to check if it works.

The Mint entry in refind points to /boot/vmlinuz-5.15.12-t2. Here are the possibly relevant entries (moved the correct Mint entry, the selected one, to the hidden tags so I could list them all together): image

I'm not sure what's that ubuntu/grubx64.efi entry. Maybe a leftover from the initial failed install?

AdityaGarg8 commented 2 years ago

@igorsantos07 , probably, the Ubuntu one entry shall be the one which shall boot grub for mint. Could you try that?

igorsantos07 commented 2 years ago

Just tested - that Ubuntu entry (which appropriately gets an Ubuntu logo) seems to just go into a Linux Mint logo that gets stuck? Let me check if it also needs efi=noruntime...

The one that I've been using so far to boot - and that I need to edit every time - is the vmlinuz one.


The force-to-boot-MacOS trick indeed worked :) I've submitted a tiny PR (#204) since I needed trial-and-error to "find" the Option key lol

AdityaGarg8 commented 2 years ago

@igorsantos07 , edit /etc/default/grub and make sure GRUB_CMDLINE_LINUX="efi=noruntime pcie_ports=compat acpi=force intel_iommu=on iommu=pt" is there instead of GRUB_CMDLINE_LINUX=" ". Do the editing, save the changes and run sudo update-grub on the terminal. Then the Ubuntu option in refind should be fixed.

igorsantos07 commented 2 years ago

Nice! That worked too - I'll swap it with the previous Mint option.

Lastly, any idea on how to get the sound jack to work? It's playing great on the Mac OS, but inside Mint all I see is the HDMI output (which I can't test since my screen has no sound anyway). I just created the files from the first link on the guide (even made the copy mentioned later in the comments), but no dice. I even restarted to see if PulseAudio would catch the correct stuff (otherwise, would pulseaudio -k do the trick after a few seconds for it to auto-restart, I guess?).

I also find nothing recent about pulseaudio or alsa in syslog. Any idea where to start debugging this? I tried pulseaudio -k; pulseaudio -v --start --log-target=newfile:/tmp/pulse.log --daemonize=no, but it doesn't seem to output anything (and I know it's reloading because my webcam, which has a built-in mic, blinks).

AdityaGarg8 commented 2 years ago

@igorsantos07 , in settings>sounds, in audio outputs, is there something like codec-output. If yes, change to that.

igorsantos07 commented 2 years ago

Nope, it just shows the HDMI option - which doesn't seem to behave either, since I found a volume control on my display's internal menu. image

If I permanently kill pulseaudio, that screen shows HDA Intel PCH as an output option, but without being able to configure volumes and such. It also lists my webcam as output, which is wrong since it has a mic, but not a speaker. image

AdityaGarg8 commented 2 years ago

@Redecorating , please help

Redecorating commented 2 years ago

Have you followed https://t2linux.org/guides/audio-config/ ? Does ‘lsmod | grep apple_bce‘ show apple_bce?

The files in the audio guide might need changing as the speaker layout on mac mini would be different (does it even have a speaker, or is it just the 3.5mm audio jack)

AdityaGarg8 commented 2 years ago

Mac mini doesn't have a speaker afaik.

AdityaGarg8 commented 2 years ago

Oh it has!!

AdityaGarg8 commented 2 years ago

https://www.apple.com/in/mac-mini/specs/

igorsantos07 commented 2 years ago

Yep, it has an internal speaker - terrible, but does hahaha I don't care if it ends up disabled. I'm mostly interested in the speaker jack.

I've followed the guide, yes, and even created the copy for the other alsa file as described in comments.

And no apple_bce shown by lsmod :thinking:

Gonna add other possibly useful debug information that I saw around forums...

AdityaGarg8 commented 2 years ago

Should be lsmod | grep apple-bce Not apple_bce

AdityaGarg8 commented 2 years ago

Please try again

igorsantos07 commented 2 years ago

Still nothing :cry: image

Redecorating commented 2 years ago

try sudo modprobe apple_bce, if it says that that module doesn't exist, follow https://wiki.t2linux.org/guides/dkms/#installing-modules to get apple-bce, which handles internal audio, and shows some system usb devices

igorsantos07 commented 2 years ago

Non-existent module, indeed.

However... files were already present, including dkms.conf. I guess these came with the ISO @AdityaGarg8 gave me? These were the missing steps, indeed :) I'll add these clarifications to the guide. Uh... Any chance these sound settings could affect microphone quality on an USB webcam? I didn't think about testing it before, but it's sounding horrible and I'm not sure if it's because it's plugged in a hub haha

Anyhow... I guess I'm done here! Everything seems to be working <3 I'm just not sure how to improve the guides in relation to the issues I had in the beginning, such as the wifi and the need of efi=noruntime. Leave the issue open if you're going to figure out improvements later... Otherwise, it can be closed :)

Thank you all so much for the guidance and work!

AdityaGarg8 commented 2 years ago

You may close it cause the efi=noruntine issue is known already and has been included in our T2 specific ISOs. Cause you wanted mint, it got a bit complicated cause we don't have an ISO for mint yet.