async def cmd_stop(self, update_state: bool = True) -> None:
"""Send STOP command to player."""
- async with self._lock:
- if self.raop_stream:
- # forward stop to the entire stream session
- await self.raop_stream.session.stop()
- if update_state and (mass_player := self.mass.players.get(self.player_id)):
- mass_player.state = PlayerState.IDLE
- self.mass.players.update(mass_player.player_id)
+ if self.raop_stream:
+ # forward stop to the entire stream session
+ await self.raop_stream.session.stop()
+ if update_state and (mass_player := self.mass.players.get(self.player_id)):
+ mass_player.state = PlayerState.IDLE
+ self.mass.players.update(mass_player.player_id)
async def cmd_play(self) -> None:
"""Send PLAY (unpause) command to player."""
return
assert airplay_player.raop_stream
assert airplay_player.raop_stream.session == self
- async with self._lock:
- self._sync_clients.remove(airplay_player)
- await airplay_player.raop_stream.stop()
+ self._sync_clients.remove(airplay_player)
+ await airplay_player.raop_stream.stop()
airplay_player.raop_stream = None
async def add_client(self, airplay_player: AirPlayPlayer) -> None:
await self.send_cli_command("ACTION=STOP")
self._stopped = True
with suppress(asyncio.TimeoutError):
- await self._cliraop_proc.wait_with_timeout(5)
+ await self._cliraop_proc.wait_with_timeout(2)
if self._stderr_reader_task and not self._stderr_reader_task.done():
self._stderr_reader_task.cancel()
if self._cliraop_proc.proc and not self._cliraop_proc.closed: