Wrong source port returned in ALSA sequencer event callback (using Qjackctl)
Environment
- Ubuntu 22.04 Linux 5.15.0-33-lowlatency #34 (closed)-Ubuntu SMP PREEMPT Wed May 18 15:38:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
- PW Installed as instructions here
- Qjackctl Version: 0.9.6, Using: Qt 5.15.3
Compiled with libpipewire 0.3.48
Linked with libpipewire 0.3.48
Application name: (null)
Program name: pw
Host name: H3
Client name: pw
Domain: pipewire
Description of Problem:
In ALSA sequencer event callback the call to snd_seq_event_input(seq, &ev); returns Pirewire-RT-Source port instead of actual the application source port using QjackCtl, as such the client is unable the correct source.
The ALSA call returns the correct application port when using aconnect or aconnectgui anonth other or when using the ALSA API call to connect the two ports.
Occurs on any capture device port (software or MIDI hardware)
Details:
Reproducabililty:
Hard (100%)
Steps to Reproduce:
- Install QjackCtl
- Install PW
- Install virtual keyboard, VPMK or anything similar upon lack of MIDI hardware devices
- Start Qjackctl
- Connect the source ( capture port) to the client (playback) port using the QjackCtrl graph
Actual Results:
ev contains the PW port as source for any MIDI capture port that is connected to the playback port The client app does not recognize the (correct) source port
Expected Results:
ev contains the application port as source The client app recognizes the correct source port
Justifications
A. This issue could be challenged by "Why would you use QjackCtrl to connect the ports", as Qjack if for JACK, not ALSA use
Because QjackCtrl is more readibly accessible to use than aconnect and it exists, so it may be used.
B. Why in pipewire issue list ?
Because this does not happen when not using pipewire
Additional Info (as attachments):
client 0: 'System' [type=kernel]
0 'Timer '
Connecting To: 144:0
1 'Announce '
Connecting To: 144:0
client 14: 'Midi Through' [type=kernel]
0 'Midi Through Port-0'
client 128: 'Virtual Keyboard' [type=user,pid=25030]
0 'Virtual Keyboard'
client 144: 'PipeWire-System' [type=user,pid=2007]
0 'input '
Connected From: 0:1, 0:0
client 145: 'PipeWire-RT-Event' [type=user,pid=2007]
0 'input
Questions
What are the Pipewire-System and Pipe-Wire-RT-Event used for ?
Root Cause analysis
To best effort and knowledge tried to root out bugs in the client application (custom coded). The client application is exactly (binary) the same when using aconnect or Qjackctl. The call to ALSA just returns a different ports in these two scenario's.
How this issue was found
Due to a bug in the callback that causes a Segmentation error occured when the source port was not one of the MIDI ports (outside of the PW ports which are not MIDI hardware or MIDI application ports)