Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IINA plays audio only in mono #4983

Open
EmersonHall opened this issue Jun 7, 2024 · 4 comments
Open

IINA plays audio only in mono #4983

EmersonHall opened this issue Jun 7, 2024 · 4 comments

Comments

@EmersonHall
Copy link

For some reason IINA only plays back audio in mono now. I tried multiple commands but none work.
VLC, the system audio and other audio applications like Tidal work just fine.

Is this a bug? Cause I found some older threads complaining about this issue. I like IINA but I can't use it like this unfortunately :(

@low-batt
Copy link
Contributor

low-batt commented Jun 7, 2024

On this:

For some reason IINA only plays back audio in mono now.

The "now" makes it sound like it used to work? Did this happen after an IINA upgrade?

For audio/video playback support IINA is using a library from the mpv project. IINA is involved with video, but audio is almost entirely handled by mpv.

A problem with mono audio was reported in IINA issue #4874. For that problem I searched mpv issues and found issue mpv-player/mpv#3065. This part was interesting:

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.

It appears that when mpv has trouble it drops back to mono.

What are you using for the audio device?

Currenting IINA (through mpv) is using the Core Audio framework. In the latest release of mpv support for the AVFoundation framework has been added. Unless problems are encountered IINA will be switching to the new audio driver when upgrading mpv. That work is in progress now and will be included in the beta release of the long planned feature release.

As we don't know what the problem you are encountering I can't say if the new audio driver will fix the problem or not. In scanning mpv commits there are lots of fixes in the audio area.

If you can provide a mpv log file I should be able to say more about what is going on. To enable logging follow these instructions:

  • Start IINA
  • Click on Settings… under the IINA menu
  • The settings panel appears
  • On the left side of the panel click on Advanced
  • Slide the Enable advanced settings toggle button to be on (blue)
  • Click on the checkbox Enable logging to file
  • Confirm the settings panel looks like the screenshot below
  • Restart IINA to activate logging
    enable-logging

Once IINA has restarted, try and play the video to reproduce the problem. Then:

  • Click on Settings… under the IINA menu
  • The settings panel appears
  • On the left side of the panel click on Advanced
  • Click on Open log directory
  • A new Finder window appears containing the logs for this session
  • Quit IINA to complete the log files

The Finder window contains two files, iina.log and mpv.log. To attach the log files to this issue, drag-n-drop them from the Finder window to the Leave a comment section below. Include both the iina.log and the mpv.log

The log files can also be accessed using Terminal as shown here:

low-batt@gag com.colliderli.iina$ pwd
/Users/low-batt/Library/Logs/com.colliderli.iina
low-batt@gag com.colliderli.iina$ ls
2022-10-04-17-57-15_jVrbWy
low-batt@gag com.colliderli.iina$ cd 2022-10-04-17-57-15_jVrbWy
low-batt@gag 2022-10-04-17-57-15_jVrbWy$ ls
iina.log	mpv.log
low-batt@gag 2022-10-04-17-57-15_jVrbWy$ 

With logging enabled IINA creates a new log directory each time it is started. If accessing the logs using Terminal be sure to obtain them from the latest log directory.

DO NOT FORGET to disable logging once you have obtained log files for the problem being investigated. IINA does not restrict the size of log files or delete old logs. If you leave logging enabled the logs will continue to accumulate.

@EmersonHall
Copy link
Author

On this:

For some reason IINA only plays back audio in mono now.

The "now" makes it sound like it used to work? Did this happen after an IINA upgrade?

For audio/video playback support IINA is using a library from the mpv project. IINA is involved with video, but audio is almost entirely handled by mpv.

A problem with mono audio was reported in IINA issue #4874. For that problem I searched mpv issues and found issue mpv-player/mpv#3065. This part was interesting:

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.

It appears that when mpv has trouble it drops back to mono.

What are you using for the audio device?

Currenting IINA (through mpv) is using the Core Audio framework. In the latest release of mpv support for the AVFoundation framework has been added. Unless problems are encountered IINA will be switching to the new audio driver when upgrading mpv. That work is in progress now and will be included in the beta release of the long planned feature release.

As we don't know what the problem you are encountering I can't say if the new audio driver will fix the problem or not. In scanning mpv commits there are lots of fixes in the audio area.

If you can provide a mpv log file I should be able to say more about what is going on. To enable logging follow these instructions:

  • Start IINA
  • Click on Settings… under the IINA menu
  • The settings panel appears
  • On the left side of the panel click on Advanced
  • Slide the Enable advanced settings toggle button to be on (blue)
  • Click on the checkbox Enable logging to file
  • Confirm the settings panel looks like the screenshot below
  • Restart IINA to activate logging
    enable-logging

Once IINA has restarted, try and play the video to reproduce the problem. Then:

  • Click on Settings… under the IINA menu
  • The settings panel appears
  • On the left side of the panel click on Advanced
  • Click on Open log directory
  • A new Finder window appears containing the logs for this session
  • Quit IINA to complete the log files

The Finder window contains two files, iina.log and mpv.log. To attach the log files to this issue, drag-n-drop them from the Finder window to the Leave a comment section below. Include both the iina.log and the mpv.log

The log files can also be accessed using Terminal as shown here:

low-batt@gag com.colliderli.iina$ pwd
/Users/low-batt/Library/Logs/com.colliderli.iina
low-batt@gag com.colliderli.iina$ ls
2022-10-04-17-57-15_jVrbWy
low-batt@gag com.colliderli.iina$ cd 2022-10-04-17-57-15_jVrbWy
low-batt@gag 2022-10-04-17-57-15_jVrbWy$ ls
iina.log	mpv.log
low-batt@gag 2022-10-04-17-57-15_jVrbWy$ 

