mpv icon indicating copy to clipboard operation
mpv copied to clipboard

Since 0.40 Incorrect audio output on MacOS when using Aggregate Audio Devices

Open lbatalha opened this issue 10 months ago • 5 comments

mpv Information

mpv v0.40.0 Copyright Ā© 2000-2025 mpv/MPlayer/mplayer2 projects
libplacebo version: v7.349.0
FFmpeg version: 7.1.1
FFmpeg library versions:
   libavcodec      61.19.101
   libavdevice     61.3.100
   libavfilter     10.4.100
   libavformat     61.7.100
   libavutil       59.39.100
   libswresample   5.3.100
   libswscale      8.3.100

Other Information

- macOS version: macOS 15.3.2 (24D81)
- Source of mpv: https://formulae.brew.sh/formula/mpv
- Latest known working version: 0.39.x
- Issue started after the following happened: After update to 0.40

Reproduction Steps

After updating to mpv 0.40, previously working output to aggregate audio devices stopped working correctly.

I am using an aggregate audio device with a single multi-channel audio interface so that I can use my speakers, which are on different outputs (3,4) than the headphones (1,2), by just quickly changing audio devices.

This is accomplished by creating an aggregate audio device in MacOS's "Audio MIDI Setup" application, selecting the audio interface, and then clicking the Configure Speakers... button, and then setting the Configuration to Stereo and the Left and Right channels to the appropriate interface outputs.

I then set this new aggregate device as the default output device for MacOS

My mpv config includes audio-channels=stereo to ensure I only ever output to two channels. The issue occurs without this as well.

Expected Behavior

I expect that mpv will output audio on the correct outputs, like other applications.

Actual Behavior

mpv shows in the info OSD that it is outputting to a single (1) channel, and I hear audio in the left channel for my headphones (the first channel on the audio interface)

The issue did not occur before 0.40

Log File

output.txt

Sample Files

24bittest.flac.zip

I carefully read all instruction and confirm that I did the following:

  • [x] I tested with the latest mpv version to validate that the issue is not already fixed.
  • [x] I provided all required information including system and mpv version.
  • [x] I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of --log-file=output.txt.
  • [x] I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • [x] I attached the full, untruncated log file.
  • [x] I attached the backtrace in the case of a crash.

lbatalha avatar Apr 08 '25 17:04 lbatalha

probably related to #15622 / https://github.com/mpv-player/mpv/commit/06fe665b789ffca7c6716cd4ca2fec7e2d0f54be

any idea @ruihe774?

the crucial part in the log.

