LizardByte / Sunshine

Self-hosted game stream host for Moonlight.
http://app.lizardbyte.dev/Sunshine/
GNU General Public License v3.0
17.66k stars 855 forks source link

M1 Mac muffled sound with static #1920

Closed julianrios closed 8 months ago

julianrios commented 8 months ago

Is there an existing issue for this?

Is your issue described in the documentation?

Is your issue present in the nightly release?

Describe the Bug

When starting the stream the audio is not switching automatically to BlackHole Audio Sink. I do this manually from the settings but when I switch the audio is muffled and full of static.

Expected Behavior

Clear sound no static

Additional Context

No response

Host Operating System

macOS

Operating System Version

macOS Sonoma

Architecture

arm

Sunshine commit or version

0.21.0

Package

macOS - Portfile

GPU Type

AMD

GPU Model

Apple M1 Pro

GPU Driver/Mesa Version

14.2 (23C64)

Capture Method (Linux Only)

No response

Config

# MacPorts system-wide configuration file for ports tree sources.
#
# To change how MacPorts fetches base, see rsync_server and rsync_dir in
# macports.conf.

# To add a local source, add a "file://" entry.
#
#   Example: file:///Users/landonf/misc/MacPorts/ports
#
# To prevent a source from synchronizing when `port sync` is used,
# append "[nosync]" at the end.
#
#   Example: file:///Users/landonf/misc/MacPorts/ports [nosync]
#
# Note that MacPorts parses source URLs in order; when a port appears in
# multiple sources, it installs the first occurrence. For local sources
# to shadow remote ones, "file://" URLs must come before other URLs.

# A list of rsync mirrors is available at
# https://trac.macports.org/wiki/Mirrors#Portfiles.
#
# If an "rsync://" URL points to a .tar file, a signed .rmd160 file must
# exist in the same directory on the server and will be used to verify
# its integrity.
#
# For proper functionality of various resources (port groups, mirror
# sites, etc.), the primary MacPorts source must always be tagged
# "[default]", even if switched from the default "rsync://" URL.

rsync://rsync.macports.org/macports/release/tarballs/ports.tar [default]
file:///Users/julian/ports
file:///Users/julian/ports

Apps

julian@julians-mbp ~ % sunshine
[audio_sink] -- [BlackHole 2ch]
[2023:12:17:10:40:24]: Info: Sunshine version: 0.21.0
[2023:12:17:10:40:24]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2023:12:17:10:40:24]: Info: Trying encoder [videotoolbox]
[2023:12:17:10:40:24]: Info: SDR color coding [Rec. 601]
[2023:12:17:10:40:24]: Info: Color depth: 8-bit
[2023:12:17:10:40:24]: Info: Color range: [JPEG]
2023-12-17 10:40:25.198 sunshine[55584:2118482] WARNING: AVCaptureDeviceTypeExternal is deprecated for Continuity Cameras. Please use AVCaptureDeviceTypeContinuityCamera and add NSCameraUseContinuityCameraDeviceType to your Info.plist.
[2023:12:17:10:40:25]: Warning: [h264_videotoolbox @ 0x11ee06110] PrioritizeEncodingSpeedOverQuality property is not supported on this device. Ignoring.
[2023:12:17:10:40:25]: Info: [h264_videotoolbox @ 0x11ee06110] This device does not support the AllowOpenGop option. Value ignored.
[2023:12:17:10:40:25]: Info: SDR color coding [Rec. 601]
[2023:12:17:10:40:25]: Info: Color depth: 8-bit
[2023:12:17:10:40:25]: Info: Color range: [JPEG]
[2023:12:17:10:40:25]: Info: SDR color coding [Rec. 601]
[2023:12:17:10:40:25]: Info: Color depth: 8-bit
[2023:12:17:10:40:25]: Info: Color range: [JPEG]
[2023:12:17:10:40:25]: Error: Couldn't open [av1_videotoolbox]
[2023:12:17:10:40:25]: Info: SDR color coding [Rec. 601]
[2023:12:17:10:40:25]: Info: Color depth: 8-bit
[2023:12:17:10:40:25]: Info: Color range: [JPEG]
[2023:12:17:10:40:25]: Error: Couldn't open [av1_videotoolbox]
[2023:12:17:10:40:25]: Info: SDR color coding [Rec. 709]
[2023:12:17:10:40:25]: Info: Color depth: 10-bit
[2023:12:17:10:40:25]: Info: Color range: [JPEG]
[2023:12:17:10:40:25]: Info: 
[2023:12:17:10:40:25]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2023:12:17:10:40:25]: Info: 
[2023:12:17:10:40:25]: Info: Found H.264 encoder: h264_videotoolbox [videotoolbox]
[2023:12:17:10:40:25]: Info: Found HEVC encoder: hevc_videotoolbox [videotoolbox]
[2023:12:17:10:40:25]: Info: Configuration UI available at [https://localhost:47990]
dbus[55584]: Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!
[2023:12:17:10:40:25]: Error: Failed to create client: Memory exhausted
[2023:12:17:10:40:37]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2023:12:17:10:40:37]: Info: Trying encoder [videotoolbox]
[2023:12:17:10:40:37]: Info: SDR color coding [Rec. 601]
[2023:12:17:10:40:37]: Info: Color depth: 8-bit
[2023:12:17:10:40:37]: Info: Color range: [JPEG]
[2023:12:17:10:40:37]: Warning: [h264_videotoolbox @ 0x11fa06150] PrioritizeEncodingSpeedOverQuality property is not supported on this device. Ignoring.
[2023:12:17:10:40:37]: Info: [h264_videotoolbox @ 0x11fa06150] This device does not support the AllowOpenGop option. Value ignored.
[2023:12:17:10:40:38]: Info: SDR color coding [Rec. 601]
[2023:12:17:10:40:38]: Info: Color depth: 8-bit
[2023:12:17:10:40:38]: Info: Color range: [JPEG]
[2023:12:17:10:40:38]: Info: SDR color coding [Rec. 601]
[2023:12:17:10:40:38]: Info: Color depth: 8-bit
[2023:12:17:10:40:38]: Info: Color range: [JPEG]
[2023:12:17:10:40:38]: Error: Couldn't open [av1_videotoolbox]
[2023:12:17:10:40:38]: Info: SDR color coding [Rec. 601]
[2023:12:17:10:40:38]: Info: Color depth: 8-bit
[2023:12:17:10:40:38]: Info: Color range: [JPEG]
[2023:12:17:10:40:38]: Error: Couldn't open [av1_videotoolbox]
[2023:12:17:10:40:38]: Info: SDR color coding [Rec. 709]
[2023:12:17:10:40:38]: Info: Color depth: 10-bit
[2023:12:17:10:40:38]: Info: Color range: [JPEG]
[2023:12:17:10:40:38]: Info: 
[2023:12:17:10:40:38]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2023:12:17:10:40:38]: Info: 
[2023:12:17:10:40:38]: Info: Found H.264 encoder: h264_videotoolbox [videotoolbox]
[2023:12:17:10:40:38]: Info: Found HEVC encoder: hevc_videotoolbox [videotoolbox]
[2023:12:17:10:40:38]: Info: Executing [Desktop]
[2023:12:17:10:40:38]: Info: CLIENT CONNECTED
[2023:12:17:10:40:38]: Info: SDR color coding [Rec. 601]
[2023:12:17:10:40:38]: Info: Color depth: 8-bit
[2023:12:17:10:40:38]: Info: Color range: [MPEG]
[2023:12:17:10:40:39]: Warning: audio_control_t::set_sink() unimplemented: BlackHole 2ch

