-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't imply that multiple drivers have errors #2168
Don't imply that multiple drivers have errors #2168
Conversation
Do you think we can remove the ambiguity in the first part of the message? The driver(s) in question my in fact be perfectly usable, it's just that there is a problem with them that may or may not be temporary. So if only one driver is erroring, just present this error message with an option to open the settings: If multiple drivers are erroring, try to let the errors speak for themselves: In general, long dialogue messages tend not to get read though. I find that had to accept, and don't really know why it is, but it's a very observable and common thing. So the other approach might be not to show the errors themselves and instead just have a call to action to open the settings? Depends on how helpful the messages are I guess: |
I like the first two. In the second, I'd add "If needed" at the start of the guidance - as it lists where the errors were, it may be that nothing needs be done. If the pop up does need attention - i.e. no audio device is available - that needs to be clear, I don't like the third one because it's far too vague to decide what to do. "Maybe something is wrong with one of your sound devices but I'm not going to tell you which one or what the problem was." Thanks.... And is it "sound" or "audio"? |
@pljones Ah yes the last one doesn't indicate which card has the fail. OK that's no good then :-) BTW why "if needed"? Seems redundant. Or implies you may not want to fix the fact that Jamulus doesn't work for you?
We now have https://jamulus.io/contribute/Style-and-Tone ! Which says... "Sound hardware" I think. |
Because you list drivers that failed. If I'm not using those drivers, why would I want to correct them? The
makes it sound like it should be looked at and may be fixable. It's better to make it clear the user needs to decide what steps to take: we're not telling them to fix it - just that something went wrong that could need fixing. You could add "if applicable", if you prefer :). Oh yes, meant to add: if you want a shorter pop-up, add a "Details..." to pop up another dialog with the list of cards and errors (if there's more than one). And finally... The first line and last line usually get read -- to answer "What is this?" (first line) and "What do I need to do about it?" (last line). The bit in between is noise... (Hence the "Details..." button when needed.) |
Oh I see - in "plural" errors case, "If needed... " would be clearer there but it still seems odd in the "singular" error case to me. Agree about the first and last line prominence. Generally though, popups that spawn popups are seen as a bad thing as you can lose track or the parent or child if you accidentally click on something (and I think it's a bit of a mare for those using assistive tech). Also don't forget the ASIO settings is yet another "popop" in this context. But I guess if there's more than about three error messages it might be OK (the best solution would be an expandable panel within the dialogue but I assume that's not going to be possible).
I disagree. The sense is that there may or may not be issues to fix, and our lack of specificity clues this as well. Any other wording will be unacceptably long and complicated and we'll be back where we started. |
src/soundbase.cpp
Outdated
@@ -166,30 +166,38 @@ QString CSoundBase::SetDev ( const QString strDevName ) | |||
if ( !vsErrorList.isEmpty() ) | |||
{ | |||
// create error message with all details | |||
QString sErrorMessage = "<b>" + QString ( tr ( "No usable %1 audio device found." ) ).arg ( strSystemDriverTechniqueName ) + "</b><br>"; | |||
QString sErrorMessage = "<b>"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just declare it here - the floating "<b>"
makes the code hard to follow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Still struggeling with the syntax though.
src/soundbase.cpp
Outdated
} | ||
else | ||
{ | ||
sErrorMessage += "<b>" + GetDeviceName ( 0 ) + "</b>: " + vsErrorList[0] ; | ||
sErrorMessage += tr ( "Couldn't initialize audio driver (using %1)</b><br>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 173:
"Sound driver errors (using %1) found:</b><br>"
Line 184:
"Couldn't initialize audio driver (using %1)</b><br>"
Use the same string in both places. Ideally the less technical one. The first doesn't need to end with ":" as it no longer introduces a list.
Maybe
"Could not find a sound driver (using %1) that could be used.</b><br>"
(and do away entirely with "Your sound device is not compatible in its current state."
as it would then be somewhat redundant).
And then the if
checking the number of errors (more than 1 or not) is irrelevant, too.
src/soundbase.cpp
Outdated
#ifdef _WIN32 | ||
// to be able to access the ASIO driver setup for changing, e.g., the sample rate, we | ||
// offer the user under Windows that we open the driver setups of all registered | ||
// ASIO drivers | ||
sErrorMessage += "<br/>" + tr ( "You might be able to fix this error by changing settings of your ASIO driver. Do you want to open these settings now?" ); | ||
sErrorMessage += "<br/>" + tr ( "You may be able to fix errors in the driver settings." ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems worthless - i.e. adding extra words to an already lengthy message that don't help the user. They're offered the option to Open ASIO settings
if they want, which should be enough. Maybe add "What's this" help to it.
And has inconsistent use of <br/>
vs <br>
elsewhere.
@@ -166,30 +166,38 @@ QString CSoundBase::SetDev ( const QString strDevName ) | |||
if ( !vsErrorList.isEmpty() ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 154 to 165 are irrelevant if this we enter this if
. They should be placed after the block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might the problem be that this code is run once at startup and also during runtime if someone changes the sound devices?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before line 197 was introduced, the variable set there wasn't referenced until after this if block. However, now line 197 is there, it makes sense.
|
||
if ( QMessageBox::Yes == QMessageBox::information ( nullptr, APP_NAME, sErrorMessage, QMessageBox::Yes | QMessageBox::No ) ) | ||
if ( mbWinErrorBox.clickedButton() == btnASIOSettings ) | ||
{ | ||
LoadAndInitializeFirstValidDriver ( true ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vsErrorList = LoadAndInitializeFirstValidDriver ( true );
and then check the list size. If it's zero (and I've not checked the code to make sure I'm right here...), return strReturn
rather than continuing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's more work needed then just that. See the commit I mentioned: Probably it's in a deeper level.
src/soundbase.cpp
Outdated
if ( vsErrorList.isEmpty() ) { | ||
return strReturn; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned before, I think this is not enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like it's what's needed and removes my concern at https://github.com/jamulussoftware/jamulus/pull/2168/files#r770944946
src/soundbase.cpp
Outdated
QMessageBox qmASIOWarningBox; | ||
QPushButton *btnASIOSettings = qmASIOWarningBox.addButton ( tr ( "Open ASIO settings" ), QMessageBox::AcceptRole ); | ||
|
||
qmASIOWarningBox.addButton ( QMessageBox::Cancel ); | ||
qmASIOWarningBox.setText ( sErrorMessage ); | ||
qmASIOWarningBox.setIcon ( QMessageBox::Warning ); | ||
qmASIOWarningBox.exec(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably this can be simplified somehow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's a constructor that allows most of those things to be set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think/thought so too. However I couldn't find it in the documentation (or the code gave an error). The problem was with adding a "custom" button.
src/soundbase.cpp
Outdated
@@ -166,24 +166,35 @@ QString CSoundBase::SetDev ( const QString strDevName ) | |||
if ( !vsErrorList.isEmpty() ) | |||
{ | |||
// create error message with all details | |||
QString sErrorMessage = "<b>" + QString ( tr ( "No usable %1 audio device found." ) ).arg ( strSystemDriverTechniqueName ) + | |||
"</b><br><br>" + tr ( "These are all the available drivers with error messages:" ) + "<ul>"; | |||
QString sErrorMessage = tr ( "<b>Could not find compatible sound driver (using %1).</b><br><br>" ).arg ( strSystemDriverTechniqueName ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "... (using ASIO)." seems a bit confusing here as it implies a driver might be found using something else. Is there a reason we're saying this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It won't necessarily say "ASIO" - it provides meaningful information for diagnosing a problem preventing the use of the program.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, but we have a button that says "Open ASIO settings", so is that button conditional on what %1
is? This PR is to help people who aren't technical deal with the problem. If we qualify an error message in this way, they'd be excused for wondering why it's qualified, should they be using something else, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, see line 203 (new). The button only appear on Windows but this string is always used. (The button should also only appear for ASIO -- that needs fixing.)
The whole flow is really bad, I think - huge block of platform-specific code at level that should be platform-independent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think "Could not find compatible sound driver (using ASIO)" feels a bit odd. Like it's expecting them to switch to something that isn't ASIO where the problem might not arise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be less mysterious to just make it the subject in that case and say, "Could not find a compatible ASIO sound driver." That is, unless we want also to say "Maybe you should try using [other system]." which I doubt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe go back to No usable %1 audio device found.
then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That reads better than a parenthesised suffix (I think).
BTW re. "audio device", it's probably the subject of a different ticket, but for such an important thing we should keep to a standard term. The style guide says we should be using "sound hardware" here but "audio device" does feel a bit more conventional somehow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Fixed that.
The whole flow is really bad, I think - huge block of platform-specific code at level that should be platform-independent.
I'm a bit unsure, but I remember there was a discussion about fixing this. Wasn't @npostavs involved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess pljones' remark at #1378 (comment) is similar.
src/soundbase.cpp
Outdated
} | ||
sErrorMessage += "</ul>"; | ||
|
||
#ifdef _WIN32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this defined if we're running JACK on Windows? If so, it's the wrong symbol.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so. Similar to the ASIO Device setting button.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, probably needs a bug raised to fix it, then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Fixed this now.
Before approval, this PR should show behavour when:
This is needed to ensure it remains sane... |
I think it still throws an exception without returning. We‘d need some more debugging, but that would be out of scope of this PR. |
No longer sure if this is moving into the right direction. Probably the exception handling needs to be part of another PR. |
src/soundbase.cpp
Outdated
|
||
if ( qmASIOWarningBox.clickedButton() == btnASIOSettings ) | ||
{ | ||
vsErrorList = LoadAndInitializeFirstValidDriver ( true ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should revert this to the original state and do functional changes here later.
Related to #2238
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. This should be handled in another PR.
f9bff4f
to
a42fd50
Compare
a42fd50
to
b37732e
Compare
// TODO: This or some related code aborts the app even if the driver is valid after user changes. | ||
// This should be handled differently. For reference, please see https://github.com/jamulussoftware/jamulus/pull/2168 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pljones I wrote a TODO comment here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebased this PR.
Overall, far too much of the code appears to be trying to handle Windows-ASIO specific issues in |
If there's only one driver with an error message, there's no need to imply that multiple devices have errors. This change is done to simplify the error message.
3657809
to
fd7bfe6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the text part should be split out into another PR (and the addition of the open ASIO Settings button overthought again)
Split out from jamulussoftware#2168
Closing in favour of #2496 we should probably split this PR. |
Split out from jamulussoftware#2168
Split out from jamulussoftware#2168
Split out from jamulussoftware#2168
Split out from jamulussoftware#2168
Split out from jamulussoftware#2168
Split out from jamulussoftware#2168
Split out from jamulussoftware#2168
Short description of changes
If there's only one driver with an error message, there's no need to imply that multiple devices have errors. This change is done to simplify the error message.
The following is not exactly what my (fixed) code looks like.
Context: Fixes an issue?
Idea from #2163 (reply in thread)
Does this change need documentation? What needs to be documented and how?
No
Status of this Pull Request
Draft. It remains to test what happens if lNumDevs > 1.
What is missing until this pull request can be merged?
Untested since it's just a quick fix. Will test it by checking the artifacts.
Checklist