SW volume control improvement in case of DAC off-on or unplug-plug wout HW mixer#208
Open
csutihu wants to merge 2 commits into
Open
SW volume control improvement in case of DAC off-on or unplug-plug wout HW mixer#208csutihu wants to merge 2 commits into
csutihu wants to merge 2 commits into
Conversation
volumio
reviewed
Feb 19, 2025
| self.logger.error('Cannot set ALSA Volume: ' + err); | ||
| } | ||
| }); | ||
| var startupVolume = this.commandRouter.executeOnPlugin('audio_interface', 'alsa_controller', 'getConfigParam', 'volumestart'); |
Owner
There was a problem hiding this comment.
Ideally:
- You will use the function already there: self.setStartupVolume();
- Create a condition only for software volume, if volume none it should go to 100
Thanks for your contribution!
Author
There was a problem hiding this comment.
I try to fix it.
Prev version:
if (data.mixertype !== undefined && mixertype !== 'None' && mixer !== undefined && mixer.length && (data.mixertype === 'None' || data.mixertype === 'Software')) {
var startupVolume = this.commandRouter.executeOnPlugin('audio_interface', 'alsa_controller', 'getConfigParam', 'volumestart');
if (startupVolume !== 'disabled') {
self.setVolume(parseInt(startupVolume), function (err) {
if (err) {
self.logger.error('Cannot set ALSA Volume: ' + err);
}
});
} else {
self.setVolume(30, function (err) {
if (err) {
self.logger.error('Cannot set ALSA Volume: ' + err);
}
});
}
}
changed to:
if (data.mixertype !== undefined && mixertype !== 'None' && mixer !== undefined && mixer.length) {
if (data.mixertype === 'Software') {
setTimeout(() => {
self.setStartupVolume();
// self.logger.info('new mixertye handling - setstartupvolume');
}, 5000);
} else if (data.mixertype === 'None') {
self.setVolume(100, function (err) {
if (err) {
self.logger.error('Cannot set ALSA Volume: ' + err);
}
});
}
}
optimization of handling sw mixertype updateVolumeSettings
Author
|
I would like to kindly ask if any further modifications are needed from me? Thx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dear Developers,
Please review my pull request. I have made the following changes to the volumecontrol.js file:
Issue: Addressed an issue where volume control was not functioning correctly when a DAC was turned off and on, or unplugged and plugged back in, without a hardware mixer. (default volume level = 100%)
Solution: Implemented logic to ensure proper volume control functionality in these scenarios.
Testing: Thoroughly tested the changes by simulating DAC off/on and unplug/plug events, confirming that volume control now works as expected.
https://community.volumio.com/t/sw-mixer-volume-level-after-external-dac-off-on/71222