Jack ports - confusing numbering

Bug #839562 reported by Michael Z Freeman
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mixxx
Triaged
Low
Unassigned

Bug Description

Other Jack applications keep a consistent port numbering policy. This is usually from 1 upwards and matches both the internal application numbering of those ports and the numbering of those ports as they are shown in the QJackctl connections window. However Mixxx (1.9) numbers Jack ports from 1 upwards in it's preferences and shows the ports from 0 (zero) upwards in the JackQctl connections window. This is confusing.

There may also be a very similar issue with the numbering policy in Mixxx preferences. Ports are numbered 1/2, 2/3, 3/4 and so on. Should they be 1/2, 3/4, 5/6 ... ? There may be a reason for this in terms of Jack operation and port setup policy but I'm not sure.

Tags: jack
description: updated
William Good (bkgood)
Changed in mixxx:
assignee: nobody → Bill Good (bkgood)
Revision history for this message
William Good (bkgood) wrote :

I'm not sure how we're gonna fix this, PortAudio doesn't expose any functions to change port numbering with JACK (it only gives functions for changing the client name). Additionally, it seems that the counter used to number our jack ports isn't ever reset -- every time the jack connection is reopened, the numbers increase. This may require some work on the portaudio jack implementation.

> There may also be a very similar issue with the numbering policy in Mixxx preferences. Ports are numbered 1/2, 2/3, 3/4 and so on. Should they be 1/2, 3/4, 5/6 ... ? There may be a reason for this in terms of Jack operation and port setup policy but I'm not sure.

This is done to accommodate monaural devices. For instance you might have a 1 channel input (a mic for instance) at channel one and then a stereo input at channels 2 and 3. If the numbering wasn't done like this, you'd be unable to configure this setup.

Changed in mixxx:
importance: Undecided → Low
status: New → Confirmed
RJ Skerry-Ryan (rryan)
tags: added: jack
Revision history for this message
Gavin Pryke (gavinlee303) wrote :

May I suggest at least having an informative client name, something along the lines of:

Mixxx:Master_left
Mixxx:Master_right
Mixxx:Headphones_left
Mixxx:Headphones_right
Mixxx:Deck1_left
Mixxx:Deck1_right
Mixxx:Deck2_left
Mixxx:Deck2_right

At least then it would bring some sanity when trying to attach mixxx outputs to another jack application, at the moment it is very confusing to know what Mixxx:out_1 through to Mixxx:out_? does.

Also I've come across something just now by trying to attach mixxx to another jack application, I have only master and headphones outputs enabled in mixxx settings. When I have Master set as system and channels 1-2 and Headphones on system channels 3-4 I only have 4 output ports showing in qjackctl. When I enable Headphones as system channels 5-6 I get 6 output ports in qjackctl. How come there are an extra 2 ports? This is very confusing. Not sure if this should be filed as a separate bug.

Revision history for this message
William Good (bkgood) wrote :

> May I suggest at least having an informative client name, something along the lines of:

Unfortunately the client name is set per application -- so we can't have different client names for different streams in the same application.

> Also I've come across something just now by trying to attach mixxx to another jack application, I have only master and headphones outputs enabled in mixxx settings. When I have Master set as system and channels 1-2 and Headphones on system channels 3-4 I only have 4 output ports showing in qjackctl. When I enable Headphones as system channels 5-6 I get 6 output ports in qjackctl. How come there are an extra 2 ports? This is very confusing. Not sure if this should be filed as a separate bug.

Off the top of my head I believe we have to open all those ports/'channels' to get to the higher-named ones, but I'll look into it.

Regarding this bug as a whole, I'll try to see about getting a portaudio change in this holiday.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

This is somehow similar to Bug #1172299
Bill, do you have any status updates?

Revision history for this message
William Good (bkgood) wrote :

Nope. no change from PA.

But it appears I'm collecting a pile of JACK-related bugs, so hoping to devote some time to the whole mess in the near future.

Revision history for this message
Michael Z Freeman (michael-z-freeman) wrote :

I think I worked out an initial sane approach. The first thing to tackle (IMO) is making the port names in the drop down lists in the Mixxx Preferences for Jack match the names that are actually displayed by Jack. That way at least the user can refer back to Mixxx preferences to work out what the ports match to.

I think Mixxx needs to be clear on what it wants to do with Jack. Has this already been defined in some other document elsewhere ? Otherwise what is the proper place to submit this ? A blueprint ?

Revision history for this message
Daniel Schürmann (daschuer) wrote :

Yes, A blueprint is fine and if it becomes unhandy you could create a Wiki page on http://www.mixxx.org/wiki/doku.php/start and link it from the blueprint.

Revision history for this message
Michael Z Freeman (michael-z-freeman) wrote :

OK, thanks. I'll put one in when I have some time. Cheers :)

Revision history for this message
Stéphane Alnet (stephane-2) wrote :

Looks like naming issues have been on the PortAudio TODO list as well:
https://www.assembla.com/code/portaudio/subversion/nodes/1932/portaudio/trunk/src/hostapi/jack/pa_jack.c#ln1208

It looks like the `hostApiSpecificStreamInfo` field in `inputParameters`/`outpoutParameters` in the call to Pa_OpenStream() (which itself pass them down to jack's OpenStream()) are currently unused but they would be the proper place to do this.
https://www.assembla.com/code/portaudio/subversion/nodes/1932/portaudio/trunk/src/hostapi/jack/pa_jack.c#ln1124
https://www.assembla.com/code/portaudio/subversion/nodes/1932/portaudio/trunk/src/hostapi/jack/pa_jack.c#ln1148

I imagine the code changes would be to add the structure in include/pa_jack.h, and modify src/hostapi/jack/pa_jack.c to use it (and fallback to the current snprintf() calls). However I don't see how to open a PortAudio "ticket" to submit those changes.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

You may ask at the PortAudio mailing list
http://www.portaudio.com/contacts.html

Changed in mixxx:
status: Confirmed → In Progress
assignee: Bill Good (bkgood) → Daniel Schürmann (daschuer)
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Due to lack of progress, marking Triaged and clearing assignee. Feel free to revert if it is in fact still in progress :).

Changed in mixxx:
status: In Progress → Triaged
assignee: Daniel Schürmann (daschuer) → nobody
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/5979

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.