Open Kamol81 opened 7 years ago
Nothing that I had planned, but I'll keep it around for consideration. Although, since you can't enforce a mono feed to the two speakers, I would advice against this setup to be honest :) A lot of tracks have clear audible differences between the channels, and it will sound odd, at best.
I am looking at this due to that I am using my Connect:AMP as a two zone setup feeding left and right to different areas of my outdoor speakers.
It's in theory pretty simple to do as the only thing that has to be done is use the same volume function, but adding in channel LF/RF instead of Master like it is now hardcoded to.
@jishi What would the best way to do this in a way you're willing to accept a pull request? And without having to re-write all the other functions.
Most of the logic resides in sonos-discovery/lib/models/Player.js and sonos-discovery/lib/helpers/soap.js for the UPNP templates
I am considering adding a default variable called channel that's defaulted to "Master"
Player.prototype.setVolume = function setVolume(level, channel) {
if (data.volume) {
let master = data.volume.find(x => x.channel === 'Master');
const previousVolume = state.volume;
state.volume = parseInt(master.val);
_this.emit('volume-change', {
previousVolume,
newVolume: state.volume,
roomName: _this.roomName
});
_this.system.emit('volume-change', {
uuid: _this.uuid,
previousVolume,
newVolume: state.volume,
roomName: _this.roomName
});
_this.coordinator.recalculateGroupVolume();
}
@Lockzi We need to figure out if you only need to adjust LF/RF when setting balance (meaning, subsequent Master adjustments would obey the previous balance). This must surely be how it handles it.
Then it makes more sense to have some sort of balance()
function that hides the fact that Sonos internally uses different Left/Right volume for balance.
@jishi
I've found this: https://github.com/chregu/fhem-sonos/blob/b6a97be8015b70644d71d74bf8224dcb20833a75/FHEM/00_SONOS.pm#L1207
What do you think about this section?
Seems weird that one channel would ever be >100... but having some sort of balance() that takes -100 to 100 or 0-100 or -50 to 50 or something would make sense.
The reason is simply because of his slider function which looks like this: https://github.com/chregu/fhem-sonos/blob/master/FHEM/00_SONOS.pm#L932
FYI
I have a working solution based on:
Balance:
0<----------50----->100
LF100 LF100 LF0
LR0 RF100 RF100
http://localhost:5005/{roomName}/balance/50 sets LF = 100 RF = 100
http://localhost:5005/{roomName}/balance/75 sets LF = 50 RF = 100
http://localhost:5005/{roomName}/balance/33 sets LF = 100 RF = 66
Will push both sonos-discovery as well as http-api tomorrow with your permission Jishi
Feel free to send PRs!
PR in place :) 👍
It needs update to both HTTP API as well as Discovery
Is it working? How to check it out?
Please help - How to turn it on?
Did this ever get implemented?
It works only in FHEM
Hi Is it possible to add settings for using the balance adjustment . One of my sonos is connected be wire to only one celling speaker in bathroom and I'd like to make "another zone" somewhere else but it would be excellent to choose them separately.