-
Notifications
You must be signed in to change notification settings - Fork 63
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
imac18,3 Linux Mint 21 [approx=Ubuntu 22.04] kernel 15.0.52-lowlatency cs8409 compilation etc #75
Comments
Yes - issue #40 is now old and not for the current version. Your other problem is a known issue - as of around ubuntu kernel version 5.15.0-43 the mainline kernel removed a variable from the mainline kernel 8409 module sources which the patching patch files expect as context. Im still figuring out a good way to handle these breaking mainline kernel updates which seem to happen frequently so my repo is not updated yet (Id hoped changing to patch files would reduce breakage frequency). Channel mapping should be handled now for all Macs - except is L/R Tweeter L/R Woofer (could have Tweeter/Woofer reversed) rather than Apples L Tweeter/Woofer R Tweeter/Woofer 4 channel format. Checkout issue #56 for recent attempt at improved quality. |
Thank you -- I'll have a look now and get back to you |
That is of course Kernel 5.15.0-52-lowlatency my brain has only just registered the typo |
Have to say Ive only ever used the generic kernel - low latency may need a special kernel source - in Ubuntu you just install linux-source to get the kernel source - I know this doesnt work for HWE kernels. PS the kernel module should be under build/hda-..... where ... is a kernel version number in your clone directory - if it built - you can manually build by doing make in the build/hda-.... directory (check the exact make commands in the install script). |
Diolch Dafydd / thank you David. Yes mint is heavily Ubuntu so it does require the Debian / Ubuntu patched source code, although as your comment in install.sh indicates, **NAME="Linux Mint" so 76 isubuntu=0 doesn't find anything... if [ $(grep -ic 'Ubuntu' /etc/os-release) -ge 1 ]; then ... would catch most of the seemingly ever growing number of ubuntu-bassed distributions (hopefully) Re ...cs8409.koIve just done a ls -l snd_hda_macbookpro/build/hda-5.15.0/ | grep cs8409 -rw-r--r-- 1 root root 44463 Nov 7 21:57 patch_cs8409.c which is puzzling... |
You can just blast isubuntu=1 in the script. You might check you have the right header files installed - Im assuming you should have linux-headers-5.15.0-52-lowlatency rather than linux-headers-5.15.0-52-generic. |
Cheers David, Re: "you can ... isubuntu=1 etc" -- that's how my install script has read since I realised that this was a problem -- my suggestion (inelegant as it was) was an attempt to improve the script for future users (without having to resort to separate conditions for each of a dozen + ubuntu-based distributions. Of course the problem with it lies in the assumption that all of them have a an Re Header files -- fortunately I have appropriate K-headers installed for all installed kernels so I'm not having that problem. Re "when I'm debugging ... " -- I'm currently trying to do exactly that, so it's good to know I'm approaching this in a sensible fashion. Currently not having much success however (not even ...cirrus.ko is compiling / installing) so at the moment I'm trying to understand enough about make (I'm somewhat rusty), to work out where it is getting lost and about what -- there definitely seems to be a problem finding System.map.5.15.0-52-generic for depmod and also finding /lib/modules/5.15.0-52-generic/modules.order from modules_install -- but I don't understand why yet. Anyway thanks again and I'll hopefully be able to come back to you shortly with something more sensible. |
Ok so... I resolved the ...cs8409.ko build problem which was was caused by patch failing at this line
This was from a a fresh clone in case I'd inadvertently done something to one of the files... ...cs8409.ko now builds and installs to the update directory (I also moved the ...kernel/sound/pci/hda/ version of ...cs8409.ko just to be safe, and then re-ran depmod -a) After a reboot there is unfortunately no sound from either the speakers or the headphone port syslog shows me this: Nov 16 19:06:39 Epona systemd-modules-load[442]: Inserted module 'snd_hda_core' lsmod shows me this: nial@Epona:~$ lsmod | grep snd amixer gives: amixer -D default and alsamixer shows: Card HDA Intel PCH with a single bar <100>PCM<100> for playback, and nothing else... I'm at a bit of a loss to know what is going wrong (or perhaps what I'm doing wrong) or what I should do next Any thoughts would be appreciated |
Well you have defintely got my module loaded - its not signed hence the module verifcation failure. |
Thank you David aplay -D plughw StereoTest32_reduced_m24dB.wav and aplay -D surround40 StereoTest32_reduced_m24dB.wav all fail to execute with: nothing arrives in syslog aplay StereoTest32_reduced_m24dB.wav succeeds with but of course no sound and again (possibly as you'd expect) nothing arrives in syslog aplay -l gives us:
[Card 1 -- ie the hdmi sound side of the Graphics card -- which shows up as turned off in sound preferences (pulse?)] pacmd list-cards aplay -L gives us this:
alsa seems to be attaching hw, plughw etc to the hdmi card I hope this moves us forward a bit... n |
yes thats something you need to watch for - the HDMI sound device. |
pipewire -- just recently (fully-ish) installed (mainly because I noticed some of the amendments to sound in #56 etc used elements of it that weren't installed on my system by default apt tells me I'm using 0.3.48-1Ubuntu2 and that this is the latest available -- but this is probably just for LM-21. If pipewire is a problem I can make it go away... isubuntu condition (install.cirrus.driver.sh lines 76 -- 79) now to trawl though syslog... |
/var/log/syslog | grep snd_hda
repeated for each boot. Is however the last line of any significance? Also there are no references to hdaudioC1D1 (and none incidentally in dmesg) and -- having just checked -- there have not been in the past on this system. grepping for sound : this only reveals references to the hdmi card of the following sort
grepping for audio reveals messages from jack (complaining about lack of real-time facilities)
These again repeat at each boot-time It begins to look as if my system is somewhat confused (new clean install on 11/10/22 -- but has only been bootable since 29/10/22 -- long story) I would lose very little by wiping it and reinstalling if that begins to look necessary -- but would obviously prefer not to... |
also this is of interest... cat /proc/asound/PCH/codec#0 |
Look for the snd_hda_intel Primary Patch and snd_hda_intel Primary patch_cs8409 NOT FOUND trying APPLE messages. |
The only kernel messages re snd_hda_intel in syslog to date are the three above in the output of
the situation is the same in the archived syslogs (syslog.1 and syslog.2.gz) so we have to conclude something is wrong... |
Having written that last update yesterday I was struck by a terrible thought, which was confirmed by rereading the patch man pages -- the -v switch does not make patch more verbose, it prints a version statement to stdout and exits 0... this meant two things:
Please accept my apologies for the amount of time and effort of thought this mistake has wasted. This leaves me back in a situation where patching fails for hunk #3 of patch_ cs8409. h and compilation once again fails in the way described by my first post. Unfortunately adding --verbose to the patch commands is not a lot of help in trying to work out why the patching is going wrong. I'm going away to play with this for a bit... |
Hey no problem - you have no idea how many similar errors I make. |
I still feel a little mortified re the
and... Sound!
problems
Also
I'll keep testing and get back to you shortly. |
Hi @NialMcDJ, I have Ubuntu 20.04 in iMac 2019 5k on dual boot. I have followed the installation using this patch but with no success, also i have no issue with the quality of sound output, because i am getting an output in sound. I am very new to this and tried my luck with this dual boot. I would love to only work with ubuntu system.I have lots of meeting to attend and i need the microphone to work somehow, is there any solution on how to achieve mic input. |
I would suggest getting either a USB or bluetooth headset with mike or just mike - those should work out of the box. |
Hi @davidjo , thanks for the quick response, I tried to connect the bluetooth headset to the iMac, sound output was shown as bluetooth headset and i got sounds in the headset , but input was still detected as internal microphone, is there any tweak to bring the input section to show the bluetooth headset |
Thats sounds annoying - as far as I am aware if the bluetooth headset has a mike it should appear as an input in the user audio settings GUI panel (part of the main Settings GUI) which you should be able to set to the bluetooth headset (as it appears the auto switching may not be working for some reason - which I have had problems with in general) - I do not have USB/bluetooth headsets so cant help much more - its just something Ive seen on sites which discuss which bits work and which dont for Mac machines. |
hi @nikhilss219 sorry for the delay -- I've been present but my brain's been elsewhere... I think I have a slightly older imac than you -- mine is (18,3) whereas yours would presumably be 19,1 (27") or 19.2 (21.5") --
OK so... When you say
Sorry about asking all these questions... Get back to me when you can -- you have my sympathies as someone new to the (on occasion) somewhat intense world of Linux -- in the beginning it's a lot to take in -- welcome to the frontier. |
Hi @davidjo |
Thanks for your work! To add build support for Linux Mint 21 (tested with kernel 5.15.0-67-generic): Simply duplicate in installer.cirrus.driver.sh the lines Additional note: in case of my iMac 2017 (dmidecode: iMac18,3) the output setting analog surround 4.0 works fine. (Analog stereo works as well.) |
Thanks for the update - Ill add this to the main repo plus the new internal mike updates. |
Firstly a heartfelt thanks to you in particular David and to all those others who over the months (and indeed years) have contributed to this work. My apologies for not having participated to date. I am now however in a position to contribute in any way I can to help carry things forward.
No Sound
I followed the instructions in the README re compiling the cirrus module from the beginning a good number of times (and at several points followed the instructions in #40 -- which I believe are now somewhat out of date -- in relation to Alex Egorenkov's fork). However although both kernel and Alsa recognised the card, Alsa was adamant that the device had no controls and thus there was no sound.
The Problem
It was only when I realised that there was probably a problem with snd-hda-codec-cs8409, and blacklisted it, that sound miraculously appeared.
Sound
I am happy to report that I now have sound -- so at this point I have the same sorts of problem that everybody else is struggling through -- RH woofer goodish -- LH tweeter there but barely present and very thin and nothing else.
I have yet to try the headphone port -- but will report on it when I do.
Incidentally the un-reduced StereoTest32.wav file is not overly loud currently on my system.
compiling / pathching snd-hda-codec-cs8409
patching this fails on my system with:
CC [M] /home/nial/snd_hda_macbookpro/build/hda-5.15.0/patch_cs8409.o
patching file patch_cs8409.c
Hunk #1 succeeded at 1262 (offset -8 lines).
Hunk #2 succeeded at 1271 (offset -8 lines).
Hunk #3 succeeded at 1300 (offset -8 lines).
patching file patch_cs8409.h
Hunk #3 FAILED at 328.
Hunk #4 succeeded at 359 (offset -1 lines).
CC [M] /home/nial/snd_hda_macbookpro/build/hda-5.15.0/patch_cs8409.o
...
then
In file included from /home/nial/snd_hda_macbookpro/build/hda-5.15.0/patch_cs8409.c:1306:
/home/nial/snd_hda_macbookpro/build/hda-5.15.0/patch_cirrus_apple.h:157:10: error: ‘struct sub_codec’ has no member named ‘linein_jack_in’; did you mean ‘mic_jack_in’?
157 | .linein_jack_in = 0,
| ^~~~~~~~~~~~~~
| mic_jack_in
/home/nial/snd_hda_macbookpro/build/hda-5.15.0/patch_cirrus_apple.h:158:10: error: ‘struct sub_codec’ has no member named ‘force_status_change’
158 | .force_status_change = 1,
| ^~~~~~~~~~~~~~~~~~~
In file included from /home/nial/snd_hda_macbookpro/build/hda-5.15.0/patch_cs8409.c:1306:
/home/nial/snd_hda_macbookpro/build/hda-5.15.0/patch_cirrus_apple.h: In function ‘cs_8409_apple_boot_init’:
/home/nial/snd_hda_macbookpro/build/hda-5.15.0/patch_cirrus_apple.h:1192:15: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
1192 | hinfo = spec->gen.stream_analog_playback;
| ^
/home/nial/snd_hda_macbookpro/build/hda-5.15.0/patch_cirrus_apple.h: In function ‘cs8409_cs42l83_macbook_exec_verb’:
/home/nial/snd_hda_macbookpro/build/hda-5.15.0/patch_cirrus_apple.h:2346:42: error: ‘struct sub_codec’ has no member named ‘linein_jack_in’; did you mean ‘mic_jack_in’?
2346 | *res = (cs42l83->linein_jack_in) ? AC_PINSENSE_PRESENCE : 0;
| ^~~~~~~~~~~~~~
| mic_jack_in
/home/nial/snd_hda_macbookpro/build/hda-5.15.0/patch_cirrus_apple.h: In function ‘cs8409_cs42l83_imac_exec_verb’:
/home/nial/snd_hda_macbookpro/build/hda-5.15.0/patch_cirrus_apple.h:2392:42: error: ‘struct sub_codec’ has no member named ‘linein_jack_in’; did you mean ‘mic_jack_in’?
2392 | *res = (cs42l83->linein_jack_in) ? AC_PINSENSE_PRESENCE : 0;
| ^~~~~~~~~~~~~~
| mic_jack_in
make[2]: *** [scripts/Makefile.build:297: /home/nial/snd_hda_macbookpro/build/hda-5.15.0/patch_cs8409.o] Error 1
make[1]: *** [Makefile:1900: /home/nial/snd_hda_macbookpro/build/hda-5.15.0] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-52-lowlatency'
make: *** [Makefile:22: all] Error 2
...
then what hasn't failed to compile, fails to install into updates with
#cp snd-hda-codec-cs8409.ko /lib/modules/5.15.0-52-lowlatency/updates
make INSTALL_MOD_DIR=updates -C /lib/modules/5.15.0-52-lowlatency/build M=/home/nial/snd_hda_macbookpro/build/hda-5.15.0 modules_install
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-52-lowlatency'
arch/x86/Makefile:142: CONFIG_X86_X32 enabled but no binutils support
cat: /home/nial/snd_hda_macbookpro/build/hda-5.15.0/modules.order: No such file or directory
DEPMOD /lib/modules/5.15.0-52-lowlatency
Warning: modules_install: missing 'System.map' file. Skipping depmod.
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-52-lowlatency'
depmod -a
contents of /lib/modules/5.15.0-52-lowlatency/updates
total 1840
drwxr-xr-x 2 root root 4096 Oct 31 22:41 dkms
-rw-r--r-- 1 root root 1877448 Nov 5 21:18 snd-hda-codec-cirrus.ko
-- might some of this be to do with a compiler mismatch?
make -C /lib/modules/5.15.0-52-lowlatency/build CFLAGS_MODULE="-DAPPLE_PINSENSE_FIXUP -DAPPLE_CODECS -DCONFIG_SND_HDA_RECONFIG=1 -Wno-unused-variable -Wno-unused-function" M=/home/nial/snd_hda_macbookpro/build/hda-5.15.0 modules
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-52-lowlatency'
warning: the compiler differs from the one used to build the kernel
The kernel was built by: gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
You are using: gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
Where do I go from here?
compilation
Given that the patched ...-cirrus.ko is designed to work with a patched ...cs8409.ko
rather than instead of the vanilla ...cs8409.ko -- which is what I am doing currently
has anybody any thoughts about what I need to do to get it compiled / installed?
Sound
I'm about to look at all the discussion about Alsa / Pulse configuration files
I'll hopefully be in a position (ADHD allowing) to report some successes soonish
Thanks in advance for any thoughts, please let me know if there is further information you require. Also if there is anything I can do to help in general.
n
The text was updated successfully, but these errors were encountered: