Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Device-Priority-SMP (Read 5874 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Device-Priority-SMP

Reply #25
Sorry, I was testing with both your button and my button in the same skin.
Retested now with all JS3 buttons removed.

SITUATION 1:
Enable Auto-Device ON. Device 1 PSD, all others to None.
With SHIFT leftclick I can playback to external device. Switching off external device. Playback continues on PSB, No Popup and playback continues. All OK.
Switch external on again and switch to it with continuing playback.
Switch external off. Playback continues on Device 1 but I get the popup.

So only the first time switching the external off the popup is circumvented.

Re: Device-Priority-SMP

Reply #26
Sorry, I was testing with both your button and my button in the same skin.
Retested now with all JS3 buttons removed.

SITUATION 1:
Enable Auto-Device ON. Device 1 PSD, all others to None.
With SHIFT leftclick I can playback to external device. Switching off external device. Playback continues on PSB, No Popup and playback continues. All OK.
Switch external on again and switch to it with continuing playback.
Switch external off. Playback continues on Device 1 but I get the popup.

So only the first time switching the external off the popup is circumvented.
There is no such thing as only working once. I mean, it may be working sometimes and just a coincidence that it works for you the first time and not the second time.

I can test it turning it on/off 10 times, and works reliably everytime. But as I said it's also device dependent, and maybe also related to foobar version or whatever. For ex I only had 'Output invalidated' errors using ASIO, but using DS it worked fine without any additional fixes.

I have been cleaning the code a bit, and now the workaround for output invalidated may be tweaked. Clean the panel and install again (replacing this file). Now it will try first to switch to null device and also being faster should handle better the timing.
Spoiler (click to show/hide)

Re: Device-Priority-SMP

Reply #27
Deleted both buttons. Copied the new file to the correct folder after renaming original file. Added both buttons. Exited foobar. Restart foobar.

This time I also get the popup on the first time I switch off the external.
EDIT: And when I repeat the sequence I do not get the popup.

Re: Device-Priority-SMP

Reply #28
Post console with this file (just replace, no need for more), doing the same. Anyway, this would be fixed if you ask the foobar dev to switch to null output or primary device in case there is no device selected after turning off a device, by default.
Which would be the proper fix. Instead of me trying to add more hacks for that xd


Re: Device-Priority-SMP

Reply #30
Post console with this file (just replace, no need for more), doing the same. Anyway, this would be fixed if you ask the foobar dev to switch to null output or primary device in case there is no device selected after turning off a device, by default.
Which would be the proper fix. Instead of me trying to add more hacks for that xd
I couldn't agree more and actually was quite surprised when I saw this happening a couple of days ago hence my search for a fix/workaround.

Re: Device-Priority-SMP

Reply #31
Again, replace with this and test as usual. I'm assuming this is your config and that you have tried both null/prim device workarounds.

X

This one tries to set a null device every 25 ms if there is no device. If that doesn't work, then either change bluetooth device or report to foobar dev for proper fix. Can not do anything more.

Re: Device-Priority-SMP

Reply #32
Behavior is different with the last vertsion of your code. Popup is less frequent, but still there.

Let's leave it for the time being.

I'm first going to test with a second and newer BT JBL Charge 5, BT headphones, IP based external devices and on another computer with a different BT chipset.

Thanks for the effort.

Re: Device-Priority-SMP

Reply #33
This one adds a setting to tweak the workaround timing (which is now disabled by default). On line 363 you may lower the time it starts to apply after turning off a device, in case it still fails.

Re: Device-Priority-SMP

Reply #34
"devicePriority.properties.fixNoDevice[1] <= 10 ? 10 : 25);"

I don't understand the syntax.
What's the first 10, second 10 and the 25?
What do I change to lower the timings to let's say half? 5, 5, 12?

Re: Device-Priority-SMP

Reply #35
"devicePriority.properties.fixNoDevice[1] <= 10 ? 10 : 25);"

I don't understand the syntax.
What's the first 10, second 10 and the 25?
What do I change to lower the timings to let's say half? 5, 5, 12?
I'm sorry but i will not help with basic JS syntax, that's on your side. Look for ternary operator.

Re: Device-Priority-SMP

Reply #36
"devicePriority.properties.fixNoDevice[1] <= 10 ? 10 : 25);"

I don't understand the syntax.
What's the first 10, second 10 and the 25?
What do I change to lower the timings to let's say half? 5, 5, 12?
I'm sorry but i will not help with basic JS syntax, that's on your side. Look for ternary operator.
You helped. It's just shorthand for an if-then-else statement.

This one adds a setting to tweak the workaround timing (which is now disabled by default). On line 363 you may lower the time it starts to apply after turning off a device, in case it still fails.
How do I enable the workaround? Otherwise changing values is no use at all I guess.

I appreciate the time and effort you already put in this a lot, but your instructions are not clear and I'm not going to experiment with a line with 3 variables (the condition, the true part and the else part) not knowing if this code is actually active or not (since neither are logged to the console).
I'm also a bit confused that after you spend all this time already you don't want to share a couple of lines on explaining what the 3 parts do, and I can actually understand what I'm changing & testing.

Please tell me how to activate the workaround and what the values do. I'm not going all monkey and start changing 3 parameters in the blind.

BTW. Yesterday in the afternoon I already suggested it's probably a timing issue. Maybe I should have added that I have a rather fast machine.

Re: Device-Priority-SMP

Reply #37
On the settings menu, like everything else. I don't understand what's not clear, I even showed you a screenshot yesterday...

Re: Device-Priority-SMP

Reply #38
On the settings menu, like everything else. I don't understand what's not clear, I even showed you a screenshot yesterday...
Ah, your screenshot did not show the new settings therefore the confusion. I never saw the new options ...

Re: Device-Priority-SMP

Reply #39
Quote
This one adds a setting to tweak the workaround timing (which is now disabled by default). [...]
Well, if I say I added a new setting, obviously it was not there before xd Let me know if that option in aggressive or 10 ms helps somehow.

Re: Device-Priority-SMP

Reply #40
Quote
This one adds a setting to tweak the workaround timing (which is now disabled by default). [...]
Well, if I say I added a new setting, obviously it was not there before xd Let me know if that option in aggressive or 10 ms helps somehow.
I tested all combinations of "Output invalidated fix" set to "Null Output" / "Primary Sound Driver" with "Aggressive" / 10 / 25 / 50.
I did not change any values at line 363.
They all fail at some point or another to suppress the popup (half of the times or so). It's so erratic that I cannot even tell which combination of values work better.

I also tried this test FCL on a very old laptop (2010?), but that one definitely has bluetooth issues and also shows the popup when working.

I'm getting hold of a newer JBL Charge and some sets of BT headphones and will test those with the last version of your buttoncode.
I'll also test on my mediacenter and previous main system, both have different BT chipsets.

I'll keep you posted.

 

Re: Output priority and fallback

Reply #41
Thanks for the script! Maybe add the following tip to the README:

If foobar2000 is set to resume playback* the Please select valid output device dropdown window still appears. As soon as SMP initializes the fallback output device does become active... but the Preferences window that pops up and steals focus is annoying.

This can be fixed by right-clicking on the Spider Monkey panel, the context menu that will appear is labeled Toolbar configuration. Disable Other settings > Asynchronous loading (startup)

* Preferences > Playback > Other section > ☑ Save playback state when closing foobar2000 and resume on next startup