davidjo / snd_hda_macbookpro

Kernel audio driver for Macs with 8409 HDA chip + MAX98706/SSM3515 amps
GNU General Public License v2.0
288 stars 62 forks source link

Warning on fresh Ubuntu 24.04 #125

Open vrilutza opened 6 months ago

vrilutza commented 6 months ago

Hello, I tried last fresh ubuntu 24.04 on Macbook pro 13 2017

vik@vik-MacBookPro14-1:~/snd_hda_macbookpro$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu 24.04 LTS"

sudo apt install gcc linux-headers-generic make patch wget sudo apt install build-essential sudo apt install git sudo apt install linux-source

first step log :

`vik@vik-MacBookPro14-1:~$ git clone https://github.com/davidjo/snd_hda_macbookpro.git Cloning into 'snd_hda_macbookpro'... remote: Enumerating objects: 345, done. remote: Counting objects: 100% (126/126), done. remote: Compressing objects: 100% (45/45), done. remote: Total 345 (delta 101), reused 93 (delta 81), pack-reused 219 Receiving objects: 100% (345/345), 8.26 MiB | 3.35 MiB/s, done. Resolving deltas: 100% (217/217), done. vik@vik-MacBookPro14-1:~$ cd snd_hda_macbookpro/

vik@vik-MacBookPro14-1:~/snd_hda_macbookpro$ sudo ./install.cirrus.driver.sh Ubuntu linux kernel source not found in /usr/src: /usr/src/linux-source-6.8.0.tar.bz2 assuming the linux kernel source package is not installed please install the linux kernel source package: sudo apt install linux-source-6.8.0 NOTE - This does not work for HWE kernels
vik@vik-MacBookPro14-1:~/snd_hda_macbookpro$ sudo apt install linux-source Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: linux-source-6.8.0 Suggested packages: libncurses-dev | ncurses-dev kernel-package libqt3-dev The following NEW packages will be installed: linux-source linux-source-6.8.0 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 354 MB of archives. After this operation, 357 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://ro.archive.ubuntu.com/ubuntu noble/main amd64 linux-source-6.8.0 all 6.8.0-31.31 [354 MB] Get:2 http://ro.archive.ubuntu.com/ubuntu noble/main amd64 linux-source all 6.8.0-31.31 [9,836 B]
Fetched 354 MB in 59s (5,966 kB/s)
debconf: unable to initialize frontend: Dialog debconf: (Dialog frontend requires a screen at least 13 lines tall and 31 columns wide.) debconf: falling back to frontend: Readline Selecting previously unselected package linux-source-6.8.0. (Reading database ... 151728 files and directories currently installed.) Preparing to unpack .../linux-source-6.8.0_6.8.0-31.31_all.deb ... Unpacking linux-source-6.8.0 (6.8.0-31.31) ... Selecting previously unselected package linux-source. Preparing to unpack .../linux-source_6.8.0-31.31_all.deb ... Unpacking linux-source (6.8.0-31.31) ... Setting up linux-source-6.8.0 (6.8.0-31.31) ... Setting up linux-source (6.8.0-31.31) ...`

and the second log when compile from terminal :

