Open aunali1 opened 5 years ago
Small note: I fixed the start audio glitch, audio is mostly fine now.
As I stated before, the config has to be written if we want both speaker and headphones to work, and I have no 20 hours to waste. If anyone else is willing to spend the time trying to understand that format, I'd gladly appreciate it.
Ok I wrote a config:
<confdir:pcm/front.conf>
<confdir:pcm/surround40.conf>
AppleT2.pcm.surround40.0 {
@args [ CARD ]
@args.CARD {
type string
}
type hw
card $CARD
device 1
}
AppleT2.pcm.front.0 {
@args [ CARD ]
@args.CARD {
type string
}
type hw
card $CARD
device 0
}
Put this in /usr/share/alsa/cards/AppleT2.conf No idea if this can be written in a better way or not, for now this is what we're stuck with.
I can confirm that with ALSA config file mentioned above there are now two configurations in sound settings:
In the mean time could you please check wifi thread - #112
I'm pretty sure noone (besides you) was able to make wifi working. Maybe we are missing something. Cheers everyone!
@MCMrARM to make internal mic working do we need to only modify existing ALSA config file or does it need any work on driver side to be done?
Work on the driver needs to be done.
Implemented jack detection: https://github.com/MCMrARM/mbp2018-bridge-drv/commit/d3224b861177ed863c492833d17e09c02ed1d53f No idea how to integrate into alsa ¯\_(ツ)_/¯
I'll try to get the microphone working tomorrow, no promises though.
Some good news: I got internal mic working at all, will push code today. Not sure how good are the results. The microphone is apparently a triple-channel device btw. Might be a little bit of a mess to get it working in alsa.
edit: will do it tomorrow, as I had issues with glitches and had to do some hacks.
Ok, this took a while to figure out but I got the mic/external audio input working under Pulse. https://gist.github.com/MCMrARM/c357291e4e5c18894bea10665dcebffb <- required files Note that the new commits broke the old audio config, and you MUST switch to the new configuration if you update. Though the mic works now, so nice.
@MCMrARM are there any additional steps needed? I copied those 3 config files, recompiled module, loaded it and there's no audio/input device now - only .dummy output
Update: My bad i didn't execute dracut to update initramfs... ehh. So after a reboot there are two output devices with two configurations each (as it is in pulseaudio config file from link above) but any input device is not recognized ;). I was trying to modify that pulseaudio config file and maybe we need to change paths-output
to paths-input
in mappings for mics ;)
@mikeeq I mean, I don't know, it works for me. Does changing the paths-output to paths-input work for you?
@aunali1 @ppaulweber @jhohisel Has anyone of you guys tried to use new audio driver and is microphone working for you? For me, after changing to paths-input
microphones are visible in sound settings but they are not working.
With the driver from latest git and the config files linked above, launching pulseaudio fails on my MBP15,2 with:
Apr 08 19:00:58 little kernel: aaudio_pcm_open
Apr 08 19:00:58 little kernel: aaudio_pcm_hw_params
Apr 08 19:00:58 little kernel: aaudio_pcm_open
Apr 08 19:00:58 little kernel: aaudio_pcm_hw_params
Apr 08 19:00:58 little kernel: aaudio_pcm_hw_free
Apr 08 19:00:58 little kernel: aaudio_pcm_close
Apr 08 19:00:58 little kernel: aaudio_pcm_open
Apr 08 19:00:58 little kernel: aaudio_pcm_hw_params
Apr 08 19:00:58 little kernel: aaudio_pcm_hw_free
Apr 08 19:00:58 little kernel: aaudio_pcm_close
Apr 08 19:00:58 little kernel: aaudio_pcm_open
Apr 08 19:00:58 little kernel: aaudio_pcm_hw_params
Apr 08 19:00:58 little kernel: aaudio_pcm_hw_free
Apr 08 19:00:58 little kernel: aaudio_pcm_close
Apr 08 19:00:58 little kernel: aaudio_pcm_hw_free
Apr 08 19:00:58 little kernel: aaudio_pcm_close
Apr 08 19:00:58 little kernel: aaudio_pcm_open
Apr 08 19:00:58 little kernel: aaudio_pcm_hw_params
Apr 08 19:00:58 little kernel: aaudio_pcm_trigger 1
Apr 08 19:00:58 little kernel: aaudio: Backed up the buffer in 72794953ns [16640]
Apr 08 19:00:58 little kernel: aaudio aaudio: Received timestamp update for dev=3a ts=480cfd953e seed=0
Apr 08 19:00:58 little kernel: aaudio: Started the audio device in 97586739ns
Apr 08 19:00:58 little kernel: aaudio_pcm_open
Apr 08 19:00:58 little kernel: aaudio_pcm_hw_params
Apr 08 19:00:58 little kernel: x86/PAT: pulseaudio:1681 map pfn RAM range req uncached-minus for [mem 0x7c440000-0x7c470fff], got write-back
Apr 08 19:00:58 little kernel: aaudio_pcm_trigger 1
Apr 08 19:00:58 little kernel: aaudio: Started the audio device in 3235965ns
Apr 08 19:00:58 little kernel: aaudio_pcm_pointer while not started
Apr 08 19:00:58 little kernel: aaudio aaudio: Received timestamp update for dev=21 ts=4810dd812a seed=0
Apr 08 19:00:59 little systemd[748]: Started Sound Service.
Apr 08 19:00:59 little kernel: aaudio aaudio: Received timestamp update for dev=3a ts=4821a726d0 seed=0
Apr 08 19:00:59 little kernel: aaudio aaudio: Received timestamp update for dev=21 ts=48258774df seed=0
Apr 08 19:00:59 little kernel: aaudio aaudio: Received timestamp update for dev=3a ts=4836508bf2 seed=0
Apr 08 19:00:59 little kernel: aaudio_pcm_trigger 0
Apr 08 19:00:59 little kernel: aaudio_pcm_hw_free
Apr 08 19:00:59 little kernel: aaudio_pcm_close
Apr 08 19:00:59 little kernel: aaudio_pcm_trigger 0
Apr 08 19:00:59 little kernel: aaudio_pcm_hw_free
Apr 08 19:00:59 little kernel: aaudio_pcm_close
Apr 08 19:00:59 little systemd[748]: pulseaudio.service: Main process exited, code=killed, status=9/KILL
Disabling realtime scheduling in pulseaudio fixes the above. It appears that with this driver, pulseaudio spends too much time in realtime blocks and gets killed.
Hi guys, you're doing a great job @MCMrARM ! I have a quick question, I'm running Ubuntu on a MacbookPro 2017 (no T2 chip), would this approach work for me? Can i try https://github.com/MCMrARM/mbp2018-bridge-drv ? Thanks!
Have you tried this repo yet? https://github.com/MCMrARM/mbp2018-bridge-drv
I would just add add an install
command to that Makefile
ie
obj-m += bce.o
bce-objs := pci.o mailbox.o queue.o queue_dma.o vhci/vhci.o vhci/queue.o vhci/transfer.o audio/audio.o audio/protocol.o audio/protocol_bce.o audio/pcm.o
MY_CFLAGS += -DWITHOUT_NVME_PATCH
#MY_CFLAGS += -g -DDEBUG
ccflags-y += ${MY_CFLAGS}
CC += ${MY_CFLAGS}
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
install:
mkdir -p /lib/modules/$(shell uname -r)/updates
cp bce.ko /lib/modules/$(shell uname -r)/updates
depmod -a
**the lines under all: clean: and install:
need to be indented with a tab
then just run, make
+ make install
+ reboot
Give that a shot and see if it works.
Hey, thanks! I haven't installed linux on my T2 macbook, but if I decide to do it I'll definitely check this out. Thanks again!
@leifliddy it doesnt work why im a simple man who uses 15,4 mac and wants sound in arch llinux
00:1f.3 Audio device: Intel Corporation Cannon Point-LP High Definition Audio Controller (rev 30)
Subsystem: Intel Corporation Device 7270
Flags: bus master, fast devsel, latency 64, IRQ 55
Memory at 91a10000 (64-bit, non-prefetchable) [size=16K]
Memory at 4000000000 (64-bit, non-prefetchable) [size=1M]
Capabilities: <access denied>
Kernel driver in use: snd_hda_intel
Kernel modules: snd_hda_intel, snd_soc_skl, snd_sof_pci
--
02:00.3 Multimedia audio controller: Apple Inc. Apple Audio Device (rev 01)
Subsystem: Apple Inc. Device 1885
Flags: fast devsel
Memory at b0c00000 (64-bit, prefetchable) [disabled] [size=4M]
Memory at b1180000 (64-bit, prefetchable) [disabled] [size=512K]
Memory at b1230000 (64-bit, prefetchable) [disabled] [size=64K]
Capabilities: <access denied>
@leifliddy
my problem solved
you should add mkinitcpio -p linux
at the end
Discussion and updates regarding Apple Audio related support. Parent thread is #71.