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
) -> 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"))
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
"ffmpeg",
"-hide_banner",
"-loglevel",
- "quiet",
+ "verbose" if LOGGER.isEnabledFor(logging.DEBUG) else "quiet",
"-ignore_unknown",
]
# collect input args
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(
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