Skip to content

Ocarina of Time [0400486024DEC000]: BGM stops when Pro Controller connects #1719

Closed

Description

@eerive

What happened

I started the game without a controller and walked to Kokiri Village with the keyboard. Music/BGM plays fine. As soon as I connect a Switch Pro Controller over USB (or Bluetooth / different USB ports tested too), the music stops completely while SFX keep playing. This happens every time I run the game. If I never connect the controller and just play with KB, the BGM works.

The attached log (0400486024DEC000_controller_audio.log) shows what happens at connect:

1. 'Pro Controller' connected: player 1 (npad 0)  [GameController path]
2. 'Pro Controller' disconnected: player 1 (npad 0) is free
3. 'Pro Controller' (HID) connected: player 1 (npad 0)
4. 'Pro Controller' (HID) connected: player 2 (npad 1)
   Both come from the same device (057e:2009, USB location 0x100000) and the same
   report 0x30 stream. Log line: "GameController lists 1 of 2 pads of this model".
5. From then on, every frame:
   oe library applet: controller support
   oe focus state -> 2 (library applet open)
   hid controller applet: 1 to 1 players wanted, 2 connected
   oe focus state -> 1 (library applet closed)
   (339 times in the attached log, about one per frame, until I quit)

The audio renderer itself looks healthy during this. Render time is a mean of 0.09 ms with a max of 0.26 ms. Every report shows 0 underruns and 0 zero-padded frames, including the one covering the connect.

The game calls oe::SetFocusHandlingMode 2 (focus notifications). My guess, which the log doesn’t prove, is that the focus flipping every frame makes the game pause or mute its BGM stream.

An earlier log from a session where the controller was already connected at boot shows the same pattern.

Workaround

Suggested fixes by Claude

  1. Deduplicate pads in the HID path (the root fix).
The log shows the pad registered once through GameController (player 1, with motion and haptics). It’s then dropped (“is free”) and re-registered twice by the HID path (player 1 and player 2).
Both HID entries have the same USB location, 0x100000.
Key HID devices by their IOKit location ID, or serial number if present, and create one npad per key. Ignore a second matching callback for a key that’s already registered.
The line GameController lists 1 of 2 pads of this model suggests the code matches pads by model counts. Matching by location ID would be more reliable, and would also keep two real Pro Controllers apart.
Also check why the GameController registration gets torn down before the HID takeover. If the two paths hand off, the handoff should leave one pad, not two.
  1. Make the controller applet stub resolve the mismatch.
When the game asks for 1 player and 2 are connected, the stub should keep one pad (the lowest npad or the most recently active) and hide the rest from the game. Then it should return success.
It currently returns with “2 connected” still true, so the game calls the applet again every frame. That’s a bug even with a legitimate second controller.

What you expected

One Pro Controller should register as one player. The music should keep playing with the controller.

Game, title ID and version

0400486024DEC000

nxnative commit

bd979ce

Shader chain version

3ee52af3ca18

How it was built and run

Mac app (--platform mac-app)

Device and OS

MacBook Pro M5 Pro 24 GB

Settings and environment overrides

none

Logs

nxnative-report-0400486024DEC000-2026-11-07.zip

No game files

  • Nothing attached here contains game files, keys or data extracted from a game.

Activity

  1. eerive commented on Nov 7, 2026

    @eerive
    Author

    #1685 could be tested to see if it fixes this issue. I think this bug is could be applying to every hardware.

  2. changed the title [-]Ocarina of Time: BGM stops when Pro Controller connects[/-] [+]Ocarina of Time [0400486024DEC000]: BGM stops when Pro Controller connects[/+] on Nov 7, 2026
  3. ZhaowTao commented on Nov 8, 2026

    @ZhaowTao

    Fixed for me by #1722 (a00f03bb) — BGM keeps playing with the Pro Controller connected, and no workaround needed

    Adding the post-fix confirmation this issue has been missing. My earlier sessions hit the same symptom, and the DM_PAD_IDENTICAL=0 workaround from #1719 / #1725 got the music back at the cost of the pad's extra features. That is no longer necessary.

    Build: main 1794a35a (2026-11-08 17:01), which includes a00f03bb ("one Pro Controller is one pad"), --platform mac-app, shader chain 579d06bf3932. ~/Library/Application Support/nxnative/0400486024DEC000/env.txt is empty — no DM_PAD_IDENTICAL, no per-game overrides of any kind. That is the point: this is the unmodified path.

    Pad: Switch Pro Controller, Bluetooth.

    Log, at connect:

    [dm] controller 'Pro Controller' connected: player 1 (npad 0), with motion (gyro)
    haptics: player 1 controller Pro Controller, localities All, Default, Handles, Left Handle, Right Handle, 2 channels
    

    One enumeration, one player. Across the whole session (45,300 frames, ~24 minutes, Kokiri Forest → Lost Woods → Sacred Forest Meadow):

    this build the failing builds in this thread
    controller applet opens 0 the applet loop, repeatedly
    player 2 (npad 1) 0 a second pad at the same location
    gamepads listed for one controller 1 "1 of 2 pads of this model"

    Music. BGM plays in Kokiri Forest, the Lost Woods and Sacred Forest Meadow, and in the pause menu. audio #0 device callbacks reached 368,000 with 4.0 blocks queued at callback; 183 of 184 reports show 0 underruns, the one exception being 17 underruns / 78.8 ms zero-padded at 196,000. So the audio thread was never suspended for the length of the session — the applet loop that used to suspend it is gone.

    Gyro works as well, slingshot and bow aiming included, with no separate setting.

    One honest caveat on the pad: haptics are attached to both handles and both motors, but the host says

    haptics: player 1 controller left handle has no advanced players (NSCocoaErrorDomain 4097): plain players
    haptics: player 1 plays both motors on one engine (Handles)
    

    so I get plain rumble rather than the HD (amplitude/frequency) form on that handle. That reads like a separate macOS HID matter, not the duplicate-pad problem this issue is about, and it does not affect the music. Worth its own report if someone can compare against a build where the advanced players do attach.

    So: with a00f03bb in the build, one pad enumerates once, the applet never opens, and the BGM does not stop. The DM_PAD_IDENTICAL=0 workaround can be dropped.

  4. eerive commented on Nov 9, 2026

    @eerive
    Author

    Using commit 79741184 resolved this issue. Closing this bug as resolved.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggame: 0400486024DEC000A gamemacThe Mac front end and app (dm/mac, front_mac.m)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions