Kernel 5.19.7 - no Sound with OnePlus 6T (fajita) | kernel 5.17 did not work too - only "Dummy Output" Device
Hi, I build a 5.19.7 Kernel for Mobian. Build a mobian-oneplus6-phosh-20220907.boot-fajita_519.img and flashed it to my OnePlus 6T.
Here the Source: https://gitlab.com/sdm845-mainline/linux/
See at the end how I build it - so I am not a developer so please let me know what I did wrong !
System boot with the kernel 5.19.7
mobian@mobian:~$ uname -a
Linux mobian 5.19.7-sdm845 #1 SMP PREEMPT Wed Sep 7 15:32:45 CEST 2022 aarch64 GNU/Linux
Sound is not working - show in Settings -> Sound only "Dummy Output"
How to get the Sound working ?
But I can see devices - aplay did not show devices with 5.17 Kernel from Mobian
root@mobian:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: O6T [OnePlus 6T], device 0: MultiMedia1 (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: O6T [OnePlus 6T], device 1: MultiMedia2 (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: O6T [OnePlus 6T], device 2: MultiMedia3 (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: O6T [OnePlus 6T], device 3: VoiceMMode1 (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
root@mobian:~# dpkg -l | grep "5.19"
ii linux-headers-5.19.7-sdm845 5.19.7-sdm845-1 arm64 Linux kernel headers for 5.19.7-sdm845 on arm64
ii linux-image-5.19.7-sdm845 5.19.7-sdm845-1 arm64 Linux kernel, version 5.19.7-sdm845
ii linux-libc-dev:arm64 5.19.7-sdm845-1 arm64 Linux support headers for userspace development
Here with the 5.17 kernel
$ uname -a
Linux mobian 5.17-sdm845 #1 SMP PREEMPT Fri May 6 16:05:41 UTC 2022 aarch64 GNU/Linux
$ aplay -l
aplay: device_list:275: no soundcards found...
root@mobian:~# alsaucm listcards
0: hw:0
OnePlus 6T
root@mobian:~# alsaucm dump text
Verb.HiFi {
Comment "HiFi quality Music."
Device.Speaker {
Comment "Speakers Output"
Values {
CaptureCTL "_ucm0001.hw:O6T"
PlaybackCTL "_ucm0001.hw:O6T"
PlaybackPCM "_ucm0001.hw:O6T,0"
PlaybackPriority 100
TQ HiFi
}
}
Device.Headphones {
Comment Headphones
Values {
CaptureCTL "_ucm0001.hw:O6T"
PlaybackCTL "_ucm0001.hw:O6T"
PlaybackChannels 2
PlaybackPCM "_ucm0001.hw:O6T,1"
PlaybackPriority 50
TQ HiFi
}
}
Device.Mic {
Comment "Phone Mic"
ConflictingDevices [
Headset
]
Values {
CaptureCTL "_ucm0001.hw:O6T"
CaptureChannels 1
CapturePCM "_ucm0001.hw:O6T,2"
CapturePriority 100
CaptureVolume "ADC3 Volume"
PlaybackCTL "_ucm0001.hw:O6T"
TQ HiFi
}
}
Device.Headset {
Comment "Headset Mic"
ConflictingDevices [
Mic
]
Values {
CaptureCTL "_ucm0001.hw:O6T"
CaptureChannels 1
CapturePCM "_ucm0001.hw:O6T,2"
CapturePriority 50
CaptureVolume "ADC2 Volume"
PlaybackCTL "_ucm0001.hw:O6T"
TQ HiFi
}
}
}
mobian@mobian:~$ lsmod | grep snd
snd_soc_wcd934x 274432 1
snd_soc_wcd_mbhc 28672 1 snd_soc_wcd934x
snd_q6dsp_common 49152 3 q6asm,q6afe_dai,q6adm
regmap_slimbus 16384 2 snd_soc_wcd934x,wcd934x
snd_soc_tfa98xx 151552 1
snd_soc_sdm845 20480 0
snd_soc_rt5663 86016 1 snd_soc_sdm845
snd_soc_rl6231 16384 1 snd_soc_rt5663
snd_soc_qcom_common 16384 1 snd_soc_sdm845
soundwire_bus 81920 2 snd_soc_sdm845,soundwire_qcom
snd_soc_sdm845 20480 0
root@mobian:~# modinfo snd_soc_sdm845
filename: /lib/modules/5.19.7-sdm845/kernel/sound/soc/qcom/snd-soc-sdm845.ko
license: GPL v2
description: sdm845 ASoC Machine Driver
alias: of:N*T*Clenovo,yoga-c630-sndcardC*
alias: of:N*T*Clenovo,yoga-c630-sndcard
alias: of:N*T*Cqcom,db845c-sndcardC*
alias: of:N*T*Cqcom,db845c-sndcard
alias: of:N*T*Cqcom,sdm845-sndcardC*
alias: of:N*T*Cqcom,sdm845-sndcard
depends: snd-soc-qcom-common,soundwire-bus,snd-soc-rt5663
intree: Y
name: snd_soc_sdm845
vermagic: 5.19.7-sdm845 SMP preempt mod_unload aarch64
Here is what I did to build the kernel & bootImage:
git clone https://gitlab.com/mobian1/mobian-recipes/
mkdir -p mobian/linux
git clone https://gitlab.com/sdm845-mainline/linux
cd mobian/linux
make distclean
make ARCH=arm64 defconfig sdm845.config
make -j$(nproc) ARCH=arm64 KBUILD_DEBARCH=arm64
KDEB_CHANGELOG_DIST=mobian CROSS_COMPILE=aarch64-linux-gnu- deb-pkg
copy files with SCP to the OnePlus with running Mobian
linux-headers-5.19.7-sdm845_5.19.7-sdm845-1_arm64.deb
linux-image-5.19.7-sdm845_5.19.7-sdm845-1_arm64.deb
linux-libc-dev_5.19.7-sdm845-1_arm64.deb
ssh mobian@<IP>
sudo su -
dpkg -i linux-headers-5.19.7-sdm845_5.19.7-sdm845-1_arm64.deb
dpkg -i linux-image-5.19.7-sdm845_5.19.7-sdm845-1_arm64.deb
dpkg -i linux-libc-dev_5.19.7-sdm845-1_arm64.deb
cd /boot
scp vm* user@<ip-pc>
scp init* user@<ip-pc>
mkdir ~/mobian/linux/new
cp vm* ~/mobian/linux/new
cp init* ~/mobian/linux/new
cd ~/mobian/linux/new
mv ini* initrd.img
mv vm* zImage
bootimg.cfg from ~/mobian-recipes/bootimg.cfg
abootimg --create bootimg -k zImage -r initrd.img -f bootimg.cfg
mv bootimg mobian-oneplus6-phosh-20220907.boot-fajita_519.img
fastboot flash boot fastboot flash boot mobian-oneplus6-phosh-20220907.boot-fajita_519.img
Extracted the file: tfa98xx.cnt from LineageOS Image ( vendor.img ) extract the image with: payload_dumper
root@mobian:~# dmesg | grep tfa
[ 5.102697] tfa98xx_i2c_init(): TFA98XX driver version v6.7.14
[ 5.104604] tfa98xx_i2c_probe(): addr=0x34
[ 5.104646] tfa98xx 4-0034: No IRQ GPIO provided.
[ 5.104649] tfa98xx 4-0034: reset-polarity:1
[ 5.106876] tfa98xx_i2c_probe(): TFA9894 detected
[ 5.106891] tfa98xx 4-0034: Skipping IRQ registration
[ 5.106923] tfa98xx_i2c_probe(): tfa98xx_i2c_probe Probe completed successfully!
[ 6.028192] tfa98xx_probe():
[ 6.028292] tfa98xx_probe(): Container loading requested: 0
[ 6.028322] tfa98xx 4-0034: tfa98xx codec registered ()
[ 6.031873] tfa98xx_container_loaded(): loaded tfa98xx.cnt - size: 11385
[ 6.031893] tfa98xx_container_loaded(): 3_01
[ 6.031895] tfa98xx_container_loaded(): NXP
[ 6.031897] tfa98xx_container_loaded(): mono
[ 6.031898] tfa98xx_container_loaded(): TFA9894
[ 6.031899] tfa98xx_container_loaded(): 1 ndev
[ 6.031901] tfa98xx_container_loaded(): 5 nprof
[ 6.034992] tfa98xx_container_loaded(): Firmware init complete
[ 6.035007] tfa98xx_create_controls(): profile added [0]: MUSIC_48000
[ 6.035016] tfa98xx_create_controls(): profile added [1]: VOICE_48000
[ 6.035022] tfa98xx_create_controls(): profile added [2]: MMITest_48000
[ 6.035029] tfa98xx_create_controls(): profile added [3]: dsp_bypass_P
[ 6.347608] tfa98xx_info_vstep(): vsteps count: 1 [prof=0]
[ 6.347617] tfa98xx_info_vstep(): vsteps count: 1 [prof=0]
[ 6.347620] tfa98xx_info_vstep(): vsteps count: 1 [prof=0]
[ 6.471731] tfa98xx_info_vstep(): vsteps count: 1 [prof=0]
[ 6.471743] tfa98xx_info_vstep(): vsteps count: 1 [prof=0]
[ 6.471746] tfa98xx_info_vstep(): vsteps count: 1 [prof=0]
[ 6.031873] tfa98xx_container_loaded(): loaded tfa98xx.cnt - size: 11385
root@mobian:~# ls -la /usr/lib/firmware/
total 1184
drwxr-xr-x 9 root root 4096 Sep 8 20:55 .
drwxr-xr-x 74 root root 4096 Sep 8 08:46 ..
drwxr-xr-x 2 root root 4096 Aug 21 06:45 ar3k
-rw-r--r-- 1 root root 153416 Aug 24 2021 ar5523.bin
-rw-r--r-- 1 root root 70624 Aug 24 2021 ar7010_1_1.fw
-rw-r--r-- 1 root root 70624 Aug 24 2021 ar7010.fw
-rw-r--r-- 1 root root 51312 Aug 24 2021 ar9271.fw
drwxr-xr-x 11 root root 4096 Aug 21 06:45 ath10k
drwxr-xr-x 5 root root 4096 Aug 21 06:45 ath11k
-rw-r--r-- 1 root root 246804 Aug 24 2021 ath3k-1.fw
drwxr-xr-x 5 root root 4096 Aug 21 06:45 ath6k
drwxr-xr-x 2 root root 4096 Aug 21 06:45 ath9k_htc
-rw-r--r-- 1 root root 72684 Aug 24 2021 htc_7010.fw
-rw-r--r-- 1 root root 50980 Aug 24 2021 htc_9271.fw
drwxr-xr-x 3 root root 4096 Aug 21 06:45 qca
drwxr-xr-x 10 root root 4096 Aug 21 06:45 qcom
lrwxrwxrwx 1 root root 31 Jul 30 22:10 regulatory.db -> /etc/alternatives/regulatory.db
-rw-r--r-- 1 root root 4492 Jul 30 22:10 regulatory.db-debian
lrwxrwxrwx 1 root root 35 Jul 30 22:10 regulatory.db.p7s -> /etc/alternatives/regulatory.db.p7s
-rw-r--r-- 1 root root 1225 Jul 30 22:10 regulatory.db.p7s-debian
-rw-r--r-- 1 root root 1182 Jul 30 22:10 regulatory.db.p7s-upstream
-rw-r--r-- 1 root root 4492 Jul 30 22:10 regulatory.db-upstream
-rw-r--r-- 1 root root 11385 Sep 8 20:55 tfa98xx.cnt
-rw-r--r-- 1 root root 3588 Aug 24 2021 wil6210.brd
-rw-r--r-- 1 root root 400364 Aug 24 2021 wil6210.fw
-rw-r--r-- 1 root root 11385 Sep 8 20:55 tfa98xx.cnt
Some files: