jackaudio / jack2

jack2 codebase
GNU General Public License v2.0
2.22k stars 377 forks source link

Apple Silicon jack build fails during test #693

Open fxcoudert opened 3 years ago

fxcoudert commented 3 years ago

I've built jack 1.9.16 with the 3 latest commits for Apple Silicon support applied, as part of Homebrew at https://github.com/Homebrew/homebrew-core/pull/68079

We're seeing the following errors during testing, where we're running:

     jackd -X coremidi -d dummy

and in another process:

    jack_wait --wait --timeout 10

The errors are:

2020-12-31T15:33:40.2769900Z jackdmp 1.9.16
2020-12-31T15:33:40.2770750Z Copyright 2001-2005 Paul Davis and others.
2020-12-31T15:33:40.2771800Z Copyright 2004-2016 Grame.
2020-12-31T15:33:40.2772700Z Copyright 2016-2020 Filipe Coelho.
2020-12-31T15:33:40.2774740Z jackdmp comes with ABSOLUTELY NO WARRANTY
2020-12-31T15:33:40.2776280Z This is free software, and you are welcome to redistribute it
2020-12-31T15:33:40.2777330Z under certain conditions; see the file COPYING for details
2020-12-31T15:33:40.2778280Z JACK server starting in realtime mode with priority 10
2020-12-31T15:33:40.2779830Z self-connect-mode is "Don't restrict self connect requests"
2020-12-31T15:33:40.2783000Z CoreMIDI driver is opened...
2020-12-31T15:33:40.2818360Z JackCoreMidiDriver::Start - Starting driver.
2020-12-31T15:33:40.2823050Z JackCoreMidiDriver::Start - Enabling physical input ports.
2020-12-31T15:33:40.2824680Z JackCoreMidiDriver::Start - Enabling physical output ports.
2020-12-31T15:33:40.2826210Z JackCoreMidiDriver::Start - Enabling virtual input ports.
2020-12-31T15:33:40.2827750Z JackCoreMidiDriver::Start - Enabling virtual output ports.
2020-12-31T15:33:40.2829230Z JackCoreMidiDriver::Start - Driver started.
2020-12-31T15:33:40.2830160Z Cannot connect to server socket err = No such file or directory
2020-12-31T15:33:40.2831000Z Cannot connect to server request channel
2020-12-31T15:33:40.2831750Z jack server is not running or cannot be started
2020-12-31T15:33:40.2833370Z JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
2020-12-31T15:33:40.2835280Z JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
2020-12-31T15:33:40.2836450Z Cannot connect to server socket err = No such file or directory
2020-12-31T15:33:40.2837280Z Cannot connect to server request channel

and then it loops over those last few messages.

falkTX commented 3 years ago

Can you try without -X coremidi ?

fxcoudert commented 3 years ago

I'm not sure if I can remove it, as the rest of the test probably needs it (given there's a reference to midiseq):

    source_name = "test_source"
    sink_name = "test_sink"
    fork do
      exec "#{bin}/jackd", "-X", "coremidi", "-d", "dummy"
    end
    system "#{bin}/jack_wait", "--wait", "--timeout", "10"
    fork do
      exec "#{bin}/jack_midiseq", source_name, "16000", "0", "60", "8000"
    end
    midi_sink = IO.popen "#{bin}/jack_midi_dump #{sink_name}"
    sleep 1
    system "#{bin}/jack_connect #{source_name}:out #{sink_name}:input"
    sleep 1
    Process.kill "TERM", midi_sink.pid

    midi_dump = midi_sink.read
    assert_match "90 3c 40", midi_dump
    assert_match "80 3c 40", midi_dump
falkTX commented 3 years ago

I wouldnt say remove it altogether, just do a test to see if it succeeds. Didnt try the coremidi stuff on the M1+jack2 yet.

falkTX commented 3 years ago

Actually, from the code you posted, you dont need it. the midiseq connects to mididump, the coremidi stuff is never used.

fxcoudert commented 3 years ago

Same error without -X coremidi https://github.com/Homebrew/homebrew-core/pull/68079/checks?check_run_id=1631033361

falkTX commented 3 years ago

I am either missing something, or is jackd never started on that test? jackd needs to run first, so that jack_wait can return success.

fxcoudert commented 3 years ago

We see the same issue with jack 1.9.17 https://github.com/Homebrew/homebrew-core/pull/69123

/opt/homebrew/Cellar/jack/1.9.17/bin/jackd -X coremidi -d dummy
jackdmp 1.9.17
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2021 Filipe Coelho.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute 
under certain conditions; see the file COPYING for details
JACK server starting in realtime mode with priority 10
self-connect-mode is "Don't restrict self connect requests"
CoreMIDI driver is opened...
JackCoreMidiDriver::Start - Starting driver.
JackCoreMidiDriver::Start - Enabling physical input ports.
JackCoreMidiDriver::Start - Enabling physical output ports.
JackCoreMidiDriver::Start - Enabling virtual input ports.
JackCoreMidiDriver::Start - Enabling virtual output ports.
JackCoreMidiDriver::Start - Driver started.

After outputting this, jackd ends with non-zero exit code. How can we debug it further?