Sunshine
Sunshine copied to clipboard
Audio is not sent streaming from MAC
Is there an existing issue for this?
- [x] I have searched the existing issues
Is your issue described in the documentation?
- [x] I have read the documentation
Is your issue present in the latest beta/pre-release?
This issue is present in the latest pre-release
Describe the Bug
On Mac M1 as host, audio won't work, clients does not receive anything
Expected Behavior
I'm expecting the sound thrown at the the "audio sink" to be transmitted to the client.
I've linked my complete, log, but I think this particular line is of interest :
Warning: audio_control_t::set_sink() unimplemented: BlackHole 2ch
Additional Context
The documentation states
Sunshine can only access microphones on macOS due to system limitations. To stream system audio use Soundflower or BlackHole.
BlackHole is running, I've been able to test it, there is no issue there.
Host Operating System
macOS
Operating System Version
15.2
Architecture
amd64/x86_64
Sunshine commit or version
v2025.104.135703
Package
macOS - Homebrew
GPU Type
Apple Silicon
GPU Model
M1
GPU Driver/Mesa Version
M1
Capture Method
AVCaptureScreen (macOS)
Config
audio_sink = BlackHole 2ch
output_name = 2
sunshine_name = Mac M1
Apps
Relevant log output
[2025-01-05 01:46:17.068]: Info: Sunshine version: v2025.104.135703
[2025-01-05 01:46:17.069]: Info: Package Publisher: LizardByte
[2025-01-05 01:46:17.069]: Info: Publisher Website: https://app.lizardbyte.dev
[2025-01-05 01:46:17.069]: Info: Get support: https://app.lizardbyte.dev/support
[2025-01-05 01:46:17.136]: Warning: No gamepad input is available
[2025-01-05 01:46:17.136]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2025-01-05 01:46:17.136]: Info: Trying encoder [videotoolbox]
[2025-01-05 01:46:17.154]: Info: Detecting displays
[2025-01-05 01:46:17.154]: Info: Detected display: Essentiel+ (id: 2) connected: true
[2025-01-05 01:46:17.154]: Info: Detected display: Built-in Retina Display (id: 1) connected: true
[2025-01-05 01:46:17.154]: Info: Configuring selected display (2) to stream
[2025-01-05 01:46:17.160]: Info: Creating encoder [h264_videotoolbox]
[2025-01-05 01:46:17.160]: Info: Color coding: SDR (Rec. 601)
[2025-01-05 01:46:17.160]: Info: Color depth: 8-bit
[2025-01-05 01:46:17.160]: Info: Color range: JPEG
[2025-01-05 01:46:19.607]: Warning: [h264_videotoolbox @ 0x157129120] PrioritizeEncodingSpeedOverQuality property is not supported on this device. Ignoring.
[2025-01-05 01:46:19.608]: Info: [h264_videotoolbox @ 0x157129120] This device does not support the AllowOpenGop option. Value ignored.
[2025-01-05 01:46:19.848]: Info: Creating encoder [hevc_videotoolbox]
[2025-01-05 01:46:19.848]: Info: Color coding: SDR (Rec. 601)
[2025-01-05 01:46:19.848]: Info: Color depth: 8-bit
[2025-01-05 01:46:19.848]: Info: Color range: JPEG
[2025-01-05 01:46:19.861]: Info: [hevc_videotoolbox @ 0x15719f490] This device does not support the max_ref_frames option. Value ignored.
[2025-01-05 01:46:19.974]: Info: Creating encoder [av1_videotoolbox]
[2025-01-05 01:46:19.974]: Info: Color coding: SDR (Rec. 601)
[2025-01-05 01:46:19.974]: Info: Color depth: 8-bit
[2025-01-05 01:46:19.974]: Info: Color range: JPEG
[2025-01-05 01:46:19.974]: Error: Couldn't open [av1_videotoolbox]
[2025-01-05 01:46:19.975]: Info: Detecting displays
[2025-01-05 01:46:19.975]: Info: Detected display: Essentiel+ (id: 2) connected: true
[2025-01-05 01:46:19.975]: Info: Detected display: Built-in Retina Display (id: 1) connected: true
[2025-01-05 01:46:19.975]: Info: Configuring selected display (2) to stream
[2025-01-05 01:46:19.975]: Info: Creating encoder [hevc_videotoolbox]
[2025-01-05 01:46:19.975]: Info: Color coding: SDR (Rec. 709)
[2025-01-05 01:46:19.975]: Info: Color depth: 10-bit
[2025-01-05 01:46:19.975]: Info: Color range: JPEG
[2025-01-05 01:46:19.985]: Info: [hevc_videotoolbox @ 0x156771a80] This device does not support the max_ref_frames option. Value ignored.
[2025-01-05 01:46:20.091]: Info:
[2025-01-05 01:46:20.091]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2025-01-05 01:46:20.091]: Info:
[2025-01-05 01:46:20.091]: Info: Found H.264 encoder: h264_videotoolbox [videotoolbox]
[2025-01-05 01:46:20.091]: Info: Found HEVC encoder: hevc_videotoolbox [videotoolbox]
[2025-01-05 01:46:20.094]: Info: Configuration UI available at [https://localhost:47990]
[2025-01-05 01:46:20.812]: Info: Successfully registered DNS service.
[2025-01-05 01:46:40.806]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2025-01-05 01:46:40.807]: Info: Trying encoder [videotoolbox]
[2025-01-05 01:46:40.808]: Info: Detecting displays
[2025-01-05 01:46:40.808]: Info: Detected display: Essentiel+ (id: 2) connected: true
[2025-01-05 01:46:40.808]: Info: Detected display: Built-in Retina Display (id: 1) connected: true
[2025-01-05 01:46:40.808]: Info: Configuring selected display (2) to stream
[2025-01-05 01:46:40.808]: Info: Creating encoder [h264_videotoolbox]
[2025-01-05 01:46:40.808]: Info: Color coding: SDR (Rec. 601)
[2025-01-05 01:46:40.808]: Info: Color depth: 8-bit
[2025-01-05 01:46:40.808]: Info: Color range: JPEG
[2025-01-05 01:46:40.813]: Warning: [h264_videotoolbox @ 0x15730c6b0] PrioritizeEncodingSpeedOverQuality property is not supported on this device. Ignoring.
[2025-01-05 01:46:40.816]: Info: [h264_videotoolbox @ 0x15730c6b0] This device does not support the AllowOpenGop option. Value ignored.
[2025-01-05 01:46:40.966]: Info: Creating encoder [hevc_videotoolbox]
[2025-01-05 01:46:40.966]: Info: Color coding: SDR (Rec. 601)
[2025-01-05 01:46:40.966]: Info: Color depth: 8-bit
[2025-01-05 01:46:40.966]: Info: Color range: JPEG
[2025-01-05 01:46:40.980]: Info: [hevc_videotoolbox @ 0x156778c60] This device does not support the max_ref_frames option. Value ignored.
[2025-01-05 01:46:41.106]: Info: Creating encoder [av1_videotoolbox]
[2025-01-05 01:46:41.106]: Info: Color coding: SDR (Rec. 601)
[2025-01-05 01:46:41.106]: Info: Color depth: 8-bit
[2025-01-05 01:46:41.106]: Info: Color range: JPEG
[2025-01-05 01:46:41.106]: Error: Couldn't open [av1_videotoolbox]
[2025-01-05 01:46:41.106]: Info: Detecting displays
[2025-01-05 01:46:41.106]: Info: Detected display: Essentiel+ (id: 2) connected: true
[2025-01-05 01:46:41.106]: Info: Detected display: Built-in Retina Display (id: 1) connected: true
[2025-01-05 01:46:41.106]: Info: Configuring selected display (2) to stream
[2025-01-05 01:46:41.106]: Info: Creating encoder [hevc_videotoolbox]
[2025-01-05 01:46:41.107]: Info: Color coding: SDR (Rec. 709)
[2025-01-05 01:46:41.107]: Info: Color depth: 10-bit
[2025-01-05 01:46:41.107]: Info: Color range: JPEG
[2025-01-05 01:46:41.117]: Info: [hevc_videotoolbox @ 0x156779e30] This device does not support the max_ref_frames option. Value ignored.
[2025-01-05 01:46:41.222]: Info:
[2025-01-05 01:46:41.222]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2025-01-05 01:46:41.222]: Info:
[2025-01-05 01:46:41.222]: Info: Found H.264 encoder: h264_videotoolbox [videotoolbox]
[2025-01-05 01:46:41.222]: Info: Found HEVC encoder: hevc_videotoolbox [videotoolbox]
[2025-01-05 01:46:41.225]: Info: Executing: [open -a Ryujinx.app] in ["/usr/bin"]
[2025-01-05 01:46:41.433]: Info: New streaming session started [active sessions: 1]
[2025-01-05 01:46:41.456]: Info: CLIENT CONNECTED
[2025-01-05 01:46:41.456]: Info: App exited gracefully within 5 seconds of launch. Treating the app as a detached command.
[2025-01-05 01:46:41.456]: Info: Adjust this behavior in the Applications tab or apps.json if this is not what you want.
[2025-01-05 01:46:41.502]: Info: Detecting displays
[2025-01-05 01:46:41.502]: Info: Detected display: Essentiel+ (id: 2) connected: true
[2025-01-05 01:46:41.502]: Info: Detected display: Built-in Retina Display (id: 1) connected: true
[2025-01-05 01:46:41.502]: Info: Configuring selected display (2) to stream
[2025-01-05 01:46:41.604]: Info: Creating encoder [hevc_videotoolbox]
[2025-01-05 01:46:41.605]: Info: Color coding: SDR (Rec. 709)
[2025-01-05 01:46:41.605]: Info: Color depth: 8-bit
[2025-01-05 01:46:41.605]: Info: Color range: MPEG
[2025-01-05 01:46:41.649]: Info: [hevc_videotoolbox @ 0x1366064a0] This device does not support the max_ref_frames option. Value ignored.
[2025-01-05 01:46:41.903]: Warning: audio_control_t::set_sink() unimplemented: BlackHole 2ch
[2025-01-05 01:46:41.970]: Error: Failed to setup microphone.
[2025-01-05 01:46:41.970]: Error: Unable to initialize audio capture. The stream will not have audio.
[2025-01-05 01:47:07.935]: Info: alloc_gamepad: Gamepad not yet implemented for MacOS.
Same Issue on linux
Same issue. I found it is not implemented for now on MacOS. https://github.com/LizardByte/Sunshine/blob/master/src/platform/macos/microphone.mm#L47
However, I guess it is implemented by using microphone to redirect audio to sunshine. It maybe a misconfiguration but I have't found any config for this. https://github.com/LizardByte/Sunshine/blob/master/src/platform/macos/av_audio.m#L108
OBS is able to capture macOS system audio natively using Apple's ScreenCaptureKit, without Soundflower or BlackHole. Is there a potential to have a similar kind of integration in sunshine?
Screenshots from OBS:
And the relevant OBS source code / headers appear to be the files starting with the mac-sck-* (ScreenCaptureKit) prefix in the mac-capture folder: https://github.com/obsproject/obs-studio/tree/master/plugins/mac-capture
@vgmoose probably. I don't think the ScreenCaptureKit existed when this was first introduced into Sunshine. We would gladly accept a PR for this.
@vgmoose probably. I don't think the ScreenCaptureKit existed when this was first introduced into Sunshine. We would gladly accept a PR for this.
is there actually a way to get audio to work? I also tried with blackhole without success. The web interface claims we should be able to use blackhole or soundflower but how exactly?
@Tomahawkd @ndesgranges I managed to get it to work. You need to match sample rates for BlackHole input and output to 48kHz. Be sure to type "BlackHole 2ch" manually into Configuration. Restart the system if needed.
It seems this issue hasn't had any activity in the past 90 days. If it's still something you'd like addressed, please let us know by leaving a comment. Otherwise, to help keep our backlog tidy, we'll be closing this issue in 10 days. Thanks!
This issue was closed because it has been stalled for 10 days with no activity.