midiwala CLI: "malformed address" when port name contains additional ":" (e.g. "Bome Network Virtual:BomeBox: MIDIHUB-1 [1]") #23

Open
opened 2025-11-03 21:56:59 +01:00 by ToFFmashines · 2 comments
ToFFmashines commented 2025-11-03 21:56:59 +01:00 (Migrated from github.com)

Description

When using midiwala connect|disconnect with quoted client:port names that themselves contain an extra colon in the port part (e.g. player: T-1), the CLI returns malformed address …. Using numeric clientID:portID works, so this appears to be a parsing limitation in the name-based address path.

Environment

  • Device: Raspberry Pi 5
  • OS: Patchbox OS (ALSA with PipeWire present)
  • midiwala/midiminder version: (can supply exact version if needed)
  • Context: RTP-MIDI + Bome Network : over net connected BomeBox with USB hub and two Blokas MidiHub and others midi stuf. Player is PC with Bome Network and connected Torso T-1 and Arturia BeatStep Pro sequencers.
  • Date observed: 2025-11-03

Steps to Reproduce

  1. List ports (note the extra colon in the port part of some names):

    $ midiwala list --ports --plain
    Bome Network Virtual:player
    Bome Network Virtual:player: Arturia BeatStep Pro 1
    Bome Network Virtual:player: T-1
    Bome Network Virtual:BomeBox
    Bome Network Virtual:BomeBox: CME UF
    Bome Network Virtual:BomeBox: MIDIHUB-1 [1]
    Bome Network Virtual:BomeBox: MIDIHUB-1 [2]
    Bome Network Virtual:BomeBox: MIDIHUB-1 [3]
    Bome Network Virtual:BomeBox: MIDIHUB-1 [4]
    Bome Network Virtual:BomeBox: MIDIHUB-2 [1]
    Bome Network Virtual:BomeBox: MIDIHUB-2 [2]
    Bome Network Virtual:BomeBox: MIDIHUB-2 [3]
    Bome Network Virtual:BomeBox: MIDIHUB-2 [4]
    Bome Network Virtual:BomeBox: WIDI Bud Pro
    Midi Through:Port-0
    rtp-zyn1:out-zyn1
    rtp-zyn2:out-zyn2
    
  2. Name-based connect where the port name contains an extra colon → fails:

    $ midiwala connect "Bome Network Virtual:player: T-1" "Bome Network Virtual:BomeBox: MIDIHUB-2 [1]"
    malformed address 'Bome Network Virtual:player: T-1'
    
  3. Name-based connect where neither side contains an extra colon inside the port name → works:

    $ midiwala connect "Midi Through:Port-0" "rtp-zyn1:out-zyn1"
    Connected Midi Through:Port-0 [14:0] --> rtp-zyn1:out-zyn1 [130:0]
    
  4. ID-based connect for the same “failing” pair → works:

    # player: T-1            → 132:2
    # BomeBox: MIDIHUB-2 [1] → 132:9
    $ midiwala connect    132:2 132:9
    $ midiwala disconnect 132:2 132:9
    

Actual Behavior

  • Name-based call (with quotes) errors out when the port contains an additional colon:

    malformed address 'Bome Network Virtual:player: T-1'
    
  • The same endpoints work via IDs.

  • Name-based calls without extra colons in the port (e.g., Midi Through:Port-0rtp-zyn1:out-zyn1) work fine.

Expected Behavior

  • Name-based addresses should accept port names containing : (since midiwala -l and list --ports --plain present such names) and resolve them to clientID:portID internally.

