Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 8 123 ... LastLast
Results 1 to 10 of 73
  1. #1
    Senior Member
    Join Date
    Dec 2009
    Location
    Albinea (RE) Italy
    Posts
    735

    Disk and folder browsing

    Hi,


    During some code investigation about reproducing wav files in resolution greather than 44.100/16, I've found a bug in Squeezebox.pm that cause ANY Wav files, no matter the real sample frequency, to be reproduced at 44.100 Hz when selected from Disk and foldes browse (means is not scanned).

    Starting at line 961:

    # Don't do transitions if the sample rates of the two
    # songs differ. This avoids some unpleasant white
    # noise from (at least) the Squeezebox Touch when
    # using the analogue outputs. This might be bug#1884.
    if (!Slim::Player::ReplayGain->trackSampleRateMatch($master, -1)
    ||
    !Slim::Player::ReplayGain->trackSampleRateMatch($master, 1)) {
    main::INFOLOG && $log->info('Overriding transition due to differing sample rates');
    $transitionType = 0;
    }

    Slim::Player::ReplayGain->trackSampleRateMatch try to get the current, previous and next track from the playlist, but they are not 'track' in the db, so always return false...

    Probably i snot the only place where this could have some effect, but is the first i've found.

    I think is not a drama, and I'm not even sure I have to report a bug, but better know and maybe in some way advise users they could not play wav/Aiff files different from 16/44.1K that way.

    P.S.

    Not sure the above code works as was intended, if tracks are in the Database... player do switch sample rate...
    Last edited by marcoc1712; 2015-08-28 at 06:34.
    __________________________________________________ ______________________
    Author of C-3PO plugin, Squeezelite-R2, Falcon Web interface - See www.marcoc1712.it

  2. #2
    Senior Member Mnyb's Avatar
    Join Date
    Feb 2006
    Location
    Vństerňs Sweden
    Posts
    16,525
    http://bugs.slimdevices.com

    Yes the browse folders without scan is new to 7.9 it definitely needs some debugging .

    In 7.8 or older it always did a scan if it found new content.
    --------------------------------------------------------------------
    Main hifi: Rasbery PI digi+ MeridianG68J MeridianHD621 MeridianG98DH 2 x MeridianDSP5200 MeridianDSP5200HC 2 xMeridianDSP3100 +Rel Stadium 3 sub.
    Bedroom/Office: Boom
    Loggia: Raspi hifiberry dac + Adams
    Bathroom : Radio (with battery)
    iPad with iPengHD & SqueezePad
    (spares Touch, SB3, reciever ,controller )
    server Intel NUC Esxi VM Linux mint 18 LMS 7.9.2

    http://people.xiph.org/~xiphmont/demo/neil-young.html

  3. #3
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,326

    Disk and folder browsing

    > During some code investigation about reproducing wav files in resolution
    > greather than 44.100/16, I've found a bug in Squeezebox.pm that cause
    > ANY Wav files, no matter the real sample frequency, to be reproduced at
    > 44.100 Hz when selected from Disk and foldes browse (means is not
    > scanned).


    Could you please provide me with some (at least three, obviously) sample
    WAV files I could reproduce this with? You could upload them to my dropbox:

    https://www.dropbox.com/request/T3RctyzGgNg0oFDubq6a

    I don't think the code snippet you posted has anything to do with how a
    track is played back, though. It's about the transition (fading or not)
    only. But as mnyb said: the browse disk and folder feature has seen
    little testing. I wouldn't be surprised to find a bug there.

    --

    Michael

  4. #4
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,326
    Hmm... I can't reproduce that issue: I've found two tracks, one at 192kbps, the other at 96kbps. Here's what LMS would find in that trackSampleRateMatch() method:

    Code:
    [15-08-28 17:26:18.0108] Slim::Utils::Misc::msg (1233) Warning: [17:26:18.0099] (
      {
        album       => undef,
        artist      => undef,
        bitrate     => "9216kb/s CBR",
        coverid     => "-140548654438760",
        disc        => undef,
        genre       => undef,
        icon        => undef,
        replay_gain => undef,
        samplerate  => 192_000,
        secs        => "2:48",
        title       => "JSBachConcertoAminorFourHarp-Largo24-192",
        tracknum    => undef,
        type        => "wav",
        year        => 0,
      },
      {
        album       => undef,
        artist      => undef,
        bitrate     => "4608kb/s CBR",
        coverid     => "-140548649023016",
        disc        => undef,
        genre       => undef,
        icon        => undef,
        replay_gain => undef,
        samplerate  => 96_000,
        secs        => "2:48",
        title       => "JSBachConcertoAminorFourHarp-Largo",
        tracknum    => undef,
        type        => "wav",
        year        => 0,
      },
    ) at /Users/mh/Dropbox/Squeezebox/git/server/Slim/Player/ReplayGain.pm line 238.
    both report the correct sample rate. I'd really need step-by-step instructions how to reproduce your issue.
    Michael

    http://www.herger.net/slim-plugins - Spotty, MusicArtistInfo

  5. #5
    Senior Member
    Join Date
    Dec 2009
    Location
    Albinea (RE) Italy
    Posts
    735
    Quote Originally Posted by mherger View Post
    Hmm... I can't reproduce that issue: I've found two tracks, one at 192kbps, the other at 96kbps. Here's what LMS would find in that trackSampleRateMatch() method:

    Code:
    [15-08-28 17:26:18.0108] Slim::Utils::Misc::msg (1233) Warning: [17:26:18.0099] (
      {
        album       => undef,
        artist      => undef,
        bitrate     => "9216kb/s CBR",
        coverid     => "-140548654438760",
        disc        => undef,
        genre       => undef,
        icon        => undef,
        replay_gain => undef,
        samplerate  => 192_000,
        secs        => "2:48",
        title       => "JSBachConcertoAminorFourHarp-Largo24-192",
        tracknum    => undef,
        type        => "wav",
        year        => 0,
      },
      {
        album       => undef,
        artist      => undef,
        bitrate     => "4608kb/s CBR",
        coverid     => "-140548649023016",
        disc        => undef,
        genre       => undef,
        icon        => undef,
        replay_gain => undef,
        samplerate  => 96_000,
        secs        => "2:48",
        title       => "JSBachConcertoAminorFourHarp-Largo",
        tracknum    => undef,
        type        => "wav",
        year        => 0,
      },
    ) at /Users/mh/Dropbox/Squeezebox/git/server/Slim/Player/ReplayGain.pm line 238.
    both report the correct sample rate. I'd really need step-by-step instructions how to reproduce your issue.
    I'v eloaded in your dropbox some file. I Think nams are self explanatory.

    NOTE: You must be sure tracks are non in the DB to reproduce the error.

    Browse Disk and folders to the folder containing the files and play them (I've used local player as player). You'll notice that only the 44100_16 is played correctly, all the others are or slow or just white noise, this is becouse strm_s send all of them to the players as PCM - 44100 16 bit 2 channel.

    You are right, not so sure the problem origin exactly at that point in the code, but this was the first I've found going backwards from the player code to the server code, but in my case tracks as result from


    Code:
    $class->findTracksByIndexare ($client, $offset)
    are undefined your are defined, so there is something else different taking place here. Sure your tracks are not in the DB?

    By the way, a similar problem occours if you upsample a file (already in the DB as a track) with sox at runtime (pipe) with a command like this in custom-convert.conf:

    Code:
    wav pcm * *
    	# FT:{START=--skip=%t}U:{END=--until=%v}
    	[flac] -cs  $START$ $END$ -- $FILE$ |[sox] -q -t flac - -t raw -r 192000 -c 2 -3 -s -L - gain -3 rate -v 192000
    in this case LMS still look for the the samplerate into the db, so strm_s send the wrong information to the player.

    Symptoms are the same, but two different problems. Maybe the solution for both could be analize the file header once again before sending streaming info (as, I suppose, flac already do).

    Please note that client could not do this anymore, becouse it receive raw pcm, with no header, so the last place where try to handle this is here.
    __________________________________________________ ______________________
    Author of C-3PO plugin, Squeezelite-R2, Falcon Web interface - See www.marcoc1712.it

  6. #6
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,326

    Disk and folder browsing

    > I'v eloaded in your dropbox some file. I Think nams are self
    > explanatory.


    Thanks!

    > NOTE: You must be sure tracks are non in the DB to reproduce the error.


    Sure: I played them right out of the Dropbox folder, without touching
    LMS settings.

    > Browse Disk and folders to the folder containing the files and play them
    > (I've used local player as player). You'll notice that only the 44100_16


    Please try with a real SB, or with Squeezeplay on your desktop. It
    worked for me on a Radio as well as in Squeezeplay (don't have a Touch
    or Transporter here) right out of the box.

    Is this the LocalPlayer plugin? On what platform?

    > is played correctly, all the others are or slow or just white noise,
    > this is becouse strm_s send all of them to the players as PCM - 44100 16
    > bit 2 channel.


    All play fine for me. Sox is involved transcoding. But it wouldn't
    transcode if LMS wasn't aware of the bitrate/samplerate whatever.

    > By the way, a similar problem occours if you upsample a file (already in
    > the DB as a track) with sox at runtime (pipe) with a command like this
    > in custom-convert.conf:


    I'd suggest you get rid of all customization and try again. I wouldn't
    be surprised if the custom-convert.conf was causing problems.

    Please enable debugging for player.source and try again. Then upload
    your server.log file, too. Thanks!

    --

    Michael

  7. #7
    Senior Member
    Join Date
    Dec 2009
    Location
    Albinea (RE) Italy
    Posts
    735
    I think the problem origin here:

    Slim::Player::Squeezebox

    sub stream_s {...


    Code:
    if ($format eq 'pcm') {
    
    		$formatbyte      = 'p';
    		$pcmsamplesize   = 1;
    		$pcmsamplerate   = 3;
    		$pcmendian       = 1;
    		$pcmchannels     = 2;
    		$outputThreshold = 0;
    
    		if ( $track ) {
    
    
    			$pcmsamplesize = $client->pcm_sample_sizes($track);
    			$pcmsamplerate = $client->pcm_sample_rates($track);
    			$pcmchannels   = $track->channels() || '2';
    			
    		}
    $client->pcm_sample_rates($track) looks at $track->samplerate(), if it's undefined (as is for tracks not in the DB) returns the standard value of 3 (44_100).

    For the same reason, the sample rate (and sample size) of a runtime upsampled track is reported to be as recorded in the DB, in both case resulting in a wrong client initialization.
    __________________________________________________ ______________________
    Author of C-3PO plugin, Squeezelite-R2, Falcon Web interface - See www.marcoc1712.it

  8. #8
    Senior Member
    Join Date
    Dec 2009
    Location
    Albinea (RE) Italy
    Posts
    735
    Quote Originally Posted by mherger View Post
    > I'v eloaded in your dropbox some file. I Think nams are self
    > explanatory.


    Thanks!

    > NOTE: You must be sure tracks are non in the DB to reproduce the error.


    Sure: I played them right out of the Dropbox folder, without touching
    LMS settings.

    > Browse Disk and folders to the folder containing the files and play them
    > (I've used local player as player). You'll notice that only the 44100_16


    Please try with a real SB, or with Squeezeplay on your desktop. It
    worked for me on a Radio as well as in Squeezeplay (don't have a Touch
    or Transporter here) right out of the box.

    Is this the LocalPlayer plugin? On what platform?

    > is played correctly, all the others are or slow or just white noise,
    > this is becouse strm_s send all of them to the players as PCM - 44100 16
    > bit 2 channel.


    All play fine for me. Sox is involved transcoding. But it wouldn't
    transcode if LMS wasn't aware of the bitrate/samplerate whatever.

    > By the way, a similar problem occours if you upsample a file (already in
    > the DB as a track) with sox at runtime (pipe) with a command like this
    > in custom-convert.conf:


    I'd suggest you get rid of all customization and try again. I wouldn't
    be surprised if the custom-convert.conf was causing problems.

    Please enable debugging for player.source and try again. Then upload
    your server.log file, too. Thanks!

    --

    Michael
    Linux, Windows and Mac. On win and Linux is local plugin, on mac is squeezelite.
    I'll try the others and I'l post the log with some more debug line.

    When you say worked, you mean just played music or played at the original samplerate and samplesize?
    Last edited by marcoc1712; 2015-08-28 at 17:31.
    __________________________________________________ ______________________
    Author of C-3PO plugin, Squeezelite-R2, Falcon Web interface - See www.marcoc1712.it

  9. #9
    Senior Member
    Join Date
    Dec 2009
    Location
    Albinea (RE) Italy
    Posts
    735
    server_1.logserver_2.log

    HI,

    Tried with a Squeezebox2, same sound (can't see the log of the player to check the message he receved from server).

    In attachment the log file splitted in two (too big) each with two file played. Note that I've added some more debug line to better follow the code.

    Marco
    __________________________________________________ ______________________
    Author of C-3PO plugin, Squeezelite-R2, Falcon Web interface - See www.marcoc1712.it

  10. #10
    Senior Member Mnyb's Avatar
    Join Date
    Feb 2006
    Location
    Vństerňs Sweden
    Posts
    16,525
    What are your settings in settings > advanced > file types this influences transcoding ( or when not to transcode ) if your custom.convert.conf does not override this , which it might do

    The squeezebox 2 handles up to 24/48 ( analog out or digital out does not matter ) so a file greater than that should invoke transcoding . So if it does not transcode a wav file greater than that something is truly wrong I had an SB3 before and also a Boom so it does usually work for me.

    I'm not home right now so I could not test 24/96 wav files on my server for you , as I have hardware players (Touch ) that can do that ( or 24/192 so the transcoding can be invoked ) and my Linux mint desktop is setup to be 24/96 so it's squeezeplay instance should do 24/96 too . I could also try out what my boom does .

    Scenarios to test :

    1. Do as mherger says , remove the custom.convert.conf and reset the file types settings to default values .

    This should result in wav to flac transcoding at the samplerate the player can handle . Or wav to flac transcoding at the same rate as the original file .

    2. Same as above but with one exception disable flac, MP3 , etc for WAV files so that only "native" is left or is it PCM ?.

    This should send wav files at their original sample rate to the player if the player can handle them ! and invoke transcoding to PCM ? if the rate are greater than the player can handle .

    If scenario 2 does not work we have a more general case that does not involve your custom rule .
    --------------------------------------------------------------------
    Main hifi: Rasbery PI digi+ MeridianG68J MeridianHD621 MeridianG98DH 2 x MeridianDSP5200 MeridianDSP5200HC 2 xMeridianDSP3100 +Rel Stadium 3 sub.
    Bedroom/Office: Boom
    Loggia: Raspi hifiberry dac + Adams
    Bathroom : Radio (with battery)
    iPad with iPengHD & SqueezePad
    (spares Touch, SB3, reciever ,controller )
    server Intel NUC Esxi VM Linux mint 18 LMS 7.9.2

    http://people.xiph.org/~xiphmont/demo/neil-young.html

Posting Permissions

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