vik@vik-MacBookPro14-1:~/snd_hda_macbookpro$ sudo ./install.cirrus.driver.sh
linux-source-6.8.0/sound/pci/hda/
linux-source-6.8.0/sound/pci/hda/hda_intel.c
linux-source-6.8.0/sound/pci/hda/hda_cs_dsp_ctl.h
linux-source-6.8.0/sound/pci/hda/hda_beep.c
linux-source-6.8.0/sound/pci/hda/patch_cmedia.c
linux-source-6.8.0/sound/pci/hda/cs35l41_hda_property.c
linux-source-6.8.0/sound/pci/hda/cs35l56_hda_spi.c
linux-source-6.8.0/sound/pci/hda/Makefile
linux-source-6.8.0/sound/pci/hda/thinkpad_helper.c
linux-source-6.8.0/sound/pci/hda/patch_cs8409-tables.c
linux-source-6.8.0/sound/pci/hda/hda_auto_parser.h
linux-source-6.8.0/sound/pci/hda/cs35l41_hda_spi.c
linux-source-6.8.0/sound/pci/hda/hda_cs_dsp_ctl.c
linux-source-6.8.0/sound/pci/hda/patch_conexant.c
linux-source-6.8.0/sound/pci/hda/patch_cirrus.c
linux-source-6.8.0/sound/pci/hda/patch_cs8409.c
linux-source-6.8.0/sound/pci/hda/cs35l41_hda_property.h
linux-source-6.8.0/sound/pci/hda/hda_eld.c
linux-source-6.8.0/sound/pci/hda/hda_component.h
linux-source-6.8.0/sound/pci/hda/hda_intel_trace.h
linux-source-6.8.0/sound/pci/hda/cs35l56_hda_i2c.c
linux-source-6.8.0/sound/pci/hda/hda_hwdep.c
linux-source-6.8.0/sound/pci/hda/hda_beep.h
linux-source-6.8.0/sound/pci/hda/hda_tegra.c
linux-source-6.8.0/sound/pci/hda/Kconfig
linux-source-6.8.0/sound/pci/hda/patch_sigmatel.c
linux-source-6.8.0/sound/pci/hda/cirrus_scodec_test.c
linux-source-6.8.0/sound/pci/hda/cs35l41_hda_i2c.c
linux-source-6.8.0/sound/pci/hda/ca0132_regs.h
linux-source-6.8.0/sound/pci/hda/hda_bind.c
linux-source-6.8.0/sound/pci/hda/cs35l56_hda.h
linux-source-6.8.0/sound/pci/hda/tas2781_hda_i2c.c
linux-source-6.8.0/sound/pci/hda/patch_ca0132.c
linux-source-6.8.0/sound/pci/hda/hda_auto_parser.c
linux-source-6.8.0/sound/pci/hda/cs35l41_hda.h
linux-source-6.8.0/sound/pci/hda/patch_realtek.c
linux-source-6.8.0/sound/pci/hda/patch_si3054.c
linux-source-6.8.0/sound/pci/hda/cs35l41_hda.c
linux-source-6.8.0/sound/pci/hda/hp_x360_helper.c
linux-source-6.8.0/sound/pci/hda/hda_local.h
linux-source-6.8.0/sound/pci/hda/hda_controller.c
linux-source-6.8.0/sound/pci/hda/hda_controller.h
linux-source-6.8.0/sound/pci/hda/patch_ca0110.c
linux-source-6.8.0/sound/pci/hda/hda_sysfs.c
linux-source-6.8.0/sound/pci/hda/patch_hdmi.c
linux-source-6.8.0/sound/pci/hda/patch_analog.c
linux-source-6.8.0/sound/pci/hda/ideapad_s740_helper.c
linux-source-6.8.0/sound/pci/hda/hda_controller_trace.h
linux-source-6.8.0/sound/pci/hda/hda_generic.c
linux-source-6.8.0/sound/pci/hda/cirrus_scodec.h
linux-source-6.8.0/sound/pci/hda/patch_cs8409.h
linux-source-6.8.0/sound/pci/hda/hda_codec.c
linux-source-6.8.0/sound/pci/hda/hda_jack.h
linux-source-6.8.0/sound/pci/hda/cirrus_scodec.c
linux-source-6.8.0/sound/pci/hda/cs35l56_hda.c
linux-source-6.8.0/sound/pci/hda/patch_via.c
linux-source-6.8.0/sound/pci/hda/hda_proc.c
linux-source-6.8.0/sound/pci/hda/hda_intel.h
linux-source-6.8.0/sound/pci/hda/hda_generic.h
linux-source-6.8.0/sound/pci/hda/hda_jack.c
Kernel version later than implemented version - there may be build problems
patching file patch_cs8409.c
Hunk #1 succeeded at 1445 (offset 175 lines).
Hunk #2 succeeded at 1454 (offset 175 lines).
Hunk #3 succeeded at 1483 (offset 175 lines).
patching file patch_cs8409.h
Hunk #2 succeeded at 304 (offset 2 lines).
Hunk #3 succeeded at 331 (offset 2 lines).
Hunk #4 succeeded at 367 (offset 2 lines).
patching file patch_cirrus_apple.h
make -C /lib/modules/6.8.0-31-generic/build CFLAGS_MODULE="-DAPPLE_PINSENSE_FIXUP -DAPPLE_CODECS -DCONFIG_SND_HDA_RECONFIG=1 -Wno-unused-variable -Wno-unused-function" M=/home/vik/snd_hda_macbookpro/build/hda modules
make[1]: Entering directory '/usr/src/linux-headers-6.8.0-31-generic'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: x86_64-linux-gnu-gcc-13 (Ubuntu 13.2.0-23ubuntu4) 13.2.0
  You are using:           gcc-13 (Ubuntu 13.2.0-23ubuntu4) 13.2.0
  CC [M]  /home/vik/snd_hda_macbookpro/build/hda/patch_cs8409.o