Additional Diagnostics / Context

  • midiwala -l :

      Ports:
          Bome Network Virtual : player                         [132:0] <->
          Bome Network Virtual : player: Arturia BeatStep Pro 1 [132:1] <->
          Bome Network Virtual : player: T-1                    [132:2] <->
          Bome Network Virtual : BomeBox                        [132:3] <->
          Bome Network Virtual : BomeBox: CME UF                [132:4] <->
          Bome Network Virtual : BomeBox: MIDIHUB-1 [1]         [132:5] <->
          Bome Network Virtual : BomeBox: MIDIHUB-1 [2]         [132:6] <->
          Bome Network Virtual : BomeBox: MIDIHUB-1 [3]         [132:7] <->
          Bome Network Virtual : BomeBox: MIDIHUB-1 [4]         [132:8] <->
          Bome Network Virtual : BomeBox: MIDIHUB-2 [1]         [132:9] <->
          Bome Network Virtual : BomeBox: MIDIHUB-2 [2]         [132:10] <->
          Bome Network Virtual : BomeBox: MIDIHUB-2 [3]         [132:11] <->
          Bome Network Virtual : BomeBox: MIDIHUB-2 [4]         [132:12] <->
          Bome Network Virtual : BomeBox: WIDI Bud Pro          [132:13] <->
          Midi Through         : Port-0                         [ 14:0] <->
          rtp-zyn1             : out-zyn1                       [130:0] <->
          rtp-zyn2             : out-zyn2                       [131:0] <->
      Connections:
          Bome Network Virtual:player: T-1 [132:2] --> Bome Network Virtual:BomeBox: MIDIHUB-2 [1] [132:9]
          Midi Through:Port-0 [14:0] --> rtp-zyn1:out-zyn1 [130:0]
    
  • aconnect -l for system view:

      client 0: 'System' [type=kernel]
          0 'Timer           '
      	Connecting To: 146:0
          1 'Announce        '
      	Connecting To: 128:0, 129:0, 146:0, 133:0
      client 14: 'Midi Through' [type=kernel]
          0 'Midi Through Port-0'
      	Connecting To: 129:0[real:0], 130:0
      	Connected From: 129:0
      client 130: 'rtp-zyn1' [type=user,pid=1209]
          0 'out-zyn1        '
      	Connecting To: 129:0[real:0]
      	Connected From: 129:0, 14:0
      client 131: 'rtp-zyn2' [type=user,pid=1210]
          0 'out-zyn2        '
      	Connecting To: 129:0[real:0]
      	Connected From: 129:0
      client 132: 'Bome Network Virtual' [type=user,pid=1564]
          0 'player          '
      	Connecting To: 129:0[real:0]
      	Connected From: 129:0
          1 'player: Arturia BeatStep Pro 1'
      	Connecting To: 129:0[real:0]
      	Connected From: 129:0
          2 'player: T-1     '
      	Connecting To: 129:0[real:0], 132:9
      	Connected From: 129:0
          3 'BomeBox         '
      	Connecting To: 129:0[real:0]
      	Connected From: 129:0
          4 'BomeBox: CME UF '
      	Connecting To: 129:0[real:0]
      	Connected From: 129:0
          5 'BomeBox: MIDIHUB-1 [1]'
      	Connecting To: 129:0[real:0]
      	Connected From: 129:0
          6 'BomeBox: MIDIHUB-1 [2]'
      	Connecting To: 129:0[real:0]
      	Connected From: 129:0
          7 'BomeBox: MIDIHUB-1 [3]'
      	Connecting To: 129:0[real:0]
      	Connected From: 129:0
          8 'BomeBox: MIDIHUB-1 [4]'
      	Connecting To: 129:0[real:0]
      	Connected From: 129:0
          9 'BomeBox: MIDIHUB-2 [1]'
      	Connecting To: 129:0[real:0]
      	Connected From: 129:0, 132:2
         10 'BomeBox: MIDIHUB-2 [2]'
      	Connecting To: 129:0[real:0]
      	Connected From: 129:0
         11 'BomeBox: MIDIHUB-2 [3]'
      	Connecting To: 129:0[real:0]
      	Connected From: 129:0
         12 'BomeBox: MIDIHUB-2 [4]'
      	Connecting To: 129:0[real:0]
      	Connected From: 129:0
         13 'BomeBox: WIDI Bud Pro'
      	Connecting To: 129:0[real:0]
      	Connected From: 129:0
      client 146: 'PipeWire-System' [type=user,pid=1379]
          0 'input           '
      	Connected From: 0:1, 0:0
      client 147: 'PipeWire-RT-Event' [type=user,pid=1379]
          0 'input  
    

