Skip to content

--connect doesn't load ini before connecting, causing missing pan controls #3732

Closed

Description

@seanogdelaney

The --connect command line option causes server connection to occur before the ini file is processed. I think that's unintended.

In main.cpp: Jamulus constructs CClient with strConnOnStartupAddress before it constructs CClientSettings, calls Settings.Load(...), and attaches settings with Client.SetSettings(...). The same block then constructs CClientDlg later for the GUI path.

I noticed pan controls missing in my GUI after using --connect. If I disconnect and reconnect using the GUI, the pan controls reappear. I think the ordering above is the reason.

I think issue #555 is also related to startup ordering but doesn't mention this specific problem.

Activity

  1. ann0see commented on Jun 13, 2026

    @ann0see
    Member

    I can't reproduce this - once I've set to stereo in settings the pan pots appear after re-opening?

  2. pljones commented on Jun 13, 2026

    @pljones
    Collaborator

    I can't reproduce this - once I've set to stereo in settings the pan pots appear after re-opening?

    Same for me Jamulus --connect localhost and it starts with the faders with pan.

    @seanogdelaney can you please:

    • confirm the Jamulus version you are using
    • what operating system you are using
    • confirm whether the problem varies depending on which server you connect to
    • post the complete command line you use to run Jamulus (you can obfuscate the server if desired)

    Also try taking a moving your Jamulus.ini file to a safe place, running Jamulus without --connect and making sure your sound settings are correct, exiting, then running with --connect using those settings.

  3. seanogdelaney commented on Jun 14, 2026

    @seanogdelaney
    Author

    I'll give as much info as possible to help reproduce, but perhaps a quick look at the code (and patch below) might save you the trouble. The patch was generated by an LLM. Loading the ini before connecting seems better, no?

    My server is on my LAN, Raspberry pi 4, Ubuntu Core, Jamulus version 3.9.1+dfsg-1build2.

    My client is on an old laptop (Late 2011 Macbook pro), Ubuntu 24.04.4 LTS
    The launch script is here on Mega

    Failing Jamulus version is 3.12.1
    Working (patched) Jamulus version is 3.12.1dev-ae4898bd-dirty

    The patch I used (git diff) is here on Mega
    The patch does this:

    • remove constructor-time auto-connect from CClient
    • let CClientDlg perform GUI auto-connect after settings/UI setup
    • preserve non-GUI auto-connect by starting after Settings.Load() / Client.SetSettings()
  4. softins commented on Jun 15, 2026

    @softins
    Member

    The patch I used (git diff) is here on Mega The patch does this:

    Thanks for the report, but it's not really helpful to use third party sites to provide scripts and patches in reports. Particularly since Mega starts asking for browser permissions and wanting me to download the diff file instead of just displaying it. So I haven't looked at it.

    What would be best is if you could create your own fork within Github, and then post your suggested patches as a branch in your own fork, from which you could raise a Pull Request.

    Failing that, post your scripts and diffs within triple-backtick blocks within a comment within Github.

  5. seanogdelaney commented on Jun 15, 2026

    @seanogdelaney
    Author

    Ok, thanks for the guidance.

    I’ve opened PR #3738.

    The script:

    #set -euo pipefail
    #set -x
    
    SERVER="pi.fritz.box"
    
    PATCHBAY="/home/sdel/.config/Jamulus/JamulusQjackctlPatchbay.xml"
    JAMULUS_1_INI="/home/sdel/.config/Jamulus/Jamulus.ini"
    JAMULUS_2_INI="/home/sdel/.config/Jamulus/JamulusMic.ini"
    
    JAMULUS_BIN="/usr/bin/jamulus"
    
    CPU_CORE=3
    RT_POLICY="-r"
    RT_PRIORITY=20
    
    wait_for_jack() {
        echo "Waiting for JACK to become available..."
    
        for i in {1..30}; do
            if jack_lsp >/dev/null 2>&1; then
                echo "JACK is up."
                return 0
            fi
            sleep 1
        done
    
        echo "ERROR: JACK did not become available in time." >&2
        exit 1
    }
    
    start_jamulus() {
        local ini_file="$1"
        local name="$2"
    
        echo "Starting ${name} using ${ini_file}"
    
        taskset -c "$CPU_CORE" \
            chrt "$RT_POLICY" "$RT_PRIORITY" \
            "$JAMULUS_BIN" \
            -c "$SERVER" \
            --inifile "$ini_file" &
    }
    
    # Disable compositor for lower graphics/audio overhead.
    xfconf-query -c xfwm4 -p /general/use_compositing -s false || true
    
    # Start JACK/QjackCtl with the patchbay.
    qjackctl --start --active-patchbay "$PATCHBAY" &
    
    # Do not rely only on sleep; wait until JACK responds.
    wait_for_jack
    
    # Give QjackCtl patchbay/autoconnect a little more time to apply routing.
    sleep 3
    
    # Start first Jamulus only after JACK and patchbay have settled.
    start_jamulus "$JAMULUS_1_INI" "Jamulus main"
    
    # Let the first instance register its JACK ports and initialize cleanly.
    sleep 4
    
    # Start second instance.
    start_jamulus "$JAMULUS_2_INI" "Jamulus mic"
    
    wait
    
  6. softins commented on Jun 15, 2026

    @softins
    Member

    I’ve opened PR #3738.

    Thank you, that is much better! It makes it easier for us to test, review and make comments, and also means that you will get credit in the change log for your contribution.

  7. moved this from Triage to Done in Trackingon Jun 16, 2026
  8. added this to the Release 4.0.0 milestone on Jul 26, 2026
  9. added theissue type on Jul 26, 2026
  10. changed the issue type fromtoon Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

  • Status
    Done

Relationships

None yet

Development

No branches or pull requests

Issue actions