In file included from /home/vik/snd_hda_macbookpro/build/hda/patch_cs8409.c:1489:
/home/vik/snd_hda_macbookpro/build/hda/patch_cirrus_apple.h:891:6: warning: no previous prototype for ‘cs_8409_dump_callback’ [-Wmissing-prototypes]
  891 | void cs_8409_dump_callback(struct hda_codec *codec)
      |      ^~~~~~~~~~~~~~~~~~~~~
/home/vik/snd_hda_macbookpro/build/hda/patch_cirrus_apple.h:912:1: warning: no previous prototype for ‘cs_8409_hda_jack_detect_enable_callback’ [-Wmissing-prototypes]
  912 | cs_8409_hda_jack_detect_enable_callback(struct hda_codec *codec, hda_nid_t nid, int dev_id, int tag,
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/vik/snd_hda_macbookpro/build/hda/patch_cirrus_apple.h:1465:5: warning: no previous prototype for ‘cs_8409_apple_build_pcms’ [-Wmissing-prototypes]
 1465 | int cs_8409_apple_build_pcms(struct hda_codec *codec)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~
/home/vik/snd_hda_macbookpro/build/hda/patch_cirrus_apple.h:1551:6: warning: no previous prototype for ‘cs_8409_cs42l83_mark_jack’ [-Wmissing-prototypes]
 1551 | void cs_8409_cs42l83_mark_jack(struct hda_codec *codec)
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/vik/snd_hda_macbookpro/build/hda/patch_cirrus_apple.h:1592:6: warning: no previous prototype for ‘cs_8409_cs42l83_jack_report_sync’ [-Wmissing-prototypes]
 1592 | void cs_8409_cs42l83_jack_report_sync(struct hda_codec *codec)
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/vik/snd_hda_macbookpro/build/hda/patch_cirrus_apple.h:1600:6: warning: no previous prototype for ‘cs_8409_cs42l83_jack_report_hp_update’ [-Wmissing-prototypes]
 1600 | void cs_8409_cs42l83_jack_report_hp_update(struct hda_codec *codec, int plugin)
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/vik/snd_hda_macbookpro/build/hda/patch_cirrus_apple.h:1613:6: warning: no previous prototype for ‘cs_8409_cs42l83_jack_unsol_event’ [-Wmissing-prototypes]
 1613 | void cs_8409_cs42l83_jack_unsol_event(struct hda_codec *codec, unsigned int res)
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/vik/snd_hda_macbookpro/build/hda/patch_cirrus_apple.h:1710:6: warning: no previous prototype for ‘cs_8409_apple_free’ [-Wmissing-prototypes]
 1710 | void cs_8409_apple_free(struct hda_codec *codec)
      |      ^~~~~~~~~~~~~~~~~~
In file included from /home/vik/snd_hda_macbookpro/build/hda/patch_cirrus_apple.h:3106:
/home/vik/snd_hda_macbookpro/build/hda/patch_cirrus_new84.h:457:6: warning: no previous prototype for ‘snd_hda_coef_item’ [-Wmissing-prototypes]
  457 | void snd_hda_coef_item(struct hda_codec *codec, u16 write_flag, hda_nid_t nid, u32 idx, u32 param, u32 retdata, int srcidx)
      |      ^~~~~~~~~~~~~~~~~
/home/vik/snd_hda_macbookpro/build/hda/patch_cirrus_new84.h:488:5: warning: no previous prototype for ‘snd_hda_coef_item_check’ [-Wmissing-prototypes]
  488 | int snd_hda_coef_item_check(struct hda_codec *codec, u16 write_flag, hda_nid_t nid, u32 idx, u32 param, u32 retdata, int srcidx)
      |     ^~~~~~~~~~~~~~~~~~~~~~~
/home/vik/snd_hda_macbookpro/build/hda/patch_cirrus_new84.h:512:6: warning: no previous prototype for ‘snd_hda_coef_item_masked’ [-Wmissing-prototypes]
  512 | void snd_hda_coef_item_masked(struct hda_codec *codec, u16 write_flag, hda_nid_t nid, u32 idx, u32 param, u32 mask, u32 retdata, u32 srcval, int srcidx)
      |      ^~~~~~~~~~~~~~~~~~~~~~~~
/home/vik/snd_hda_macbookpro/build/hda/patch_cirrus_new84.h:531:6: warning: no previous prototype for ‘snd_hda_coef_sequence’ [-Wmissing-prototypes]
  531 | void snd_hda_coef_sequence(struct hda_codec *codec, const struct hda_coef *seq, char *prtstr)
      |      ^~~~~~~~~~~~~~~~~~~~~
/home/vik/snd_hda_macbookpro/build/hda/patch_cirrus_new84.h:556:6: warning: no previous prototype for ‘snd_hda_double_reset’ [-Wmissing-prototypes]
  556 | void snd_hda_double_reset(struct hda_codec *codec)
      |      ^~~~~~~~~~~~~~~~~~~~
/home/vik/snd_hda_macbookpro/build/hda/patch_cirrus_new84.h:1118:6: warning: no previous prototype for ‘cs_8409_play_setup’ [-Wmissing-prototypes]
 1118 | void cs_8409_play_setup(struct hda_codec *codec)
      |      ^~~~~~~~~~~~~~~~~~
/home/vik/snd_hda_macbookpro/build/hda/patch_cirrus_new84.h:1154:6: warning: no previous prototype for ‘cs_8409_play_cleanup’ [-Wmissing-prototypes]
 1154 | void cs_8409_play_cleanup(struct hda_codec *codec)
      |      ^~~~~~~~~~~~~~~~~~~~
/home/vik/snd_hda_macbookpro/build/hda/patch_cirrus_new84.h:1190:6: warning: no previous prototype for ‘cs_8409_capture_setup’ [-Wmissing-prototypes]
 1190 | void cs_8409_capture_setup(struct hda_codec *codec)
      |      ^~~~~~~~~~~~~~~~~~~~~
/home/vik/snd_hda_macbookpro/build/hda/patch_cirrus_new84.h:1208:6: warning: no previous prototype for ‘cs_8409_capture_cleanup’ [-Wmissing-prototypes]
 1208 | void cs_8409_capture_cleanup(struct hda_codec *codec)
      |      ^~~~~~~~~~~~~~~~~~~~~~~
/home/vik/snd_hda_macbookpro/build/hda/patch_cirrus_new84.h:1355:6: warning: no previous prototype for ‘cs_8409_headplay_setup’ [-Wmissing-prototypes]
 1355 | void cs_8409_headplay_setup(struct hda_codec *codec)
      |      ^~~~~~~~~~~~~~~~~~~~~~
/home/vik/snd_hda_macbookpro/build/hda/patch_cirrus_new84.h:1395:6: warning: no previous prototype for ‘cs_8409_headplay_cleanup’ [-Wmissing-prototypes]
 1395 | void cs_8409_headplay_cleanup(struct hda_codec *codec)
      |      ^~~~~~~~~~~~~~~~~~~~~~~~
/home/vik/snd_hda_macbookpro/build/hda/patch_cirrus_new84.h:1439:6: warning: no previous prototype for ‘cs_8409_headcapture_setup’ [-Wmissing-prototypes]
 1439 | void cs_8409_headcapture_setup(struct hda_codec *codec)
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/vik/snd_hda_macbookpro/build/hda/patch_cirrus_new84.h:1465:6: warning: no previous prototype for ‘cs_8409_headcapture_cleanup’ [-Wmissing-prototypes]
 1465 | void cs_8409_headcapture_cleanup(struct hda_codec *codec)
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC [M]  /home/vik/snd_hda_macbookpro/build/hda/patch_cs8409-tables.o
  LD [M]  /home/vik/snd_hda_macbookpro/build/hda/snd-hda-codec-cs8409.o
  MODPOST /home/vik/snd_hda_macbookpro/build/hda/Module.symvers
  CC [M]  /home/vik/snd_hda_macbookpro/build/hda/snd-hda-codec-cs8409.mod.o
  LD [M]  /home/vik/snd_hda_macbookpro/build/hda/snd-hda-codec-cs8409.ko
  BTF [M] /home/vik/snd_hda_macbookpro/build/hda/snd-hda-codec-cs8409.ko
Skipping BTF generation for /home/vik/snd_hda_macbookpro/build/hda/snd-hda-codec-cs8409.ko due to unavailability of vmlinux
make[1]: Leaving directory '/usr/src/linux-headers-6.8.0-31-generic'
make INSTALL_MOD_DIR=updates -C /lib/modules/6.8.0-31-generic/build M=/home/vik/snd_hda_macbookpro/build/hda CONFIG_MODULE_SIG_ALL=n modules_install
make[1]: Entering directory '/usr/src/linux-headers-6.8.0-31-generic'
  INSTALL /lib/modules/6.8.0-31-generic/updates/snd-hda-codec-cs8409.ko
  SIGN    /lib/modules/6.8.0-31-generic/updates/snd-hda-codec-cs8409.ko
  DEPMOD  /lib/modules/6.8.0-31-generic
Warning: modules_install: missing 'System.map' file. Skipping depmod.
make[1]: Leaving directory '/usr/src/linux-headers-6.8.0-31-generic'
depmod -a

contents of /lib/modules/6.8.0-31-generic/updates
total 2612
-rw-r--r-- 1 root root 2672736 May  7 19:54 snd-hda-codec-cs8409.ko
vik@vik-MacBookPro14-1:~/snd_hda_macbookpro$ 
davidjo commented 6 months ago

Thanks for the input - you beat me to it - my linux machines arent listing 24.04 as available yet.

My initial guess is it looks like the new compiler version (gcc-13) has some flag changes (-Wmissing-prototypes) which seems to require a slightly different coding style to the one that has worked - looks like I need to define some prototypes for functions before using them (most of the warnings are for new functions I created). The actual patching of files seems to be OK though - and the messages are only warnings so it did actually create the module - as seen in the contents of listing.

vrilutza commented 5 months ago

Hello again, sorry for my late reply, yes with a new version (gcc-13) has some flag changes i just make a issue to know about that but the driver is working fine, my dream is to one day try to push upstream. I hope one day try to help you some people from opensource.cirrus.com to push upstream I good start i think is this ticket https://bugzilla.kernel.org/show_bug.cgi?id=110561

davidjo commented 5 months ago

Thanks - updates from 23.10 to 24.04 have now been allowed so will be doing this shortly.

fspkwon commented 3 months ago

kernel has to be 6.5 i would kernel-6.5-unsigned uninstall the hwe kernel all the headers all the sources and what not and let it pull in --lowlatency and --generic id use synaptic for this keywords: linux-generic-6.6.5-unsigned linux-generic-6.6.5-unsigned-low-latency and linux-headers-6.6.5 linux-source-6.6.5 linux-firmware-6.6.5 linux-modules-6.6.5 and you have to untar and unbzip the sources remove the package and reinstall it once the unzipped things are removed because its gonna ask for them and you have to do some kind of a mv kerneldir . command <- meaning mv kernel/ . as the command theres a space between and . and that brings the extracted source into the previous working directory so the script knows how to do it

davidjo commented 3 months ago

Ubuntus default kernel is 6.8 for 24.04 which Im running and sound works for me - the issue is the repo works with the default distribution kernel but using a non-default kernel can give problems. The current repo head has fixups so the above warnings have been removed.