Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 3 of 3
  1. #1

    How does LMS lock the volume for players with digitalVolumeControl

    LMS has the ability to lock the volume at 100% for a player with digital out.

    I'd like to understand how this is achieved. I've looked through the sources on Github and found the corresponding preference is digitalVolumeControl which, when set to 0, locks the volume as described.

    I have, however, failed to understand how this is actually achieved. I've looked at all occurrences of digitalVolumeControl and I don't see how any of them would affect the ability to set the players's volume.

    I suspect the magic is done somewhere in

    Code:
    $prefs->setChange( sub { $_[2]->volume( $_[2]->volume ); }, 'digitalVolumeControl');
    (line 78 in Slim/Player/Player.pm) but apparently I don't know enough Perl to understand how it's done.

    Could anybody enlighten me?

  2. #2
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    17,749
    Quote Originally Posted by Manul View Post
    (line 78 in Slim/Player/Player.pm) but apparently I don't know enough Perl to understand how it's done.

    Could anybody enlighten me?
    It is used in the player specific module such as Squeezebox2.pm and Squeezeslave.pm where h/w specific actions can be taken.

    The setting is read and then packed into bytes which is then sent to the player as part of "audg" command.

    from Squeezeslave.pm which is the module for squeezelite
    Code:
    		my $data = pack('NNCCNN', $oldGain, $oldGain, $prefs->client($client)->get('digitalVolumeControl'), $preamp, $newGain, $newGain);
    		$client->sendFrame('audg', \$data);
    Best look at squeezelite source code to understand the meaning of slimproto command.

  3. #3
    Thanks, found it in the squeezelite source code. I wouldn't have thought this was handled on the client side.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •