seanadams Wrote:
> If someone has the time it would be REALLY helpful to get verification
> that the new multiplier is correct. Make an AIFF that loops through a
> few hundred handom numbers, then play it on the old firmware and then
> on the new firmware with this patch. Record the s/pdif output and
> compare. I'd do it right now but I don't have the time just this
> moment. Thanks.
sbjaerum Wrote:
> I don't think it is that straight forward. I'm not sure if there is any
> volume setting that multiplies with the same number in the old and new
> firmware.
>
> The old firmware multiplies with a gain coefficient in 1.7 fixed-point
> format. The proposed patch multiplies with a gain that is effectively in
> 1.8 format.
>
> There is thus a need for a new patch of Squeezebox2.pm before such an
> experiment can be performed.
>
> Steinar
For verification of new vs. old firmware gain multiplication, I think
the below patch would be useful. With this patch the same gain
coefficient should be applied to the data both in old and new firmware.
However, the firmware implementation is different, and that is what
should be tested.
Unfortunately I have neither the equipment nor the time at the moment
to do this. Hopefully someone else have...
Steinar
Index: server/Slim/Player/Squeezebox2.pm
===================================================================
--- server/Slim/Player/Squeezebox2.pm (revision 4951)
+++ server/Slim/Player/Squeezebox2.pm (working copy)
@@ -272,7 +272,12 @@
# Map a floating point dB value to a 16.16 fixed point value
to
# send as a new style volume to SB2 (FW 22+).
my $floatmult = 10 ** ($db/20);
- return int(($floatmult * (1 << 16)) + 0.5);
+ if ($db >= -35 && $db <= 0) {
+ return int($floatmult * (1 << 8) + 0.5) * (1 << 8);
+ }
+ else {
+ return int(($floatmult * (1 << 16)) + 0.5);
+ }
}
sub volume {
@@ -286,17 +291,8 @@
# Old style volume:
my $oldGain = $volume_map[int($volume)];
- my $newGain;
- if ($volume == 0) {
- $newGain = 0;
- }
- else {
- # With new style volume, let's try -49.5dB as
the lowest
- # value.
- my $db = ($volume - 100)/2;
- $newGain = dBToFixed($db);
- }
-
+ my $newGain = $oldGain << 9;
+
my $data = pack('NNCCNN', $oldGain, $oldGain,
$client->prefGet("
digitalVolumeControl"), $preamp, $newGain, $newGain);
$client->sendFrame('audg', \$data);
}
--
sbjaerum
_______________________________________________
audiophiles mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/audiophiles