Bugzilla – Bug 777
Squeezebox pitch change does not work correctly for pcm streams
Last modified: 2008-08-18 10:53:01 UTC
The current code for sendPitch does not use the correct reference frequency for pcm streams leading to Squeezebox playing too fast when set to 100% pitch. The following should fix this: --- ../../../slimserver-20041216nightly/Slim/Player/Squeezebox.pm 2004- 12-16 22:14:49.000000000 +0000 +++ Squeezebox.pm 2005-01-08 13:12:21.334415101 +0000 @@ -612,18 +612,24 @@ my $pitch = shift; my $pause = shift; - my $freq = int(18432 / ($pitch / 100)); - my $freqHex = sprintf('%05X', $freq); - $::d_control && msg("Pitch frequency set to $freq ($freqHex), pause: $pause\n"); - if ($client->streamformat()) { if ($client->streamformat() eq 'mp3') { + my $freq = int(18432 / ($pitch / 100)); + #my $freq = 18432 + ($pitch - 100); # alternative for small variation to synch with dac + my $freqHex = sprintf('%05X', $freq); + $::d_control && msg("Pitch frequency set to $freq ($freqHex), pause: $pause\n"); + $client->i2c( Slim::Hardware::mas35x9::masWrite ('OfreqControl', $freqHex). Slim::Hardware::mas35x9::masWrite ('OutClkConfig', '00001'). Slim::Hardware::mas35x9::masWrite ('IOControlMain', '00015') # MP3 ); } else { + my $freq = int(20062 / ($pitch / 100)); + #my $freq = 20062 + ($pitch - 100); # alternative for small variation to synch with dac + my $freqHex = sprintf('%05X', $freq); + $::d_control && msg("Pitch frequency set to $freq ($freqHex), pause: $pause\n"); + if ($pause && ($client->playmode() =~ /^play/)) { if (Slim::Utils::Timers::killTimers($client, \&resume) == 0) { $client->pause();
Created attachment 253 [details] patch for pitch fault Previous patch attached in more readable format (now I know how to do it!)
Triode: can you apply this patch?
Sean seems to think that this isn't reallly solvable. Triode: If your patch makes things better, than I'm fine with it (post-6.0). Reopen the bug in that case. otherwise, let's just leave it.
Removed PCM pitch change code in svn 2866 to avoid user problems caused by using pitch change while playing in pcm mode. [Whenever in pcm mode, now stream at reference frequency set by firmware.]