Workarounds

  • Use numeric clientID:portID:

    midiwala connect 132:2 132:9
    midiwala disconnect 132:2 132:9
    
  • Or convert human-readable names to IDs in caller code before invoking midiwala.

Hypothesis / Possible Fix

  • The name parser likely splits on the first colon to get client vs port. When the port contains an additional colon (e.g., player: T-1), the parser rejects it.

  • Potential fixes:

    • Parse from the right (split on the last :): client = left, port = right remainder.
    • Use a regex like ^(?P<client>[^:]+):(?P<port>.+)$ (trim spaces) to allow colons inside the port name.
    • As a stopgap, document the limitation and recommend ID form; but ideally the name-based form should work since midiwala itself presents names with embedded colons.

Happy to provide full midiwala -l output and exact versions if needed, and to test a patched build.

**Description** When using `midiwala connect|disconnect` with **quoted** `client:port` names that themselves contain an extra colon in the **port** part (e.g. `player: T-1`), the CLI returns `malformed address …`. Using numeric `clientID:portID` works, so this appears to be a parsing limitation in the name-based address path. **Environment** * Device: Raspberry Pi 5 * OS: Patchbox OS (ALSA with PipeWire present) * `midiwala`/`midiminder` version: *(can supply exact version if needed)* * Context: RTP-MIDI + Bome Network : over net connected [BomeBox](https://www.bome.com/products/bomebox) with USB hub and two Blokas MidiHub and others midi stuf. Player is PC with Bome Network and connected Torso T-1 and Arturia BeatStep Pro sequencers. * Date observed: 2025-11-03 **Steps to Reproduce** 1. List ports (note the extra colon in the **port** part of some names): ```bash $ midiwala list --ports --plain Bome Network Virtual:player Bome Network Virtual:player: Arturia BeatStep Pro 1 Bome Network Virtual:player: T-1 Bome Network Virtual:BomeBox Bome Network Virtual:BomeBox: CME UF Bome Network Virtual:BomeBox: MIDIHUB-1 [1] Bome Network Virtual:BomeBox: MIDIHUB-1 [2] Bome Network Virtual:BomeBox: MIDIHUB-1 [3] Bome Network Virtual:BomeBox: MIDIHUB-1 [4] Bome Network Virtual:BomeBox: MIDIHUB-2 [1] Bome Network Virtual:BomeBox: MIDIHUB-2 [2] Bome Network Virtual:BomeBox: MIDIHUB-2 [3] Bome Network Virtual:BomeBox: MIDIHUB-2 [4] Bome Network Virtual:BomeBox: WIDI Bud Pro Midi Through:Port-0 rtp-zyn1:out-zyn1 rtp-zyn2:out-zyn2 ``` 2. **Name-based connect** where the port name contains an extra colon → **fails**: ```bash $ midiwala connect "Bome Network Virtual:player: T-1" "Bome Network Virtual:BomeBox: MIDIHUB-2 [1]" malformed address 'Bome Network Virtual:player: T-1' ``` 3. **Name-based connect** where neither side contains an extra colon inside the port name → **works**: ```bash $ midiwala connect "Midi Through:Port-0" "rtp-zyn1:out-zyn1" Connected Midi Through:Port-0 [14:0] --> rtp-zyn1:out-zyn1 [130:0] ``` 4. **ID-based connect** for the same “failing” pair → **works**: ```bash # player: T-1 → 132:2 # BomeBox: MIDIHUB-2 [1] → 132:9 $ midiwala connect 132:2 132:9 $ midiwala disconnect 132:2 132:9 ``` **Actual Behavior** * Name-based call (with quotes) errors out when the **port** contains an additional colon: ``` malformed address 'Bome Network Virtual:player: T-1' ``` * The same endpoints work via IDs. * Name-based calls without extra colons in the port (e.g., `Midi Through:Port-0` → `rtp-zyn1:out-zyn1`) work fine. **Expected Behavior** * Name-based addresses should accept port names containing `:` (since `midiwala -l` and `list --ports --plain` present such names) and resolve them to `clientID:portID` internally. **Additional Diagnostics / Context** * `midiwala -l` : ```bash Ports: Bome Network Virtual : player [132:0] <-> Bome Network Virtual : player: Arturia BeatStep Pro 1 [132:1] <-> Bome Network Virtual : player: T-1 [132:2] <-> Bome Network Virtual : BomeBox [132:3] <-> Bome Network Virtual : BomeBox: CME UF [132:4] <-> Bome Network Virtual : BomeBox: MIDIHUB-1 [1] [132:5] <-> Bome Network Virtual : BomeBox: MIDIHUB-1 [2] [132:6] <-> Bome Network Virtual : BomeBox: MIDIHUB-1 [3] [132:7] <-> Bome Network Virtual : BomeBox: MIDIHUB-1 [4] [132:8] <-> Bome Network Virtual : BomeBox: MIDIHUB-2 [1] [132:9] <-> Bome Network Virtual : BomeBox: MIDIHUB-2 [2] [132:10] <-> Bome Network Virtual : BomeBox: MIDIHUB-2 [3] [132:11] <-> Bome Network Virtual : BomeBox: MIDIHUB-2 [4] [132:12] <-> Bome Network Virtual : BomeBox: WIDI Bud Pro [132:13] <-> Midi Through : Port-0 [ 14:0] <-> rtp-zyn1 : out-zyn1 [130:0] <-> rtp-zyn2 : out-zyn2 [131:0] <-> Connections: Bome Network Virtual:player: T-1 [132:2] --> Bome Network Virtual:BomeBox: MIDIHUB-2 [1] [132:9] Midi Through:Port-0 [14:0] --> rtp-zyn1:out-zyn1 [130:0] ``` * `aconnect -l` for system view: ```bash client 0: 'System' [type=kernel] 0 'Timer ' Connecting To: 146:0 1 'Announce ' Connecting To: 128:0, 129:0, 146:0, 133:0 client 14: 'Midi Through' [type=kernel] 0 'Midi Through Port-0' Connecting To: 129:0[real:0], 130:0 Connected From: 129:0 client 130: 'rtp-zyn1' [type=user,pid=1209] 0 'out-zyn1 ' Connecting To: 129:0[real:0] Connected From: 129:0, 14:0 client 131: 'rtp-zyn2' [type=user,pid=1210] 0 'out-zyn2 ' Connecting To: 129:0[real:0] Connected From: 129:0 client 132: 'Bome Network Virtual' [type=user,pid=1564] 0 'player ' Connecting To: 129:0[real:0] Connected From: 129:0 1 'player: Arturia BeatStep Pro 1' Connecting To: 129:0[real:0] Connected From: 129:0 2 'player: T-1 ' Connecting To: 129:0[real:0], 132:9 Connected From: 129:0 3 'BomeBox ' Connecting To: 129:0[real:0] Connected From: 129:0 4 'BomeBox: CME UF ' Connecting To: 129:0[real:0] Connected From: 129:0 5 'BomeBox: MIDIHUB-1 [1]' Connecting To: 129:0[real:0] Connected From: 129:0 6 'BomeBox: MIDIHUB-1 [2]' Connecting To: 129:0[real:0] Connected From: 129:0 7 'BomeBox: MIDIHUB-1 [3]' Connecting To: 129:0[real:0] Connected From: 129:0 8 'BomeBox: MIDIHUB-1 [4]' Connecting To: 129:0[real:0] Connected From: 129:0 9 'BomeBox: MIDIHUB-2 [1]' Connecting To: 129:0[real:0] Connected From: 129:0, 132:2 10 'BomeBox: MIDIHUB-2 [2]' Connecting To: 129:0[real:0] Connected From: 129:0 11 'BomeBox: MIDIHUB-2 [3]' Connecting To: 129:0[real:0] Connected From: 129:0 12 'BomeBox: MIDIHUB-2 [4]' Connecting To: 129:0[real:0] Connected From: 129:0 13 'BomeBox: WIDI Bud Pro' Connecting To: 129:0[real:0] Connected From: 129:0 client 146: 'PipeWire-System' [type=user,pid=1379] 0 'input ' Connected From: 0:1, 0:0 client 147: 'PipeWire-RT-Event' [type=user,pid=1379] 0 'input ``` **Workarounds** * Use numeric `clientID:portID`: ```bash midiwala connect 132:2 132:9 midiwala disconnect 132:2 132:9 ``` * Or convert human-readable names to IDs in caller code before invoking `midiwala`. **Hypothesis / Possible Fix** * The name parser likely splits on the **first** colon to get `client` vs `port`. When the **port** contains an additional colon (e.g., `player: T-1`), the parser rejects it. * Potential fixes: * Parse from the **right** (split on the last `:`): `client = left`, `port = right remainder`. * Use a regex like `^(?P<client>[^:]+):(?P<port>.+)$` (trim spaces) to allow colons inside the port name. * As a stopgap, document the limitation and recommend ID form; but ideally the name-based form should work since `midiwala` itself presents names with embedded colons. Happy to provide full `midiwala -l` output and exact versions if needed, and to test a patched build.
Owner

Ugh - I'm so sorry I didn't realize this ages ago.

The current design rejects address like

one:two:three

because it seemed to me ambiguous which side the extra colon belonged to. Instead, the parser offers the ability to quote either client or port (or both), so you can have:

"one:two":three
one:"two:three"

or even

'one:two':'three:four'

I'm assuming this will work just fine in your case.

BUT

I think the real bug here is that midiwala doesn't show such clients or ports with quotes around them. I'll fix that.

Ugh - I'm so sorry I didn't realize this ages ago. The current design rejects address like one:two:three because it seemed to me ambiguous which side the extra colon belonged to. Instead, the parser offers the ability to quote either client or port (or both), so you can have: "one:two":three one:"two:three" or even 'one:two':'three:four' I'm assuming this will work just fine in your case. **BUT** I think the real bug here is that `midiwala` doesn't show such clients or ports with quotes around them. I'll fix that.
Owner

On reflection, I don't think that display should insert quotes if there is a colon in either the client or the port part. Quotes are used in address specifications (both in rule files and on the command line) to mean exact match.

Because of midiminder/midiwala's partial match feature, there is no need to use the unwieldy port names that Bome generates. You can easily identify clients and ports by any unique smaller string:

$ midiwala connect "Bome Network Virtual:T-1" "Bome Network Virtual:MIDIHUB-2 [1]"

or even

$ midiwala connect Bome:T-1 "Bome:MIDIHUB-2 [1]"

These work.

It is also the case that quoting the port will work... but remember that the outer-most set of quote on a shell command line belong to the shell, and don't reach midiwala:

$ midiwala connect "Bome Network Virtual:'player: T-1'" "Bome Network Virtual:'BomeBox: MIDIHUB-2 [1]'"

This works, but is admittedly annoying to type. Thankfully, the above abbreviated forms work fine.

On reflection, I don't think that display should insert quotes if there is a colon in either the client or the port part. Quotes are used in address specifications (both in rule files and on the command line) to mean exact match. Because of midiminder/midiwala's partial match feature, there is no need to use the unwieldy port names that Bome generates. You can easily identify clients and ports by any unique smaller string: ``` $ midiwala connect "Bome Network Virtual:T-1" "Bome Network Virtual:MIDIHUB-2 [1]" ``` or even ``` $ midiwala connect Bome:T-1 "Bome:MIDIHUB-2 [1]" ``` These work. It is also the case that quoting the port will work... but remember that the outer-most set of quote on a shell command line belong to the shell, and don't reach midiwala: ``` $ midiwala connect "Bome Network Virtual:'player: T-1'" "Bome Network Virtual:'BomeBox: MIDIHUB-2 [1]'" ``` This works, but is admittedly annoying to type. Thankfully, the above abbreviated forms work fine.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: mark/midiminder#23
No description provided.