With logging enabled IINA creates a new log directory each time it is started. If accessing the logs using Terminal be sure to obtain them from the latest log directory.

DO NOT FORGET to disable logging once you have obtained log files for the problem being investigated. IINA does not restrict the size of log files or delete old logs. If you leave logging enabled the logs will continue to accumulate.

Wow, thank you so much for the detailed answer!
I remember it working fine for the longest time, but I've updated it many times and mostly use tidal for music, so it's hard to say when it changed.
So I'm using IINA in my music studio on an M1pro Macbook and an audio interface with multichannel outputs ( my main monitoring is happening through a SPDIF output to a separate audio converter)

The outputs aren't 1-2 however (channel 17-18 is the standard output 1-2), so this may be what is causing this issue, as stereo works just fine when using the internal macbook speakers. This is strange since I changed the output settings to default to channel 17-18 in the audio midi settings for this interface.

I attached the log.
iina.log
mpv.log

Thanks again!

@low-batt
Copy link
Contributor

low-batt commented Jun 8, 2024

This line from the mpv log is key:

[   2.214][v][ao/coreaudio] layout has too many descriptions (32, max: 16)

Searching the mpv project I found issue mpv-player/mpv#5042 "mpv does not map channels correctly on devices with more than 16 outputs". That issue was closed by PR mpv-player/mpv#11174 "audio/chmap: support up to 64 channels" which was merged Sept 29, 2023.

The libmpv IINA is using is from before a little before mpv 0.36.0 which was released Jul 23, 2023, before this fix. The latest release is mpv 0.38.0 which was released on Apr 17, 2024.

I think it is likely the above mpv issue is responsible for the fallback to mono. Can't say for sure, but the change mpv has made may allow IINA to work in the case at hand. To know for sure you would have to test the mpv player. Normally I would investigate the current mpv player behavior, but I don't have the required audio hardware.

IINA may release another small bug fix release, but the main focus at the moment is on the long planned feature release. We are right at this moment working on upgrading to mpv 0.38.0.

As for why this used to work… I can't explain that. Could it be that in the past you had fewer outputs and were under the mpv limit?

The relevant messages in the mpv log:

mpv log::
[   2.214][v][ao] Trying audio driver 'coreaudio'
[   2.214][v][ao] Using preferred device 'com.antelope.3301419000152.32.32'
[   2.214][v][ao/coreaudio] requested format: 44100 Hz, stereo channels, floatp
[   2.214][v][ao/coreaudio] selected audio output device: Discrete8 (117)
[   2.214][v][ao/coreaudio] input channel layout:
[   2.214][v][ao/coreaudio] layout: tag: <0>, bitmap: <0>, descriptions <32>
[   2.214][v][ao/coreaudio]  - description 0: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 1: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 2: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 3: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 4: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 5: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 6: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 7: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 8: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 9: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 10: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 11: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 12: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 13: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 14: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 15: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 16: label <1, 0>,  flags: <2>, coords: <-30.000000, 0.000000, 1.000000>
[   2.214][v][ao/coreaudio]  - description 17: label <2, 1>,  flags: <2>, coords: <30.000000, 0.000000, 1.000000>
[   2.214][v][ao/coreaudio]  - description 18: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 19: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 20: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 21: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 22: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 23: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 24: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 25: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 26: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 27: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 28: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 29: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 30: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 31: label <4294967295, 64>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio] layout has too many descriptions (32, max: 16)
[   2.214][v][ao/coreaudio] input channel layout:
[   2.214][v][ao/coreaudio] layout: tag: <0>, bitmap: <0>, descriptions <2>
[   2.214][v][ao/coreaudio]  - description 0: label <17, 16>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio]  - description 1: label <18, 17>,  flags: <0>, coords: <0.000000, 0.000000, 0.000000>
[   2.214][v][ao/coreaudio] mp chmap: tbc-tbr
[   2.214][v][ao/coreaudio] Channel layouts:
[   2.214][v][ao/coreaudio]  - tbc-tbr
[   2.214][v][ao/coreaudio]  - mono
[   2.214][v][ao/coreaudio] result: mono

@EmersonHall
Copy link
Author

This line from the mpv log is key:

[   2.214][v][ao/coreaudio] layout has too many descriptions (32, max: 16)

Searching the mpv project I found issue mpv-player/mpv#5042 "mpv does not map channels correctly on devices with more than 16 outputs". That issue was closed by PR mpv-player/mpv#11174 "audio/chmap: support up to 64 channels" which was merged Sept 29, 2023.

The libmpv IINA is using is from before a little before mpv 0.36.0 which was released Jul 23, 2023, before this fix. The latest release is mpv 0.38.0 which was released on Apr 17, 2024.

I think it is likely the above mpv issue is responsible for the fallback to mono. Can't say for sure, but the change mpv has made may allow IINA to work in the case at hand. To know for sure you would have to test the mpv player. Normally I would investigate the current mpv player behavior, but I don't have the required audio hardware.

IINA may release another small bug fix release, but the main focus at the moment is on the long planned feature release. We are right at this moment working on upgrading to mpv 0.38.0.

As for why this used to work… I can't explain that. Could it be that in the past you had fewer outputs and were under the mpv limit?

The relevant messages in the mpv log:

mpv log::

Hey there,

so I checked if changing the spdif monitoring path from 17-18 to 15-16 would change but it's the same- still only mono sound. This may be caused by changing it from 1-2 to 15-16 but due to my setup I cannot send digital audio out to 1-2 anymore. This is very unfortunate since I grew to like IINA alot.

Thank you anyway for your help. At least we know what is causing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants