automatically attempt to use ALSA plughw devices if unable to open hw device

Bug #1475420 reported by Be
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Confirmed
Wishlist
Unassigned

Bug Description

Users often run into errors with PortAudio being unable to open their sound card because the sample rate is not supported. The workaround for this is to set the PA_ALSA_PLUGHW environment variable to 1 before starting Mixxx. It would be helpful if users did not have to do this and this was handled automatically. Should this be changed in Mixxx or upstream in PortAudio?

Be (be.ing)
description: updated
RJ Skerry-Ryan (rryan)
Changed in mixxx:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Daniel Schürmann (daschuer) wrote :

Since PA_ALSA_PLUGHW is an Portaudio flag, it is up to Mixxx to set it.

But we need to careful consider when Mixxx should set this flag. I think it should be the last resort, since it adds another re-sampling stage to the audio processing chain.

Every resample stage adds noise to the stream, since it tries to predict the voltage level between to samples.

If you set Mixxx to a native soundcard sample rate it is able to process the Audio with only one resampling stage. We pass the samples with the source sample rate to the Enginebuffer and re-sample it in one step to the output sample rate, including all scratching and pitch shifting:
https://github.com/mixxxdj/mixxx/blob/752b3cc3f64c3597b78a5818b3533a1ec82d5f26/src/engine/enginebuffer.cpp#L981

The only case I can think of that requires an additional re-sampling is if two soundcards have no common native sample-rates.
But I have not heard of a sound-card that does not support 48 Khz. Is there any?

If yes, Mixxx may detect it and guide the user to the best set up.

Revision history for this message
Be (be.ing) wrote :

Sorry for the confusion, this is typically needed when the sample format is not supported, not the sample rate.

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

normally Portfolio should convert the sample format for us. that is why we directly pass the Mixxx engines floats (CSAMPLE) to PA. I do not know a single soundboard that has a float DAC so there will be always a 24 or 16 bit integer conversion.

So the remaining question Is: when does it fail. Should we move the integer conversion back to mix?

Revision history for this message
Be (be.ing) wrote :

Perhaps this should be implemented in PortAudio rather than Mixxx.

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/8159

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.