Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 4 of 4
  1. #1
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    5,061

    slimproto output_threshold and squeezelite

    The LMS code of Squeezebox.pm says that the output_threshold optional parameter sent in the strms message is the amount of time in 1/10s of seconds to wait before starting playback
    Code:
    (519) #	u8_t output_threshold`;	// [1]	Amount of output buffer data before playback starts in tenths of second.
    But what squeezelite does in output.c is
    Code:
    	if (output.state == OUTPUT_BUFFER && frames > output.threshold * output.next_sample_rate / 100 && frames > output.start_frames) {
                output.state = OUTPUT_RUNNING;
    That looks to me as the value is used in 1/100 of seconds, so we have a factor 10. It's late and I'm tired, so please tell me ...
    LMS 7.7, 7.8 and 7.9 - 5xRadio, 3xBoom, 4xDuet, 1xTouch, 1 SB2. Sonos PLAY:3, PLAY:5, Marantz NR1603, JBL OnBeat, XBoxOne, XBMC, Foobar2000, ShairPortW, JRiver 21, 2xChromecast Audio, Chromecast v1 and v2, , Pi B3, B2, Pi B+, 2xPi A+, Odroid-C1, Odroid-C2, Cubie2, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5

  2. #2
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    1,847
    Presumably it depends on what the units are for output.next_sample_rate
    Paul Webster
    http://dabdig.blogspot.com
    Author Radio France (FIP etc) plugin

  3. #3
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    2,220
    next_sample_rate is set in the decoder for each of the supported audio formats and contains the sample rate in hertz of the next track to play.

    Code:
    output.c:149:LOG_INFO("track start sample rate: %u replay_gain: %u", output.next_sample_rate, output.next_replay_gain);
    
    [08:40:30.311174] _output_frames:149 track start sample rate: 44100 replay_gain: 0
    [08:40:50.914721] _output_frames:149 track start sample rate: 22050 replay_gain: 0
    I looks like you were correct despite the late hour!
    Ralphy

    1-Touch, 5-Classics, 3-Booms, 1-UE Radio
    Squeezebox client builds donations always appreciated.

  4. #4
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    2,220
    The squeezeplay sources confirm the threshold calculation should be tenths.

    Code:
    /* Should we start the audio now based on having enough decoded data? */
    	if (decode_audio->state & DECODE_STATE_AUTOSTART
    			&& decode_frames > (output_frames * (3 + state->period_count))
    			&& decode_frames > (decode_audio->output_threshold * state->pcm_sample_rate / 10)
    		)
    From https://github.com/Logitech/squeezep...backend.c#L286

    squeezelite 1.9.2-1158 includes the change.
    Ralphy

    1-Touch, 5-Classics, 3-Booms, 1-UE Radio
    Squeezebox client builds donations always appreciated.

Posting Permissions

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