Open Bug 1627827 Opened 4 years ago Updated 10 months ago

Audio goes wrong channel with Motu 828 mkii

Categories

(Core :: Audio/Video: cubeb, defect, P5)

Desktop
macOS
defect

Tracking

()

People

(Reporter: chunmin, Assigned: chunmin, NeedInfo)

References

(Blocks 1 open bug)

Details

(Whiteboard: [media-audio])

Attachments

(1 file)

Per bug 1475145 comment 14, when using Motu 828 mkii, the audio goes to the different channels than what the user defines.

Steps-To-Reproduce:

  1. Set the Motu 828 mkii to 5.1 Surround (via Audio MIDI Setup) with non-main output channels.
    • The Front-Left and Front-Right channels are L and R, where L and R must not be main-1 and main-2
  2. Set the Motu 828 mkii to 2.0 Surround (via Audio MIDI Setup) with channel main-1 and main-2
  3. Set the Motu 828 mkii to the default output device
  4. Play an audio/video
Expected Result

The 2.0 Surround output sound are from main-1 and main-2

Actual Result

The 2.0 Surround output sound are from L and R

The channel label/number is defined by the document here: https://www.dropbox.com/s/h69uguo5pumoxig/Airfoil%20with%20MOTU%20828mkii.pdf?dl=0

Jacob,

Can you check if the comment 0 is the way to reproduce the problem? If so, can you open the terminal and type the following command to launch the Firefox Nightly?

MOZ_LOG="cubeb:5" /Applications/Firefox\ Nightly.app/Contents/MacOS/firefox-bin

It should give us a log about what the device channel layout is caught by *Firefox. You may see a lot of info like:

