Score:0

Getting Apple T2 Audio to work with JACK

ru flag

The machine in question is a Macbook Pro 16,2(16 inch, 2019). I'm trying to start JACK server on that so that I could use MIDI and have audio the same time in Ardour.

So far stuffs I have tried:

In Ubuntu and Ubuntu Studio(22.04 LTS), with t2-ubantu-kernel (which I think provides Apple T2 Audio device or driver):

  • start JACK with qjackctl, with Apple T2 Audio as audio interface, various parameters settings: fail with error "ALSA: Cannot open PCM device alsa_pcm"
  • start JACK with qjackctl, with HDA ATI HDMI as audio interface, various parameters settings: fail(I'm not sure why, I'll check the output and edit the questions later)
  • start Ardour with alsa as audio system, Apple T2 Audio as device: fail with cannot start audio/midi engine
  • start Ardour with JACK as audio system and HDA ATI HDMI as device, alsa_seq as midi system: successful, no sound, but can see midi signal in midi tracks and sound signal in master
  • start Ardour with JACK as audio system and Apple T2 Audio as device, alsa_seq as midi system: fail with cannot start audio/midi engine
  • start Ardour with pulseaudio as audio system and Apple T2 Audio as as device, can't select midi system(showing only none as option): successful, have sound, but no midi connection

And here's some observations

  • aplay and pulseaudio work, so alsa knows how to use Apple T2 Audio device, and pulseaudio knows how to use Apple T2 audio through alsa
  • starting fluidsynth with instructions in PulseAudioMidi on debian wiki works, play on midi keyboard and have sound with no identifiable latency.
  • before I switch to t2-kernel, JACK and midi keyboard simply work on Ubuntu Studio(starting from Ardour; just no sound). I think the only available device is dummy.

I want to ask if anyone ever get Apple T2 Audio to work with JACK or is there some common workaround to do audio production on Ubuntu(or other distro) on a T2 Mac. If anyone could point out what my problem might be and how to solve them that would be the best.

ps: come to think of it, if alsa works and JACK works on top of alsa, then it should just work, or some configuration of JACK's way of using alsa to copy alsa's normal behaviour like that with aplay or the way pulseaudio did, but there's nothing I can find on the web about this.

Score:0
ru flag

I got it to work with pipewire, here's what I did:

1. reinstalled the system

To create a clean and easy-to-reproduce environment.

  1. install Ubuntu Studio
  2. do mannual kernel update according to t2linux
  3. create /etc/grub.d/08_t2support, and copy the first menu item in /boot/grub/grub.cfg into it, changing vmlinuz and initrd to the ones you just downloaded. They could be found under /boot, then sudo update-grub

/etc/grub.d/08_t2support looks like this. The function of it is to add a menuitem in front of everything that would load the kernel you just downloaded.

    echo "menuentry 'Ubuntu (t2 support)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-22dd21ec-2569-41c2-84e2-64aba99bada0' {
    recordfail
    load_video
    gfxmode $linux_gfx_mode
    insmod gzio
    if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
    insmod part_gpt
    insmod ext2
    set root='hd0,gpt5'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  22dd21ec-2569-41c2-84e2-64aba99bada0
    else
      search --no-floppy --fs-uuid --set=root 22dd21ec-2569-41c2-84e2-64aba99bada0
    fi
    linux   /boot/vmlinuz-6.3.9-t2-jammy root=UUID=22dd21ec-2569-41c2-84e2-64aba99bada0 ro  threadirqs quiet splash $vt_handoff
    initrd  /boot/initrd.img-6.3.9-t2-jammy
}"

2.install/enable pipewire

I followed this tutorial

3. run pipewire in place of jack

short version:

check ubuntu manuals page for pw-jack to find which package pw-jack is in, install it, and prefix it with every jack-aware program you want to use(just to be safe)

long version:

this is the tricky part, I read various posts and watched youtube videos about how pipewire and ardour work together, but most don't say, or say they "just worked out-of-box" which is hardly my case. Luckily, I spotted pw-jack in this unfa video which seems to do the work. It is not in standard pipewire package and pipewire-jack is irrelevent. I searched "pw-jack" in google and found it on ubuntu manuals page for pw-jack, which writes it is provided in pipewire-audio-client-libraries package. I installed it, then pw-jack qjackctl shows that jack is active, pw-jack ardour add it to a running jack connection, everything appear in qjackctl's graph, and everything works just fine.

Herman He avatar
ru flag
I should note here that after a period of time pw-jack is no longer needed for qjackctl to run or ardour to run with jack as audio system. Nothing has been done by me to the system during the change
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.