mpv-player / mpv-player/mpv

Mac OS X Core Audio Layout problem

Open
#3,065 19 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ao:coreaudio os:mac
Dominant language
C
Stars
37k
Forks
3.5k
Avg merge
1d 10h
Merged PRs (30d)
22

Description

Hello,

The handling of Core Audio layouts has a problem.

On multichannel systems there are 2 layouts, the "stereo" layout and the "multichannel" layout. The stereo layout is handled in an interesting way - it is "parsed" into an mpv layout the same way as the multichannel layout.

This should not be the case. Rather, mpv should simply assume that the stereo layout is in fact stereo, and send left and right audio to those channels.

Another option (at least on my system) would be for mpv to recognize that the layout "na-na-na-na-na-na-na-na-na-na-fl-fr" is stereo 2 channel on channels 11 and 12 and act accordingly. It doesnt seem to know how to handle nonstandard patching.

Attached is an example of this on my system. Left and Right are channels 11 and 12 on the audio interface, so mpv "parses" stereo as "sr-tc", has no idea what to do with this, and falls back to mono.

I realize that this may also be a symptom of a small bug in OS X but we can definitely work around this.

[ao] Trying audio driver 'coreaudio'
[ao/coreaudio] requested format: 48000 Hz, stereo channels, floatp
[ao/coreaudio] selected audio output device: Scarlett 8i6 USB (38)
[ao/coreaudio] input channel layout:
[ao/coreaudio] layout: tag: <0>, bitmap: <0>, descriptions <12>
[ao/coreaudio]  - description 0: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[ao/coreaudio]  - description 1: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[ao/coreaudio]  - description 2: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[ao/coreaudio]  - description 3: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[ao/coreaudio]  - description 4: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[ao/coreaudio]  - description 5: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[ao/coreaudio]  - description 6: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[ao/coreaudio]  - description 7: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[ao/coreaudio]  - description 8: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[ao/coreaudio]  - description 9: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[ao/coreaudio]  - description 10: label <1, 0>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[ao/coreaudio]  - description 11: label <2, 1>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[ao/coreaudio] mp chmap: na-na-na-na-na-na-na-na-na-na-fl-fr
[ao/coreaudio] input channel layout:
[ao/coreaudio] layout: tag: <0>, bitmap: <0>, descriptions <2>
[ao/coreaudio]  - description 0: label <11, 10>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[ao/coreaudio]  - description 1: label <12, 11>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[ao/coreaudio] mp chmap: sr-tc
[ao/coreaudio] Channel layouts:
[ao/coreaudio]  - na-na-na-na-na-na-na-na-na-na-fl-fr
[ao/coreaudio]  - sr-tc
[ao/coreaudio]  - mono
[ao/coreaudio] result: mono
[ao/coreaudio] Latency property cntl: 48 frames
[ao/coreaudio] Latency property zisf: 512 frames
[ao/coreaudio] Latency property tfas: 49 frames
[ao/coreaudio] audiounit latency [us]: 0
[ao/coreaudio] device latency [us]: 12687
[ao/coreaudio] using soft-buffer of 9600 samples.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Core Audio output handling identified by the logs and compare stereo versus multichannel layout parsing. Reproduce the Scarlett 8i6 USB case, then verify that a two-channel stereo request remains left/right rather than falling back to mono; no test or source file is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
audio-video-rtc
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.