[Child xxx: MediaDecoderStateMachine #x]: E/cubeb /builds/worker/checkouts/gecko/third_party/rust/cubeb-coreaudio/src/backend/mod.rs:2678: (0x123456789) Output audiounit init with device 123 successfully.

The device layout info will be logged when the input source has a different layout from the output device(e.g., input source is audio 5.1 but the device is stereo), or the input source's channel requirement is different from the channel count provided by the device(e.g., the input source is 2-channel audio but the device has 10 channels). I think the latter meets your case. You can open any 2-channel audio with the Motu 828 mkii, which has more than 2 channels. That should give us the log about the device-channel layout we got in Firefox.

When you get it, can you paste the logs here?

Flags: needinfo?(yakuba42)

I remember MOTU 828 series device caused another issue before: https://bugzilla.mozilla.org/show_bug.cgi?id=1406981#c2. It's different, but I put a note here in case I need it.

Michael,

Is your MOTU 828mk3 still on duty? I was wondering if you can help to see if Firefox has issues when routing channels with MOTU 828 device. It seems the sounds may go to different channels than what users set. On Mac OS, if the MOTU 828 device is set to 2.0 Surround via Audio MIDI Setup witch channel X and Y, does the sound always come from channel X and Y?

Flags: needinfo?(mfroman)

(In reply to C.M.Chang[:chunmin] from comment #2)

I remember MOTU 828 series device caused another issue before: https://bugzilla.mozilla.org/show_bug.cgi?id=1406981#c2. It's different, but I put a note here in case I need it.

Michael,

Is your MOTU 828mk3 still on duty? I was wondering if you can help to see if Firefox has issues when routing channels with MOTU 828 device. It seems the sounds may go to different channels than what users set. On Mac OS, if the MOTU 828 device is set to 2.0 Surround via Audio MIDI Setup witch channel X and Y, does the sound always come from channel X and Y?

In my case, Lf and Rf settings in 5.1 Surround and 2.0 Surround are intrinsically linked. For example, if I go to 5.1 Surround and set Lf->5 and Rf->6 and hit apply, and then go to 2.0 Surround, Lf->5 and Rf->6. If I then set 2.0 Surround Lf->9 and Rf->10 and hit apply, when I go to view 5.1 Surround it will also have Lf->9 and Rf->10. These do not appear to be independant settings.

Now, I'll experiment with the 2.0 Surround setting:
If I set Lf->3 and Rf->4, I get output on 1 and 2 (not Main-L, Main-R).
If I set Lf->5 and Rf->6, I get output on 3 and 4.
If I set Lf->7 and Rf->8, I get output on 5 and 6.
If I set Lf->9 and Rf->10, I get output on 7 and 8.

I'll paste logs next.

Flags: needinfo?(mfroman)

Watching a youtube video (https://www.youtube.com/watch?v=BZoKh2fFH1E) with the 2.0 Surround configuration selected, Lf-7 and Rf->8 with actual output on 5 and 6. It seems like channels off by two.
Logs:

mfroman$ MOZ_LOG="cubeb:5" /Applications/Firefox\ Nightly.app/Contents/MacOS/firefox-bin
[(null) 49543: Main Thread]: V/cubeb media.cubeb.force_null_context: false
[(null) 49543: Main Thread]: V/cubeb media.cubeb.sandbox: false
[(null) 49543: Unnamed thread 0x100e41840]: E/cubeb /builds/worker/checkouts/gecko/media/libcubeb/src/cubeb_log.cpp:80: Starting cubeb log
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
[Child 49546: Main Thread]: V/cubeb media.cubeb.force_null_context: false
[Child 49546: Main Thread]: V/cubeb media.cubeb.sandbox: false
[Child 49546: Unnamed thread 0x107459a00]: E/cubeb /builds/worker/checkouts/gecko/media/libcubeb/src/cubeb_log.cpp:80: Starting cubeb log
[Child 49547: Main Thread]: V/cubeb media.cubeb.force_null_context: false
[Child 49547: Main Thread]: V/cubeb media.cubeb.sandbox: false
[Child 49547: Unnamed thread 0x106e5a840]: E/cubeb /builds/worker/checkouts/gecko/media/libcubeb/src/cubeb_log.cpp:80: Starting cubeb log
[Child 49549: Main Thread]: V/cubeb media.cubeb.force_null_context: false
[Child 49549: Main Thread]: V/cubeb media.cubeb.sandbox: false
[Child 49549: Unnamed thread 0x10a85a840]: E/cubeb /builds/worker/checkouts/gecko/media/libcubeb/src/cubeb_log.cpp:80: Starting cubeb log
[Child 49546: MediaPlayback #2]: I/cubeb media.cubeb.sandbox: false
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
[Child 49546: MediaDecoderStateMachine #1]: E/cubeb /builds/worker/checkouts/gecko/third_party/rust/cubeb-coreaudio/src/backend/mod.rs:2069: Use global latency 512 instead of the requested latency 4800.
[Child 49546: MediaDecoderStateMachine #1]: E/cubeb /builds/worker/checkouts/gecko/third_party/rust/cubeb-coreaudio/src/backend/mod.rs:213: Creating a default device info.
[Child 49546: MediaDecoderStateMachine #1]: E/cubeb /builds/worker/checkouts/gecko/third_party/rust/cubeb-coreaudio/src/backend/mod.rs:218: Requesting default system device.
[Child 49546: MediaDecoderStateMachine #1]: E/cubeb /builds/worker/checkouts/gecko/third_party/rust/cubeb-coreaudio/src/backend/mod.rs:2524: (0x199caa400) Initialize output by device info: device_info { id: 97, flags: DEV_OUTPUT | DEV_SYSTEM_DEFAULT | DEV_SELECTED_DEFAULT }
[Child 49546: MediaDecoderStateMachine #1]: E/cubeb /builds/worker/checkouts/gecko/third_party/rust/cubeb-coreaudio/src/backend/mod.rs:2535: (0x199caa400) Opening output side: rate 48000, channels 2, format Float32LE, layout FRONT_LEFT | FRONT_RIGHT, prefs NONE, latency in frames 512.
[Child 49546: MediaDecoderStateMachine #1]: E/cubeb /builds/worker/checkouts/gecko/third_party/rust/cubeb-coreaudio/src/backend/mod.rs:2573: (0x199caa400) Output hardware description: AudioStreamBasicDescription { mSampleRate: 48000.0, mFormatID: 1819304813, mFormatFlags: 41, mBytesPerPacket: 4, mFramesPer
[Child 49546: MediaDecoderStateMachine #1]: E/cubeb /builds/worker/checkouts/gecko/third_party/rust/cubeb-coreaudio/src/backend/mod.rs:2594: Incompatible channel layouts detected, setting up remixer
[Child 49546: MediaDecoderStateMachine #1]: E/cubeb /builds/worker/checkouts/gecko/third_party/rust/cubeb-coreaudio/src/backend/mixer.rs:179: Create a mixer with input channel count: 2, input layout: FRONT_LEFT | FRONT_RIGHT, out channel count: 14, output channels: [Silence, Silence, Silence, Silence, Sile
[Child 49546: MediaDecoderStateMachine #1]: E/cubeb /builds/worker/checkouts/gecko/third_party/rust/cubeb-coreaudio/src/backend/mixer.rs:82: Create an floating type(f32) mixer
[Child 49546: MediaDecoderStateMachine #1]: E/cubeb /builds/worker/checkouts/gecko/third_party/rust/cubeb-coreaudio/src/backend/mod.rs:1168: The buffer frame size of AudioUnit 0x8c18a06f for OUTPUT is already 512
[Child 49546: MediaDecoderStateMachine #1]: E/cubeb /builds/worker/checkouts/gecko/third_party/rust/cubeb-coreaudio/src/backend/mod.rs:2678: (0x199caa400) Output audiounit init with device 97 successfully.
[Child 49546: MediaDecoderStateMachine #1]: E/cubeb /builds/worker/checkouts/gecko/third_party/rust/cubeb-coreaudio/src/backend/mod.rs:2124: (0x70000444ccc0) Cubeb stream init successful.
[Child 49546: MediaDecoderStateMachine #1]: E/cubeb /builds/worker/checkouts/gecko/third_party/rust/cubeb-coreaudio/src/backend/mod.rs:3313: Cubeb stream (0x199caa400) started successfully.
[Child 49546: Unnamed thread 0x199c34a00]: E/cubeb /builds/worker/checkouts/gecko/third_party/rust/cubeb-coreaudio/src/backend/mod.rs:537: (0x199caa400) output: buffers 1, size 28672, channels 14, frames 512.
[Child 49546: Unnamed thread 0x199c34a00]: E/cubeb /builds/worker/checkouts/gecko/third_party/rust/cubeb-coreaudio/src/backend/mod.rs:537: (0x199caa400) output: buffers 1, size 28672, channels 14, frames 512.
<snip>
[Child 49546: Unnamed thread 0x199c34a00]: E/cubeb /builds/worker/checkouts/gecko/third_party/rust/cubeb-coreaudio/src/backend/mod.rs:537: (0x199caa400) output: buffers 1, size 28672, channels 14, frames 512.
[Child 49546: Unnamed thread 0x199c34a00]: E/cubeb /builds/worker/checkouts/gecko/third_party/rust/cubeb-coreaudio/src/backend/mod.rs:537: (0x199caa400) output: buffers 1, size 28672, channels 14, frames 512.
[Child 49546: MediaDecoderStateMachine #1]: E/cubeb /builds/worker/checkouts/gecko/third_party/rust/cubeb-coreaudio/src/backend/mod.rs:3330: Cubeb stream (0x199caa400) stopped successfully.
[Child 49546: MediaDecoderStateMachine #1]: E/cubeb /builds/worker/checkouts/gecko/third_party/rust/cubeb-coreaudio/src/backend/mod.rs:3330: Cubeb stream (0x199caa400) stopped successfully.
[Child 49546: MediaDecoderStateMachine #1]: E/cubeb /builds/worker/checkouts/gecko/third_party/rust/cubeb-coreaudio/src/backend/mod.rs:3284: Cubeb stream (0x199caa400) destroyed successful.

(In reply to Michael Froman [:mjf] from comment #4)

Thanks a lot for getting the log!

I noticed the log I need is cut:

[Child 49546: MediaDecoderStateMachine #1]: E/cubeb /builds/worker/checkouts/gecko/third_party/rust/cubeb-coreaudio/src/backend/mixer.rs:179: Create a mixer with input channel count: 2, input layout: FRONT_LEFT | FRONT_RIGHT, out channel count: 14, output channels: [Silence, Silence, Silence, Silence, Sile

This is a bug so I will solve it in bug 1628132 and then try again to get that info.

Depends on: 1628132
Attached file Log for CM 040920
Hi C.M.,
Finally catching up to your request.  Yeah, comment 0 is correct.  Also in that set-up, Main Outs are same as Surround 2.0, e.g. Output 1/2.

Yeah, as shown in my original graphic, channels in surround are off by two, though not sure if it matters for our concern since the question is why does Firefox and Finder level audio go out Surround 5.1 (L/R=7/8 in my case) while Spotify and other apps do respect the Main Out assignment.

I tried this interesting though but didn't work on recommendation from the guys at Rogue:  So this actually looks like a bug with Apple's underlying audio system, but we were able to identify what's going on with it and how to fix it.  What you'll want to do is go back to the Audio MIDI Setup utility, and switch the device's sound configuration to a stereo setting. Then, set the left/right stereo pair to be the same as the left front/right front in the surround configuration, apply that change, and then switch your configuration back to the surround configuration. That makes everything work and produce the expected results whether or not an app like Firefox is capable of addressing those additional channels.

Hope I did this log for you correctly:

Hi C.M.,
Finally catching up to your request. Yeah, comment 0 is correct. Also in that set-up, Main Outs are same as Surround 2.0, e.g. Output 1/2.

Yeah, as shown in my original graphic, channels in surround are off by two, though not sure if it matters for our concern since the question is why does Firefox and Finder level audio go out Surround 5.1 (L/R=7/8 in my case) while Spotify and other apps do respect the Main Out assignment.

I tried this interesting though but didn't work on recommendation from the guys at Rogue: So this actually looks like a bug with Apple's underlying audio system, but we were able to identify what's going on with it and how to fix it. What you'll want to do is go back to the Audio MIDI Setup utility, and switch the device's sound configuration to a stereo setting. Then, set the left/right stereo pair to be the same as the left front/right front in the surround configuration, apply that change, and then switch your configuration back to the surround configuration. That makes everything work and produce the expected results whether or not an app like Firefox is capable of addressing those additional channels.

Hope I did this log for you correctly as attachment.

Many thanks Jacob

Flags: needinfo?(yakuba42)

Hope I did this log for you correctly as attachment.

C.M.
Not sure how to attach, sorry.
Will send via the email you sent.
Jacob

Hi, Michael, yakuba42

Since we had a defect in the logging mechanism, the log message for the channel layout above is cut. Now the problem is solved (bug 1628132). Would you mind getting the log again? The following command should work (use MOZ_LOG="cubeb:4" instead of MOZ_LOG="cubeb:5").

MOZ_LOG="cubeb:4" /Applications/Firefox\ Nightly.app/Contents/MacOS/firefox-bin

or (if you have gecko source code)

MOZ_LOG="cubeb:4" ./mach run

Aside from that, could you also list the channel layout in Audio MIDI Setup > Configure Speakers that is used in testing?

I'd like to check the channel layout in Audio MIDI Setup > Configure Speakers is mapped to the channel layout we got from the log. For example, a 64-channel device configured to audio 5.1 Surround settings as follow

channel order
Left (FrontLeft) 2
Right (FrontRight) 1
Center (FrontCenter) 4
Subwoofer (LowFrequency) 3
Left Surround (BackLeft) 5
Right Surround (BackRight) 6

will have an output channels like

[Child 31951: MediaDecoderStateMachine #1]: E/cubeb mixer.rs:182: Create a mixer with input channel count: 2, input layout: FRONT_LEFT | FRONT_RIGHT, out channel count: 64, output channels: [FrontRight, FrontLeft, LowFrequency, FrontCenter, BackLeft, BackRight, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence]

And the output channels: [ FrontRight, FrontLeft, LowFrequency, FrontCenter, BackLeft, BackRight, Silence, ...] is mapped to the order defined in Audio MIDI Setup > Configure Speakers.

Flags: needinfo?(yakuba42)
Flags: needinfo?(mfroman)

Thanks for your reply, here's that new log:

Last login: Thu Apr 23 09:53:29 on console

The default interactive shell is now zsh.
To update your account to use zsh, please run chsh -s /bin/zsh.
For more details, please visit https://support.apple.com/kb/HT208050.
DarthTower-2:~ DarthTower$ MOZ_LOG="cubeb:4" /Applications/Firefox\ Nightly.app/Contents/MacOS/firefox-binMOZ_LOG="cubeb:4" /Applications/Firefox\ Nightly.app/Contents/MacOS/firefox-bin
-bash: /Applications/Firefox Nightly.app/Contents/MacOS/firefox-binMOZ_LOG=cubeb:4: No such file or directory
DarthTower-2:~ DarthTower$ MOZ_LOG="cubeb:4" /Applications/Firefox\ Nightly.app/Contents/MacOS/firefox-bin
DarthTower-2:~ DarthTower$ Unable to read VR Path Registry from /Users/DarthTower/Library/Application Support/OpenVR/.openvr/openvrpaths.vrpath
DarthTower-2:~ DarthTower$ MOZ_LOG="cubeb:4" /Applications/Firefox\ Nightly.app/Contents/MacOS/firefox-bin
DarthTower-2:~ DarthTower$ [Child 13783: MediaPlayback #1]: I/cubeb media.cubeb.sandbox: false
[Child 13783: MediaDecoderStateMachine #1]: E/cubeb mod.rs:2160: Use global latency 512 instead of the requested latency 4800.
[Child 13783: MediaDecoderStateMachine #1]: E/cubeb mod.rs:213: Creating a default device info.
[Child 13783: MediaDecoderStateMachine #1]: E/cubeb mod.rs:218: Requesting default system device.
[Child 13783: MediaDecoderStateMachine #1]: E/cubeb mod.rs:2615: (0x17010e400) Initialize output by device info: device_info { id: 76, flags: DEV_OUTPUT | DEV_SYSTEM_DEFAULT | DEV_SELECTED_DEFAULT }
[Child 13783: MediaDecoderStateMachine #1]: E/cubeb mod.rs:2626: (0x17010e400) Opening output side: rate 48000, channels 2, format Float32LE, layout FRONT_LEFT | FRONT_RIGHT, prefs NONE, latency in frames 512.
[Child 13783: MediaDecoderStateMachine #1]: E/cubeb mod.rs:2664: (0x17010e400) Output hardware description: AudioStreamBasicDescription { mSampleRate: 44100.0, mFormatID: 1819304813, mFormatFlags: 41, mBytesPerPacket: 4, mFramesPerPacket: 1, mBytesPerFrame: 4, mChannelsPerFrame: 22, mBitsPerChannel: 32, mReserved: 0 }
[Child 13783: MediaDecoderStateMachine #1]: E/cubeb mod.rs:2685: Incompatible channel layouts detected, setting up remixer
[Child 13783: MediaDecoderStateMachine #1]: E/cubeb mixer.rs:182: Create a mixer with input channel count: 2, input layout: FRONT_LEFT | FRONT_RIGHT, out channel count: 22, output channels: [Silence, Silence, Silence, Silence, FrontCenter, LowFrequency, FrontLeft, FrontRight, BackLeft, BackRight, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence]
[Child 13783: MediaDecoderStateMachine #1]: E/cubeb mixer.rs:82: Create an floating type(f32) mixer
[Child 13783: MediaDecoderStateMachine #1]: E/cubeb mod.rs:1167: The buffer frame size of AudioUnit 0x835d70f2 for OUTPUT is already 512
[Child 13783: MediaDecoderStateMachine #1]: E/cubeb mod.rs:2769: (0x17010e400) Output audiounit init with device 76 successfully.
[Child 13783: MediaDecoderStateMachine #1]: E/cubeb mod.rs:2215: (0x700008bacd90) Cubeb stream init successful.
[Child 13783: MediaDecoderStateMachine #1]: E/cubeb mod.rs:3404: Cubeb stream (0x17010e400) started successfully.
[Child 13783: MediaDecoderStateMachine #1]: E/cubeb mod.rs:3421: Cubeb stream (0x17010e400) stopped successfully.
[Child 13783: MediaDecoderStateMachine #1]: E/cubeb mod.rs:3421: Cubeb stream (0x17010e400) stopped successfully.
[Child 13783: MediaDecoderStateMachine #1]: E/cubeb mod.rs:3375: Cubeb stream (0x17010e400) destroyed successful.

list the channel layout in Audio MIDI Setup > Configure Speakers that is used in testing?

This is for my MOTU 828mkii
channel order
Left (FrontLeft) 7
Right (FrontRight) 8
Center (FrontCenter) 5
Subwoofer (LowFrequency) 6
Left Surround (BackLeft) 9
Right Surround (BackRight) 10

Many thanks!
Jacob

Flags: needinfo?(yakuba42)

(In reply to yakuba42 from comment #10)

[Child 13783: MediaDecoderStateMachine #1]: E/cubeb mod.rs:2685: Incompatible channel layouts detected, setting up remixer
[Child 13783: MediaDecoderStateMachine #1]: E/cubeb mixer.rs:182: Create a mixer with input channel count: 2, input layout: FRONT_LEFT | FRONT_RIGHT, out channel count: 22, output channels: [Silence, Silence, Silence, Silence, FrontCenter, LowFrequency, FrontLeft, FrontRight, BackLeft, BackRight, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence]

Hi Jacob,

Thanks for the help! I do see the channel layout from Audio MIDI Setup > Configure Speakers

This is for my MOTU 828mkii
channel order
Left (FrontLeft) 7
Right (FrontRight) 8
Center (FrontCenter) 5
Subwoofer (LowFrequency) 6
Left Surround (BackLeft) 9
Right Surround (BackRight) 10

is mapped to what Firefox uses:

[Silence, Silence, Silence, Silence, FrontCenter, LowFrequency, FrontLeft, FrontRight, BackLeft, BackRight, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence]

There are 22 channels Firefox got.
The Left (FrontLeft) is mapped to 7th channel of the 22 channels
The Right (FrontRight) is mapped to 8th channel of the 22 channels
The Center (FrontCenter) is mapped to 5th channel of the 22 channels
The Subwoofer (LowFrequency) is mapped to 6th channel of the 22 channels
The Left Surround (BackLeft) is mapped to 9th channel of the 22 channels
The Right Surround (BackRight) is mapped to 10th channel of the 22 channels
All other channels are Silence.

So it means the channel layout Firefox use is the same as what users can set via Audio MIDI Setup (at least for audio 5.1). Can you also try to do the same for 2.0 Surround? I'd like to compare the channel layout set Audio MIDI Setup and what Firefox got from the log.

If the channel layout in Audio MIDI Setup is (Left->X, Right->Y), the FrontLeft and FrontRight should be the Xth and Yth in the channel layout. For example,

channel order
Left (FrontLeft) 5
Right (FrontRight) 7

should map to

[Silence, Silence, Silence, Silence, FrontLeft, Silence, FrontRight, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence]

If the channel layout Firefox uses is mapped to the user define's one in Audio MIDI Setup, either we do something wrong when mixing audio, or the problem is in the driver instead of Firefox's end.

If you have other devices, can you confirm that this issue only happens when using MOTU 828mkii? If it's a MOTU-828mkii-only problem, we need to have some special workaround for this device.

Flags: needinfo?(yakuba42)

So it means the channel layout Firefox use is the same as what users can set via Audio MIDI Setup (at least for audio 5.1). Can you also try to do the same for 2.0 Surround? I'd like to compare the channel layout set Audio MIDI Setup and what Firefox got from the log.

MOTU 828mkii Surround 2.0 is also set to 7/8, not sure if this log shows that:

Last login: Fri Apr 24 12:38:58 on console

The default interactive shell is now zsh.
To update your account to use zsh, please run chsh -s /bin/zsh.
For more details, please visit https://support.apple.com/kb/HT208050.
DarthTower-2:~ DarthTower$ MOZ_LOG="cubeb:4" /Applications/Firefox\ Nightly.app/Contents/MacOS/firefox-bin

[Child 5800: MediaPlayback #1]: I/cubeb media.cubeb.sandbox: false
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:2160: Use global latency 512 instead of the requested latency 4800.
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:213: Creating a default device info.
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:218: Requesting default system device.
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:2615: (0x17bb20000) Initialize output by device info: device_info { id: 76, flags: DEV_OUTPUT | DEV_SYSTEM_DEFAULT | DEV_SELECTED_DEFAULT }
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:2626: (0x17bb20000) Opening output side: rate 48000, channels 2, format Float32LE, layout FRONT_LEFT | FRONT_RIGHT, prefs NONE, latency in frames 512.
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:2664: (0x17bb20000) Output hardware description: AudioStreamBasicDescription { mSampleRate: 44100.0, mFormatID: 1819304813, mFormatFlags: 41, mBytesPerPacket: 4, mFramesPerPacket: 1, mBytesPerFrame: 4, mChannelsPerFrame: 22, mBitsPerChannel: 32, mReserved: 0 }
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:2685: Incompatible channel layouts detected, setting up remixer
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mixer.rs:182: Create a mixer with input channel count: 2, input layout: FRONT_LEFT | FRONT_RIGHT, out channel count: 22, output channels: [Silence, Silence, Silence, Silence, Silence, Silence, FrontLeft, FrontRight, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence]
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mixer.rs:82: Create an floating type(f32) mixer
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:1167: The buffer frame size of AudioUnit 0x816a80f2 for OUTPUT is already 512
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:2769: (0x17bb20000) Output audiounit init with device 76 successfully.
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:2215: (0x70000dda8d90) Cubeb stream init successful.
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:3404: Cubeb stream (0x17bb20000) started successfully.
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:3421: Cubeb stream (0x17bb20000) stopped successfully.
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:3421: Cubeb stream (0x17bb20000) stopped successfully.
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:3375: Cubeb stream (0x17bb20000) destroyed successful.
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:2160: Use global latency 512 instead of the requested latency 4800.
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:213: Creating a default device info.
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:218: Requesting default system device.
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:2615: (0x17c315400) Initialize output by device info: device_info { id: 76, flags: DEV_OUTPUT | DEV_SYSTEM_DEFAULT | DEV_SELECTED_DEFAULT }
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:2626: (0x17c315400) Opening output side: rate 48000, channels 2, format Float32LE, layout FRONT_LEFT | FRONT_RIGHT, prefs NONE, latency in frames 512.
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:2664: (0x17c315400) Output hardware description: AudioStreamBasicDescription { mSampleRate: 44100.0, mFormatID: 1819304813, mFormatFlags: 41, mBytesPerPacket: 4, mFramesPerPacket: 1, mBytesPerFrame: 4, mChannelsPerFrame: 22, mBitsPerChannel: 32, mReserved: 0 }
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:2685: Incompatible channel layouts detected, setting up remixer
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mixer.rs:182: Create a mixer with input channel count: 2, input layout: FRONT_LEFT | FRONT_RIGHT, out channel count: 22, output channels: [Silence, Silence, Silence, Silence, Silence, Silence, FrontLeft, FrontRight, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence, Silence]
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mixer.rs:82: Create an floating type(f32) mixer
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:1167: The buffer frame size of AudioUnit 0x816a8101 for OUTPUT is already 512
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:2769: (0x17c315400) Output audiounit init with device 76 successfully.
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:2215: (0x70000dda8d90) Cubeb stream init successful.
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:3404: Cubeb stream (0x17c315400) started successfully.
[Child 5800: Unnamed thread 0x17944e1c0]: E/cubeb mod.rs:544: (0x17c315400) output shutdown.
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:3421: Cubeb stream (0x17c315400) stopped successfully.
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:3421: Cubeb stream (0x17c315400) stopped successfully.
[Child 5800: MediaDecoderStateMachine #1]: E/cubeb mod.rs:3375: Cubeb stream (0x17c315400) destroyed successful.
DarthTower-2:~ DarthTower$
DarthTower-2:~ DarthTower$

MOTU also has two MAIN OUTS 1/2 these are different outputs from Analog 1/2!!! I can't select Main Outs 1/2 within SURROUND 2.0 which only can have the same as the front L/R or 7/8 in my case. If I do put Surround 2.0 to 1/2, then Firefox does go out Main Outs, BUT for lots of wiring reasons, that config doesn't work for me. I want to have separate cables for surround and for main outs.

I don't have other surround devices to test but I can tell you that this problem also does happen when I play audio from the Finder: pressing spacebar on a selected audio file, also in Quicktime.

Hope that helps!

Thanks again for your thoughts,
Jacob

Since this happens with other apps besides Firefox,

(In reply to C.M.Chang[:chunmin] from comment #9)

Hi, Michael, yakuba42

Since we had a defect in the logging mechanism, the log message for the channel layout above is cut. Now the problem is solved (bug 1628132). Would you mind getting the log again? The following command should work (use MOZ_LOG="cubeb:4" instead of MOZ_LOG="cubeb:5").

MOZ_LOG="cubeb:4" /Applications/Firefox\ Nightly.app/Contents/MacOS/firefox-bin
[Child 84492: MediaDecoderStateMachine #1]: E/cubeb mixer.rs:182: Create a mixer with input channel count: 2, input layout: FRONT_LEFT | FRONT_RIGHT, out channel count: 14, output channels: [Silence, Silence, FrontCenter, LowFrequency, FrontLeft, FrontRight, Silence, Silence, BackLeft, BackRight, Silence, Silence, Silence, Silence]

channel order
Left (FrontLeft) 5
Right (FrontRight) 6
Center (FrontCenter) 3
Subwoofer (LowFrequency) 4
Left Surround (BackLeft) 9
Right Surround (BackRight) 10

Actual output was on channels 3 and 4.

Flags: needinfo?(mfroman)

For 2.0 surround settings:

[Child 84492: MediaDecoderStateMachine #3]: E/cubeb mixer.rs:182: Create a mixer with input channel count: 2, input layout: FRONT_LEFT | FRONT_RIGHT, out channel count: 14, output channels: [Silence, Silence, Silence, Silence, Silence, FrontLeft, Silence, FrontRight, Silence, Silence, Silence, Silence, Silence, Silence]

channel order
Left (FrontLeft) 6
Right (FrontRight) 8

In this case, output was actually on channels 4 and 6.

(In reply to yakuba42 from comment #12)

I don't have other surround devices to test but I can tell you that this problem also does happen when I play audio from the Finder: pressing spacebar on a selected audio file, also in Quicktime.

Since this problem happens without running Firefox and the channel layout Firefox got is mapped to the user's settings in Audio MIDI Setup, whether it's 2.0 surround or 5.1 surround. It's not really a problem caused by Firefox so I am going to make this P5.

According to comment 13 and comment 14, the left, right channel (x, y) is drifted to (x-2, y-2). I think the only thing we can do here is to have a special calculation setting for this device. On the other hand, bug 1475145 comment 14 mentioned Chrome could work with this device so it's better to see what chrome does.

Priority: P1 → P5
Whiteboard: [media-audio]

It's better to check what Chrome does here. One difference I spot is that Chrome set the channel-layout but Firefox doesn't.

Blocks: 1073786
Severity: normal → S4
Flags: needinfo?(yakuba42)

I, I have a problem with my Motu828x and Firefox on mac M1 Pro14" 2021.

When using my interface, Firefox is the only application that does not output sound on selected stereo output audio pair. It works when I select to output stereo audio to my main channel (MAin out 1 - 2) but not when the default stereo output is another pair (Output 2-3, 5-6 etc.)

It seems that firefox simply does not output on any of the motu channel when that's the case, and it's the only app. Do you have encountered a simlar problem?

Thanks
Theo

Flags: needinfo?(cchang)

Any movement here? I have this issue on my Mk3 Ultralight Hybrid. M1 Mac Pro 13.4.1.

It used to work fine but after making some audio channel changes, which I reverted... Firefox seems to have gotten its wires crossed.

Safari, Chrome, Mac OS and Spotify all play to the correct default two channels.

Please see https://support.mozilla.org/en-US/questions/1416979 for a more detailed description of my problem.

If a clean install of FF does not fix this, there must be a system preference or ini somewhere left over. Does FF change any other files not fixed in a refresh?

OK I finally got the "fix" detailed above to work. I don't remember the exact steps but it involves setting surround channels again, and going back again to the stereo "Main Out" setup I wanted. The key for me was to quit and reopen Firefox. It took a bit of playing around and magically came back at some point. As to why this only seems to negatively affect Firefox and not other apps is beyond me. But I'm glad there is a way out at least.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: