Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lenovo Thinkpad 300e Gen2 Debian failing to restore audio #225

Open
brightresurgence opened this issue Jan 27, 2025 · 9 comments
Open

Lenovo Thinkpad 300e Gen2 Debian failing to restore audio #225

brightresurgence opened this issue Jan 27, 2025 · 9 comments

Comments

@brightresurgence
Copy link

Describe the bug
A clear and concise description of what the bug is.

This script used to work without a hitch, but I recently had to reinstall my OS so I'm in a predicament here. The kernel installation popup no longer appears and when the script "completes" nothing happens anymore.

Boardname
If you don't know where to find this, run cat /sys/class/dmi/id/product_name
Octopus
Logs
Generate logs with wget https://raw.githubusercontent.com/chrultrabook/linux-tools/main/debugging.sh; bash debugging.sh and attach the output here.

#!/usr/bin/env bash
printf 'Welcome.\nThis script will ask you for sudo password, which is necessary to extract required information.\n'

Get current username before escalating permissions

user=$USER

Get board name

board="$(cat /sys/class/dmi/id/product_name)"

Get current date and time

date="$(date +"%Y-%m-%d_%Hh%Mm")"

Specify where to store logs

logdir="debug-logs-$board-$date"
logarchive="debug-logs-$board-$date.tar.gz"

Create directory to store logs

mkdir -p $logdir
cd $logdir

Download cbmem and mark it as executable

wget https://mrchromebox.tech/files/util/cbmem.tar.gz &> /dev/null
tar -xf cbmem.tar.gz
rm cbmem.tar.gz
chmod +x cbmem

Grab logs necessary for debugging audio

if [ ! -z '$(pgrep pulseaudio)' ]
then
# Get logs from pipewire
systemctl --user stop pipewire.{socket,service}
systemctl --user stop pipewire-pulse.{socket,service}

    if [ -z "$(which spa-acp-tool)" ]
    then
            printf 'spa-acp-tool not found. On distros using apt, install pipewire-bin\n'
            touch no-spaacptool
    fi

    for card in $(grep '\[' /proc/asound/cards | awk '{print $1}')
    do
            echo "Pipewire card $card log:" >> audio-debug.log
            spa-acp-tool -c $card -vvvv info &>> audio-debug.log
    done

    systemctl --user start pipewire.service
    systemctl --user start pipewire-pulse.service

else
# Get logs from pulseaudio
systemctl --user stop pulseaudio.{socket,service}

    echo "Pulseaudio log:" >> audio-debug.log
    pulseaudio -v &>> audio-debug.log & sleep 5
    killall pulseaudio

    systemctl --user start pulseaudio.service

fi

UCM logs

skip_ucm=0

if [ -z "$(which alsaucm)" ]
then
printf 'alsaucm not found. Please install alsa-utils.\n'
touch no-alsautils
skip_ucm=1
fi
if [ -z "$(which strace)" ]
then
printf 'strace not found. Please install strace.\n'
touch no-strace
skip_ucm=1
fi

if [ "$skip_ucm" = "0" ]
then
for card in $(grep '[' /proc/asound/cards | awk '{print $1}')
do
echo "Alsa card $card UCM log:" >> alsa-ucm.log
strace alsaucm -c hw:$card reload &>> alsa-ucm.log
done
fi

lsmod > loaded-modules.log
find /lib/firmware > firmware.log

Priviledge escalation [!!!]

{
sudo su <<EOF

Grab logs and redirect output to files instead of stdout

dmesg >> dmesg.log

if [ -z "$(which lspci)" ]
then
printf 'lspci not found. Please install pciutils.\n'
touch no-lspci
else
lspci -vvvnn >> lspci.log
fi

if [ -z "$(which lsusb)" ]
then
printf 'lsusb not found. Please install usbutils.\n'
touch no-lsusb
else
lsusb -v >> lsusb.log
fi

if [ -z "$(which dmidecode)" ]
then
printf 'Dmidecode not found. Please install it.\n'
touch no-dmidecode
else
dmidecode >> dmidecode.log
fi

if [ -z "$(which libinput)" ]
then
printf 'libinput not found. Please install libinput utils.\n'
touch no-libinput
else
libinput list-devices >> libinput.log
fi

Copy ACPI tables

mkdir acpi
cp /sys/firmware/acpi/tables/DSDT ./acpi/
cp /sys/firmware/acpi/tables/SSDT* ./acpi/

Grab coreboot logs

./cbmem -c > cbmem.log

Set file permissions for regular user

chown -R $user:$user *
chmod -R 755 *

EOF
} || {
echo "Error: Unable to gain root permission. Log archive will be incomplete!"
touch no-root
}

Remove cbmem binary

rm cbmem

Pack logs into archive and remove temporary folder that stores them

cd ..
tar -caf "$logarchive" "$logdir"
rm -r "$logdir"

printf "Log collection done.\nPlease upload ${logarchive} for analysis.\n"

(Dumb question but am I meant to have pipewire installed?)

@brightresurgence
Copy link
Author

Just a thought now but am I meant to use the chultrabook kernel instead of the standard one?

@brightresurgence
Copy link
Author

Alright so I'm manually downloading the chultrabook kernel files so I'm hoping that it should do the job this time, so I guess the problem is mostly in regards to the kernel failing to install itself automatically.

@WeirdTreeThing
Copy link
Owner

I remember someone saying the prebuilt kernel artifact expired. I guess it's that time once again to rebuild it. The problem is no chrultrabook maintainers really use debian so we kinda just forget about the kernel existing.

@brightresurgence
Copy link
Author

Would you recommend switching to another OS? I could probably go to Endeavour or something, im just partial to debian because it's what I'm used to.

@WeirdTreeThing
Copy link
Owner

Even using debian trixie would be better. But in general using a non-LTS distro is better for chromebooks where you need up-to-date software to have everything working properly.

@brightresurgence
Copy link
Author

whats an LTS distro again and how would Trixie help?

@nothingneko
Copy link

LTS distros like Debian, Ubuntu LTS, and the EL family hold back package updates for stability

If you wanna stay in the Debian ecosystem, Trixie like Tree mentioned, or Ubuntu interim releases are a good choice

@brightresurgence
Copy link
Author

A few times I've installed something like ani-cli on the Trixie/Sid and it literally marks my entire KDE environment as well as network-manager for autoremoval. I've lost a few installs of Debian this way.

Is this a common thing? And are there any other threats of the sorts if I use the Trixie repo?

@brightresurgence
Copy link
Author

oh yeah P.S having manually installed the chultrabook kernel, everything works INCLUDING the cros-keyboard-map thingy tree made. That was also busted before I got the kernel in order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants