From: Marcel van der Veldt Date: Sun, 26 Mar 2023 18:59:23 +0000 (+0200) Subject: make ffmpeg logging a bit more verbose X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=85f8e7786c7feff7b112e41702f977c421727351;p=music-assistant-server.git make ffmpeg logging a bit more verbose --- diff --git a/music_assistant/server/controllers/streams.py b/music_assistant/server/controllers/streams.py index cc157835..eef53b5d 100644 --- a/music_assistant/server/controllers/streams.py +++ b/music_assistant/server/controllers/streams.py @@ -622,7 +622,7 @@ class StreamsController: "ffmpeg", "-hide_banner", "-loglevel", - "quiet", + "verbose" if LOGGER.isEnabledFor(logging.DEBUG) else "quiet", "-ignore_unknown", ] # input args diff --git a/music_assistant/server/helpers/audio.py b/music_assistant/server/helpers/audio.py index 2db98933..e7150971 100644 --- a/music_assistant/server/helpers/audio.py +++ b/music_assistant/server/helpers/audio.py @@ -17,14 +17,18 @@ from aiohttp import ClientTimeout from music_assistant.common.helpers.util import create_tempfile from music_assistant.common.models.errors import AudioError, MediaNotFoundError, MusicAssistantError from music_assistant.common.models.media_items import ContentType, MediaType, StreamDetails -from music_assistant.constants import CONF_VOLUME_NORMALISATION, CONF_VOLUME_NORMALISATION_TARGET +from music_assistant.constants import ( + CONF_VOLUME_NORMALISATION, + CONF_VOLUME_NORMALISATION_TARGET, + ROOT_LOGGER_NAME, +) from music_assistant.server.helpers.process import AsyncProcess, check_output if TYPE_CHECKING: from music_assistant.common.models.player_queue import QueueItem from music_assistant.server import MusicAssistant -LOGGER = logging.getLogger(__name__) +LOGGER = logging.getLogger(f"{ROOT_LOGGER_NAME}.audio") # pylint:disable=consider-using-f-string @@ -498,7 +502,7 @@ async def get_radio_stream( ) -> AsyncGenerator[bytes, None]: """Get radio audio stream from HTTP, including metadata retrieval.""" headers = {"Icy-MetaData": "1"} - timeout = ClientTimeout(total=0, connect=30, sock_read=600) + timeout = ClientTimeout(total=0, connect=30, sock_read=60) async with mass.http_session.get(url, headers=headers, timeout=timeout) as resp: headers = resp.headers meta_int = int(headers.get("icy-metaint", "0")) @@ -550,7 +554,7 @@ async def get_http_stream( buffer = b"" buffer_all = False bytes_received = 0 - timeout = ClientTimeout(total=0, connect=30, sock_read=600) + timeout = ClientTimeout(total=0, connect=30, sock_read=5 * 60) async with mass.http_session.get(url, headers=headers, timeout=timeout) as resp: is_partial = resp.status == 206 buffer_all = seek_position and not is_partial @@ -743,7 +747,7 @@ async def _get_ffmpeg_args( "ffmpeg", "-hide_banner", "-loglevel", - "quiet", + "verbose" if LOGGER.isEnabledFor(logging.DEBUG) else "quiet", "-ignore_unknown", ] # collect input args diff --git a/music_assistant/server/helpers/process.py b/music_assistant/server/helpers/process.py index 0d584c34..c272426e 100644 --- a/music_assistant/server/helpers/process.py +++ b/music_assistant/server/helpers/process.py @@ -46,7 +46,7 @@ class AsyncProcess: stdout=asyncio.subprocess.PIPE if self._enable_stdout else None, stderr=asyncio.subprocess.PIPE if self._enable_stderr else None, close_fds=True, - limit=32000000, + limit=64 * 1024 * 1024, ) else: self._proc = await asyncio.create_subprocess_exec( @@ -55,7 +55,7 @@ class AsyncProcess: stdout=asyncio.subprocess.PIPE if self._enable_stdout else None, stderr=asyncio.subprocess.PIPE if self._enable_stderr else None, close_fds=True, - limit=32000000, + limit=64 * 1024 * 1024, ) # Fix BrokenPipeError due to a race condition