...
[   0.076][v][af] [in] 88200Hz stereo 2ch s32
[   0.076][v][af] [userspeed] 88200Hz stereo 2ch s32
[   0.076][v][af] [userspeed] (disabled)
[   0.076][v][af] [convert] 88200Hz stereo 2ch s32
[   0.076][v][cplayer] Set property: user-data/osc/margins={"b":0,"r":0,"l":0,"t":0} -> 1
[   0.076][v][ao] Trying audio driver 'coreaudio'
[   0.076][v][ao/coreaudio] requested format: 88200 Hz, stereo channels, s32
[   0.076][v][lavf] EOF reached.
[   0.083][i][SimpleHistory] Added the below into history
[   0.083][i][SimpleHistory] 24bittest.flac šŸ•’ 00:00:00.000
[   0.124][v][ao/coreaudio] selected audio output device: Speakers (85)
[   0.125][v][ao/coreaudio] input channel layout:
[   0.125][v][ao/coreaudio] audio channel layout: tag: <0>, descriptions <6>
[   0.125][v][ao/coreaudio]  - description 0: label <4294967295, 64>,  flags: <0>
[   0.125][v][ao/coreaudio]  - description 1: label <4294967295, 64>,  flags: <0>
[   0.125][v][ao/coreaudio]  - description 2: label <1, 0>,  flags: <2>, coords: <-30.000000, 0.000000, 1.000000>
[   0.125][v][ao/coreaudio]  - description 3: label <2, 1>,  flags: <2>, coords: <30.000000, 0.000000, 1.000000>
[   0.125][v][ao/coreaudio]  - description 4: label <4294967295, 64>,  flags: <0>
[   0.125][v][ao/coreaudio]  - description 5: label <4294967295, 64>,  flags: <0>
[   0.125][v][ao/coreaudio] mp chmap: na-na-fl-fr-na-na
[   0.125][v][ao/coreaudio] input channel layout:
[   0.125][v][ao/coreaudio] audio channel layout: tag: <0>, descriptions <2>
[   0.125][v][ao/coreaudio]  - description 0: label <3, 2>,  flags: <0>
[   0.125][v][ao/coreaudio]  - description 1: label <4, 3>,  flags: <0>
[   0.125][v][ao/coreaudio] mp chmap: fc-lfe
[   0.125][v][ao/coreaudio] Channel layouts:
[   0.125][v][ao/coreaudio]  - na-na-fl-fr-na-na
[   0.125][v][ao/coreaudio]  - fc-lfe
[   0.125][v][ao/coreaudio]  - mono
[   0.125][v][ao/coreaudio] result: mono
[   0.125][v][ao/coreaudio] audio channel layout: tag: <0>, descriptions <1>
[   0.125][v][ao/coreaudio]  - description 0: label <3, 2>,  flags: <0>
[   0.141][v][ao/coreaudio] Latency property cntl: 72 frames
[   0.141][v][ao/coreaudio] Latency property zisf: 512 frames
[   0.141][v][ao/coreaudio] Latency property tfas: 73 frames
[   0.141][v][ao/coreaudio] Device sample rate: 48000.000000
[   0.141][v][ao/coreaudio] audiounit latency [ns]: 192743
[   0.141][v][ao/coreaudio] device latency [ns]: 13687500
[   0.141][v][ao/coreaudio] device buffer: 2448 samples.
[   0.141][v][ao/coreaudio] using soft-buffer of 17640 samples.
[   0.141][i][cplayer] AO: [coreaudio] 88200Hz mono 1ch s32
[   0.141][v][cplayer] AO: Description: CoreAudio AudioUnit
[   0.141][v][autoconvert] inserting resampler
[   0.141][v][swresample] format change, reinitializing resampler
[   0.141][v][swresample] 88200Hz stereo s32 -> 88200Hz mono s32
[   0.141][v][swresample] Remix: stereo -> mono
[   0.141][v][af] [out] 88200Hz mono 1ch s32
...

Akemi avatar Apr 08 '25 18:04 Akemi

@lbatalha Please attach a screenshot of your Audio MIDI Setup to help me know your configuration.

ruihe774 avatar Apr 08 '25 23:04 ruihe774

Image Image

lbatalha avatar Apr 08 '25 23:04 lbatalha

I’m having the same issue on macOS Sequoia 15.4.1 with a Universal Audio Twin MKII audio interface.

  • Source of mpv: https://formulae.brew.sh/formula/mpv
  • Latest known working version: 0.39.x
  • Issue started after the following happened: After update to 0.40

romanskorobagatko avatar May 22 '25 06:05 romanskorobagatko

Just a quick FYI for anyone currently affected by this, setting the AO to avfoundation appears to be a decent temporary fix to get audio working.

lbatalha avatar Jun 15 '25 18:06 lbatalha

I've got it again, what is "AO"?

romanskorobagatko avatar Jul 28 '25 23:07 romanskorobagatko

Audio outputs. You can use --ao=help to see the list.


From: Roman Skorobagatko @.> Sent: Tuesday, July 29, 2025 7:59:40 AM To: mpv-player/mpv @.> Cc: Rui He @.>; Mention @.> Subject: Re: [mpv-player/mpv] Since 0.40 Incorrect audio output on MacOS when using Aggregate Audio Devices (Issue #16210)

[https://avatars.githubusercontent.com/u/64922803?s=20&v=4]romanskorobagatko left a comment (mpv-player/mpv#16210)https://github.com/mpv-player/mpv/issues/16210#issuecomment-3130158313

I've got it again, what is "AO"?

― Reply to this email directly, view it on GitHubhttps://github.com/mpv-player/mpv/issues/16210#issuecomment-3130158313, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A4GNBY5JKTM4GBUCUDLBIVD3K22OZAVCNFSM6AAAAAB2W5GEEKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCMZQGE2TQMZRGM. You are receiving this because you were mentioned.Message ID: @.***>

ruihe774 avatar Jul 29 '25 00:07 ruihe774