Home of the Squeezebox™ & Transporter® network music players.
Page 4 of 4 FirstFirst ... 234
Results 31 to 37 of 37
  1. #31
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    15,372
    Quote Originally Posted by pippin View Post
    How does a player "enable reconnect"?
    from Squeezelite code - the response to "HELO"
    Code:
    static void sendHELO(bool reconnect, const char *fixed_cap, const char *var_cap, u8_t mac[6]) {
    	const char *base_cap = "Model=squeezelite,ModelName=SqueezeLite,AccuratePlayPoints=1,HasDigitalOut=1";
    	struct HELO_packet pkt;
    
    	memset(&pkt, 0, sizeof(pkt));
    	memcpy(&pkt.opcode, "HELO", 4);
    	pkt.length = htonl(sizeof(struct HELO_packet) - 8 + strlen(base_cap) + strlen(fixed_cap) + strlen(var_cap));
    #ifdef INTERACTIVE
    	pkt.deviceid = 8; // squeezeslave
    #else
    	pkt.deviceid = 12; // squeezeplay
    #endif
    	pkt.revision = 0;
    	packn(&pkt.wlan_channellist, reconnect ? 0x4000 : 0x0000);
    	packN(&pkt.bytes_received_H, (u64_t)status.stream_bytes >> 32);
    	packN(&pkt.bytes_received_L, (u64_t)status.stream_bytes & 0xffffffff);
    	memcpy(pkt.mac, mac, 6);
    
    	LOG_INFO("mac: %02x:%02x:%02x:%02x:%02x:%02x", pkt.mac[0], pkt.mac[1], pkt.mac[2], pkt.mac[3], pkt.mac[4], pkt.mac[5]);
    
    	LOG_INFO("cap: %s%s%s", base_cap, fixed_cap, var_cap);
    
    	send_packet((u8_t *)&pkt, sizeof(pkt));
    	send_packet((u8_t *)base_cap, strlen(base_cap));
    	send_packet((u8_t *)fixed_cap, strlen(fixed_cap));
    	send_packet((u8_t *)var_cap, strlen(var_cap));
    }
    Again purely from reading code - if reconnect is 1 - then it is enabled

  2. #32
    Senior Member wt0's Avatar
    Join Date
    Jul 2008
    Posts
    568
    Quote Originally Posted by itm View Post
    Sorry - I hadn't realised that one of the other players was still turned on....

    Anyway I'm now trying SB player and getting the same sort of issue. By "same sort of issue" I mean that tracks are now aborting and then either restarting from the beginning or simply stopping mid-track. I stopped LMS, cleared the server log and attach a new one from just after the latest track stopped playing.

    Re. the LG phone - the removable battery is the must-have feature for me. I'm lucky to get more than 8 hours battery life out of my phone, and the spare battery has been a life saver on several occasions.
    The abort and restart is definitely triggered by the server. After audio data is used in SB Player, it's gone. There's no way for SB Player to go back to replay previous audio samples. When I initially tested reconnection behavior I played radio streams, which is probably why I never noticed a restart behavior.

    Quote Originally Posted by bpa View Post
    from Squeezelite code - the response to "HELO"
    Code:
    	packn(&pkt.wlan_channellist, reconnect ? 0x4000 : 0x0000);
    Again purely from reading code - if reconnect is 1 - then it is enabled
    This is interesting. There's nothing in the Slimproto docs about a reconnect flag, but those docs are quite old and not quite complete. An unused bit in the wifi channel list of the HELO message may be used to signify that this is a reconnection so the server won't restart the track. I'll have to do some tests.

    BTW, HELO is the first message the player sends to server when it initiates a connection, not the other way around; ie. Squeezelite is not responding to HELO, it's sending it.
    --------------
    Squeezebox apps for webOS, Android and Windows Phone, http://www.angrygoatapps.com

  3. #33
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    15,372
    Quote Originally Posted by wt0 View Post
    The abort and restart is definitely triggered by the server. After audio data is used in SB Player, it's gone. There's no way for SB Player to go back to replay previous audio samples. When I initially tested reconnection behavior I played radio streams, which is probably why I never noticed a restart behavior.


    This is interesting. There's nothing in the Slimproto docs about a reconnect flag, but those docs are quite old and not quite complete. An unused bit in the wifi channel list of the HELO message may be used to signify that this is a reconnection so the server won't restart the track. I'll have to do some tests.

    BTW, HELO is the first message the player sends to server when it initiates a connection, not the other way around; ie. Squeezelite is not responding to HELO, it's sending it.

    You're right - it's been awhile since I looked at the proto exchanges but the reconnect capability is still sent to LMS and the following is the Squeezebox.pm code which checks the bit. I don't know what reconnect effect has - it's strange that many non-squeezelite s/w/ players don't use it.
    Code:
    	if (!$reconnect) {
    
    		if ($client->power()) {
    			$controller->playerActive($client);
    		}
    		
    		if ($controller->onlyActivePlayer($client)) {
    			main::INFOLOG && $sourcelog->is_info && $sourcelog->info($client->id . " restaring play on pseudo-reconnect at "
    				. ($bytes_received ? $bytes_received : 0));
    			$controller->playerReconnect($bytes_received);
    		} 
    		
    		if ($client->isStopped()) {
    			# Ensure that a new client is stopped, but only on sb2s
    			if ( $client->isa('Slim::Player::Squeezebox2') ) {
    				main::INFOLOG && $sourcelog->is_info && $sourcelog->info($client->id . " forcing stop on pseudo-reconnect");
    				$client->stop();
    			}
    		}
    	} else {
    		# bug 16881: player in a sync-group may have been made inactive upon disconnect;
    		# make sure it is active now.
    		if ($client->power()) {
    			$controller->playerActive($client);
    		}
    	}

  4. #34
    Senior Member wt0's Avatar
    Join Date
    Jul 2008
    Posts
    568
    Quote Originally Posted by bpa View Post
    it's strange that many non-squeezelite s/w/ players don't use it.
    Probably because most non-squeezelite players were initially written well before squeezelite existed and the reconnect feature may not have been added till later versions of LMS.
    The first player I wrote was for the webOS platform and 7.4 was the latest version of LMS.

    Also, it's not documented and you would have be packet capturing the network exchanges during a reconnection to see it.
    --------------
    Squeezebox apps for webOS, Android and Windows Phone, http://www.angrygoatapps.com

  5. #35
    Senior Member
    Join Date
    Mar 2008
    Posts
    503
    Quote Originally Posted by itm View Post
    Which Samsung do you have? I had a Galaxy S4 before the LG and it was good but the camera on the LG is soooo much better, particularly in low light.
    It's a Galaxy J7 Prime, model SM-J727T running Android 7.0.

    I don't have a strong opinion about the quality of the pictures it takes, but I really don't like the way you have to take them. There's an onscreen button that apparently you have to tap EXACTLY right or nothing happens.

    Other than the disaster with the GPS, I really liked the LG so I can certainly understand why you wouldn't be in a hurry to switch. While the latest LG Stylo is $50 less than what I ended up getting, I allowed myself to be talked out of it by a salesperson claiming I was far from the first LG customer with update disasters. Of course, I have no idea if that's true.

  6. #36
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    15,372
    Quote Originally Posted by wt0 View Post
    Probably because most non-squeezelite players were initially written well before squeezelite existed and the reconnect feature may not have been added till later versions of LMS.
    The first player I wrote was for the webOS platform and 7.4 was the latest version of LMS.

    Also, it's not documented and you would have be packet capturing the network exchanges during a reconnection to see it.
    As "reconnect" seems to have been added to LMS probably to deal with some behaviour of Squeezelite on PC's/RPis/Odroid etc - it may not be the "solution" for the OP's problem.

  7. #37
    Senior Member wt0's Avatar
    Join Date
    Jul 2008
    Posts
    568
    Quote Originally Posted by bpa View Post
    As "reconnect" seems to have been added to LMS probably to deal with some behaviour of Squeezelite on PC's/RPis/Odroid etc - it may not be the "solution" for the OP's problem.
    I think you're right, sending that value didn't seem to do anything. Turns out the reason SB Player aborts and restarts the track after a reconnect is because it clears the input buffer and stops the decoder whenever it disconnects even if it's not user initiated. After I changed that, it will play out whatever is in the buffer.

    What it can't do is if the whole track is too big to fit in the buffer, it will just stop after the buffers are empty. The stream won't restart after the reconnect. This happens in Squeezelite too so it's definitely a LMS problem.
    --------------
    Squeezebox apps for webOS, Android and Windows Phone, http://www.angrygoatapps.com

Tags for this Thread

Posting Permissions

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