Relevant log output

# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

# initial PR into macports: https://github.com/macports/macports-ports/pull/15143

PortSystem               1.0
PortGroup                cmake 1.1
PortGroup                github 1.0
PortGroup                boost 1.0

name                     Sunshine
version                  0.21.0
revision                 0
categories               multimedia emulators games
platforms                darwin
license                  GPL-3
maintainers              @LizardByte
description              Sunshine is a self-hosted game stream host for Moonlight.

# long_description will not be split into multiple lines as it's configured by CMakeLists
long_description         Offering low latency, cloud gaming server capabilities with support for AMD, Intel, and Nvidia GPUs for hardware encoding. Software encoding is also available. You can connect to Sunshine from any Moonlight client on a variety of devices. A web UI is provided to allow configuration, and client pairing, from your favorite web browser. Pair from the local server or any mobile device.
homepage                 https://app.lizardbyte.dev/Sunshine
master_sites             https://github.com/lizardbyte/sunshine/releases

compiler.cxx_standard    2017
fetch.type               git

git.url                  https://github.com/LizardByte/Sunshine.git
git.branch               5bca024899eff8f50e04c1723aeca25fc5e542ca

post-fetch {
    system -W ${worksrcpath} "${git.cmd} submodule update --init --recursive"
}

depends_lib              port:avahi \
                         port:curl \
                         port:libopus \
                         port:npm9 \
                         port:pkgconfig

boost.version            1.81

configure.args           -DCMAKE_INSTALL_PREFIX=${prefix} \
                         -DSUNSHINE_ASSETS_DIR=etc/sunshine/assets

startupitem.create       yes
startupitem.executable   "${prefix}/bin/{$name}"
startupitem.location     LaunchDaemons
startupitem.name         ${name}
startupitem.netchange    yes

platform darwin {
    if { ${os.major} < 20 } {
        # See: https://github.com/LizardByte/Sunshine/discussions/117#discussioncomment-2513494
        notes-append "Port is limited to software encoding, when used with macOS releases prior to Big Sur."
    }
}

pre-build {
    system -W ${worksrcpath} "npm install"
}

notes-append "Run Sunshine by executing 'sunshine <path to user config>', e.g. 'sunshine ~/sunshine.conf' "
notes-append "The config file will be created if it doesn't exist."
notes-append "It is recommended to set a location for the apps file in the config."
notes-append "See our documentation at 'https://docs.lizardbyte.dev/projects/sunshine/en/v0.21.0/' for further info."
julianrios commented 8 months ago

Restart seemed to fix the issue