{"action":"created","issue":{"url":"https://api.github.com/repos/mpv-player/mpv/issues/5042","repository_url":"https://api.github.com/repos/mpv-player/mpv","labels_url":"https://api.github.com/repos/mpv-player/mpv/issues/5042/labels{/name}","comments_url":"https://api.github.com/repos/mpv-player/mpv/issues/5042/comments","events_url":"https://api.github.com/repos/mpv-player/mpv/issues/5042/events","html_url":"https://github.com/mpv-player/mpv/issues/5042","id":268785820,"node_id":"MDU6SXNzdWUyNjg3ODU4MjA=","number":5042,"title":"mpv does not map channels correctly on devices with more than 16 outputs","user":{"login":"Arve","id":481884,"node_id":"MDQ6VXNlcjQ4MTg4NA==","avatar_url":"https://avatars1.githubusercontent.com/u/481884?v=4","gravatar_id":"","url":"https://api.github.com/users/Arve","html_url":"https://github.com/Arve","followers_url":"https://api.github.com/users/Arve/followers","following_url":"https://api.github.com/users/Arve/following{/other_user}","gists_url":"https://api.github.com/users/Arve/gists{/gist_id}","starred_url":"https://api.github.com/users/Arve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Arve/subscriptions","organizations_url":"https://api.github.com/users/Arve/orgs","repos_url":"https://api.github.com/users/Arve/repos","events_url":"https://api.github.com/users/Arve/events{/privacy}","received_events_url":"https://api.github.com/users/Arve/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-10-26T14:35:28Z","updated_at":"2018-10-30T06:46:05Z","closed_at":null,"author_association":"NONE","body":"### mpv version and platform\r\n\r\nMacOS, latest release (Issues are visible in code on current master branch, see links below)\r\n\r\n### Reproduction steps\r\n\r\n1. Use audio device with more than 16 channels, and a surround layout\r\n2. Start mpv\r\n3. Play file with surround content\r\n\r\n### Expected behavior\r\n\r\n1. That mpv maps the channel layout correctly\r\n\r\n### Actual behavior\r\n\r\nmpv spits out the following error message in the log\r\n\r\n    [ 233.167][v][ao/coreaudio] layout has too many descriptions (76, max: 16)\r\n\r\nThis is due to the following define in https://github.com/mpv-player/mpv/blob/ae8b531207b3206b9ff1ab7d17092899bd67c565/audio/chmap.h#L25\r\n\r\n    #define MP_NUM_CHANNELS 16\r\n\r\nThis is then checked here: https://github.com/mpv-player/mpv/blob/ae8b531207b3206b9ff1ab7d17092899bd67c565/audio/out/ao_coreaudio_chmap.c#L172\r\n\r\nAfter this, mpv falls back to either of tfl-tfr layout or mono (seemingly depending on how the channel mapping is set up in Audio MIDI Setup).\r\n\r\nWhile I realize that this code is in as a fix for \"Problem with external audio interface on OS \r\nX\" (Bug #1249)  - it causes issues with a number of relatively commonplace multichannel audio interfaces that have channel counts that extend beyond 16."},"comment":{"url":"https://api.github.com/repos/mpv-player/mpv/issues/comments/434189771","html_url":"https://github.com/mpv-player/mpv/issues/5042#issuecomment-434189771","issue_url":"https://api.github.com/repos/mpv-player/mpv/issues/5042","id":434189771,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNDE4OTc3MQ==","user":{"login":"hmedia1","id":26698331,"node_id":"MDQ6VXNlcjI2Njk4MzMx","avatar_url":"https://avatars2.githubusercontent.com/u/26698331?v=4","gravatar_id":"","url":"https://api.github.com/users/hmedia1","html_url":"https://github.com/hmedia1","followers_url":"https://api.github.com/users/hmedia1/followers","following_url":"https://api.github.com/users/hmedia1/following{/other_user}","gists_url":"https://api.github.com/users/hmedia1/gists{/gist_id}","starred_url":"https://api.github.com/users/hmedia1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmedia1/subscriptions","organizations_url":"https://api.github.com/users/hmedia1/orgs","repos_url":"https://api.github.com/users/hmedia1/repos","events_url":"https://api.github.com/users/hmedia1/events{/privacy}","received_events_url":"https://api.github.com/users/hmedia1/received_events","type":"User","site_admin":false},"created_at":"2018-10-30T06:46:05Z","updated_at":"2018-10-30T06:46:05Z","author_association":"NONE","body":"I've tested with an actual 16 channel CoreAudio device.\r\n\r\nChannels map correctly but driver fails.  If I use `--audio-device=coreaudio_exclusive` I get playback, but, surprise -> down mixed to stereo (even with all combinations of `--ad-lavc-downmix`,  `--coreaudio-change-physical-format`, and `--audio-channels=auto`\r\n\r\n**can't link audio unit to selected device**\r\n\r\n```\r\n[cplayer] Starting playback...\r\n[af] [in] 48000Hz unknown16 (empty) 16ch \r\n[af] [userspeed] 48000Hz unknown16 (empty) 16ch \r\n[af] [userspeed] (disabled)\r\n[af] [convert] 48000Hz unknown16 (empty) 16ch \r\n[ao] Trying audio driver 'coreaudio'\r\n[ao] Using preferred device 'AppleUSBAudioEngine:KLARK TEKNIK:DN32-USB:0A9D35E6:1,2'\r\n[ao/coreaudio] requested format: 48000 Hz, unknown16 channels, floatp\r\n[ao/coreaudio] selected audio output device: DN32-USB (68)\r\n[ao/coreaudio] Found 1 substream(s).\r\n[ao/coreaudio] Looking at formats in substream 0...\r\n[ao/coreaudio] -  48000.0Hz 24bit mcpl [4][64bpp][1fbp][64bpf][16ch] int LE S (-)\r\n[ao/coreaudio] -  48000.0Hz 24bit mcpl [68][64bpp][1fbp][64bpf][16ch] int LE S (-)\r\n[ao/coreaudio] Requested format already set, not changing.\r\n[ao/coreaudio] input channel layout:\r\n[ao/coreaudio] layout: tag: <0>, bitmap: <0>, descriptions <16>\r\n[ao/coreaudio]  - description 0: label <1, 0>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 1: label <2, 1>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 2: label <5, 4>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 3: label <6, 5>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 4: label <3, 2>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 5: label <9, 8>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 6: label <35, 31>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 7: label <36, 32>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 8: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 9: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 10: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 11: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 12: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 13: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 14: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 15: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio] mp chmap: fl-fr-bl-br-fc-bc-wl-wr-na-na-na-na-na-na-na-na\r\n[ao/coreaudio] input channel layout:\r\n[ao/coreaudio] layout: tag: <0>, bitmap: <0>, descriptions <2>\r\n[ao/coreaudio]  - description 0: label <1, 0>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 1: label <2, 1>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio] mp chmap: stereo\r\n[ao/coreaudio] Channel layouts:\r\n[ao/coreaudio]  - fl-fr-bl-br-fc-bc-wl-wr-na-na-na-na-na-na-na-na\r\n[ao/coreaudio]  - stereo\r\n[ao/coreaudio]  - mono\r\n[ao/coreaudio] result: fl-fr-bl-br-fc-bc-wl-wr-na-na-na-na-na-na-na-na\r\n[ao/coreaudio] can't link audio unit to selected device ([157][213][255][255]/-10851)\r\n[ao] Failed to initialize audio driver 'coreaudio'\r\n[ao] This audio driver/device was forced with the --audio-device option.\r\n[ao] Try unsetting it.\r\n[cplayer] Could not open/initialize audio device -> no sound.\r\n[ad] Uninit decoder.\r\n[lavf] deselect track 1\r\n[cplayer] Audio: no audio\r\n[cplayer] playback restart complete\r\n[cplayer] EOF code: 6  \r\n[cplayer] finished playback, audio output initialization failed (reason 4)\r\n[cplayer] \r\n[cplayer] \r\n[cplayer] Exiting... (Errors when loading file)\r\n[osx] Exiting...\r\n[ytdl_hook] Exiting...\r\n[stats] Exiting...\r\n[osc] Exiting...\r\n```\r\n\r\nSame result when using the device in 32 channel mode, and recompiling with `MP_NUM_CHANNELS` to 32 :\r\n\r\n\r\n```\r\n[cplayer] Starting playback...\r\n[af] [in] 48000Hz unknown16 (empty) 16ch \r\n[af] [userspeed] 48000Hz unknown16 (empty) 16ch \r\n[af] [userspeed] (disabled)\r\n[af] [convert] 48000Hz unknown16 (empty) 16ch \r\n[ao] Trying audio driver 'coreaudio'\r\n[ao] Using preferred device 'AppleUSBAudioEngine:KLARK TEKNIK:DN32-USB:0A9D35E6:1,2'\r\n[ao/coreaudio] requested format: 48000 Hz, unknown16 channels, floatp\r\n[ao/coreaudio] selected audio output device: DN32-USB (68)\r\n[ao/coreaudio] Found 1 substream(s).\r\n[ao/coreaudio] Looking at formats in substream 0...\r\n[ao/coreaudio] -  48000.0Hz 24bit mcpl [4][128bpp][1fbp][128bpf][32ch] int LE S (-)\r\n[ao/coreaudio] -  48000.0Hz 24bit mcpl [68][128bpp][1fbp][128bpf][32ch] int LE S (-)\r\n[ao/coreaudio] Requested format already set, not changing.\r\n[ao/coreaudio] input channel layout:\r\n[ao/coreaudio] layout: tag: <0>, bitmap: <0>, descriptions <32>\r\n[ao/coreaudio]  - description 0: label <1, 0>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 1: label <2, 1>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 2: label <5, 4>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 3: label <6, 5>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 4: label <3, 2>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 5: label <9, 8>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 6: label <35, 31>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 7: label <36, 32>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 8: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 9: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 10: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 11: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 12: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 13: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 14: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 15: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 16: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 17: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 18: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 19: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 20: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 21: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 22: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 23: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 24: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 25: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 26: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 27: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 28: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 29: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 30: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 31: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio] mp chmap: fl-fr-bl-br-fc-bc-wl-wr-na-na-na-na-na-na-na-na-na-na-na-na-na-\r\n[ao/coreaudio] input channel layout:\r\n[ao/coreaudio] layout: tag: <0>, bitmap: <0>, descriptions <2>\r\n[ao/coreaudio]  - description 0: label <1, 0>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio]  - description 1: label <2, 1>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>\r\n[ao/coreaudio] mp chmap: stereo\r\n[ao/coreaudio] Channel layouts:\r\n[ao/coreaudio]  - fl-fr-bl-br-fc-bc-wl-wr-na-na-na-na-na-na-na-na-na-na-na-na-na-\r\n[ao/coreaudio]  - stereo\r\n[ao/coreaudio]  - mono\r\n[ao/coreaudio] result: fl-fr-bl-br-fc-bc-wl-wr-na-na-na-na-na-na-na-na-na-na-na-na-na-\r\n[ao/coreaudio] can't link audio unit to selected device ([157][213][255][255]/-10851)\r\n[ao] Failed to initialize audio driver 'coreaudio'\r\n[ao] This audio driver/device was forced with the --audio-device option.\r\n[ao] Try unsetting it.\r\n[cplayer] Could not open/initialize audio device -> no sound.\r\n[ad] Uninit decoder.\r\n[lavf] deselect track 0\r\n[cplayer] Audio: no audio\r\n[cplayer] playback restart complete\r\n[cplayer] EOF code: 6  \r\n[cplayer] finished playback, audio output initialization failed (reason 4)\r\n[cplayer] \r\n[cplayer] \r\n[cplayer] Exiting... (Errors when loading file)\r\n[osx] Exiting...\r\n[stats] Exiting...\r\n[ytdl_hook] Exiting...\r\n[osc] Exiting...\r\n```\r\n\r\nThing is - tools like `afplay` work fine when playing back a multi channel file (the same file I'm using for these `mpv` tests - it's just that I need to use `mpv` for other reasons.\r\n\r\n"}}
{"actor":{"display_login":"hmedia1"}}