t2linux / T2-Debian-and-Ubuntu-Kernel

Ubuntu Kernel for T2 Macs.
139 stars 15 forks source link

Touchbar device not found #90

Closed shwwoooo closed 3 months ago

shwwoooo commented 3 months ago

Hello, I am trying to install t2 kernel to a generic Ubuntu 22.04 system. I am facing apple-ibridge build error when running apt install linux-image... The log file shows the following

/var/lib/dkms/apple-ibridge/0.1/build/apple-ibridge.c:637:35: error: initialization of ‘void (*)(struct acpi_device *)’ from incompatible pointer type ‘int (*)(struct acpi_device *)’ [-Werror=incompatible-pointer-types]
  637 |                 .remove         = appleib_remove,
      |                                   ^~~~~~~~~~~~~~

And when I run lsusb, I get these these devices, and touchbar is not showing up

Bus 007 Device 004: ID 05ac:8104 Apple, Inc. 
Bus 007 Device 003: ID 05ac:0340 Apple, Inc. Apple Internal Keyboard / Trackpad
Bus 007 Device 002: ID 05ac:8103 Apple, Inc. Headset
Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 002: ID 0bda:9210 Realtek Semiconductor Corp. RTL9210 M.2 NVME Adapter
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

What should I do to solve this issue? Thanks in advance!

AdityaGarg8 commented 3 months ago

From where have you downloaded the Touch Bar driver?

AdityaGarg8 commented 3 months ago

And what guides are you following?

shwwoooo commented 3 months ago

I downloaded from the release section of this github repo. I tried 6.5 and the newest (6.9), but both did not work. I am following the the section "Download Package Manually" in this repo readme.

AdityaGarg8 commented 3 months ago

I downloaded from the release section of this github repo. I tried 6.5 and the newest (6.9), but both did not work. I am following the the section "Download Package Manually" in this repo readme.

What ISO have you used? And I asked from where have you downloaded the touchbar driver (DKMS one), not the kernel.

shwwoooo commented 3 months ago

I was using ubuntu 22.04 jammy (downloaded from ubuntu official site before). I thought the kernel comes with all the driver and most other functionalities work so I didn't manually install one for touchbar (presumably from here?)

AdityaGarg8 commented 3 months ago

I was using ubuntu 22.04 jammy (downloaded from ubuntu official site before). I thought the kernel comes with all the driver and most other functionalities work so I didn't manually install one for touchbar (presumably from here?)

The driver you installed no longer works on newer kernels. I assume you didn't even add the apt repo right?

shwwoooo commented 3 months ago

I initially tried using apt to download and install the kernel, which comes in version 6.6. I ran these commands

CODENAME=noble
curl -s --compressed "https://adityagarg8.github.io/t2-ubuntu-repo/KEY.gpg" | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/t2-ubuntu-repo.gpg >/dev/null
sudo curl -s --compressed -o /etc/apt/sources.list.d/t2.list "https://adityagarg8.github.io/t2-ubuntu-repo/t2.list"
echo "deb [signed-by=/etc/apt/trusted.gpg.d/t2-ubuntu-repo.gpg] https://github.com/AdityaGarg8/t2-ubuntu-repo/releases/download/${CODENAME} ./" | sudo tee -a /etc/apt/sources.list.d/t2.list
sudo apt update

So I should have the apt repos.

AdityaGarg8 commented 3 months ago

I initially tried using apt to download and install the kernel, which comes in version 6.6. I ran these commands

CODENAME=noble
curl -s --compressed "https://adityagarg8.github.io/t2-ubuntu-repo/KEY.gpg" | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/t2-ubuntu-repo.gpg >/dev/null
sudo curl -s --compressed -o /etc/apt/sources.list.d/t2.list "https://adityagarg8.github.io/t2-ubuntu-repo/t2.list"
echo "deb [signed-by=/etc/apt/trusted.gpg.d/t2-ubuntu-repo.gpg] https://github.com/AdityaGarg8/t2-ubuntu-repo/releases/download/${CODENAME} ./" | sudo tee -a /etc/apt/sources.list.d/t2.list
sudo apt update

So I should have the apt repos.

You are using Jammy, so use CODENAME=jammy

and you installed linux-t2-lts, which will give 6.6 kernel. You have to install linux-t2 if you want 6.9

AdityaGarg8 commented 3 months ago
image
AdityaGarg8 commented 3 months ago

You also have to remove the dkms driver and install tiny-dfr for touchbar

AdityaGarg8 commented 3 months ago

If you need step by step help, please contact the discord. https://discord.com/invite/68MRhQu

shwwoooo commented 3 months ago

Sorry I copied directly from the README. Yes I used CODENAME=jammy and installed linux-t2-lts. I am fine with 6.6 kernel. I can join discord and post the solution here later. Thank you

shwwoooo commented 3 months ago

Hmmm, I don't know what happened exactly. I booted my mac today for the first time and it works now. It was not yesterday and I tried to reboot multiple times. Camera works now as well. Thank you for your time and prompt responses!

shwwoooo commented 2 months ago

Later I found out it is because of any unnormal shutdown or reboots. The devices are found when shutting down from macos and then booting linux. If I shutdown/restart/suspend from linux (screen goes black but fans are on and will rapidly spin up for a second before going off) or force shutdown by long pressing the power button, the touchbar and camera don't work.