Skip to content

I2S to S/PDIF conversion on SiPeed Tang Nano (GOWIN GW1N-LV1) which aims to convert Nintendo Switch's internal I2S signal.

License

Notifications You must be signed in to change notification settings

puhitaku/nintendo-switch-i2s-to-spdif

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nintendo Switch I2S to S/PDIF

Overview

(Orange LED on the Chord Mojo indicates that it's receiving 48kHz digital sound.)

I2S to S/PDIF conversion on SiPeed Tang Nano (GOWIN GW1N-LV1), mainly aims to convert Nintendo Switch's internal sound signal.

Motivation

According to Nintendo, Switch supports USB DACs. However, it doesn't seem to support UAC 2 and 3 which are somewhat high-end. I've tried to connect all DACs I have but only cheap DACs worked nicely while high-ends didn't. I wonder if Nintendo knows why USB DACs are needed and how Switch's headphone output sounds like.

Full-digital sound output is easily achieved in TV mode. S/PDIF splitter from HDMI signal does it well. But how about non-TV (portable) mode? Only things Switch has are the terrible headphone output and incomplete UAC support.

Now it's the time to steal the digital sound signal directly from Switch.

Overview

The spec of I2S signal:

  • Sampling rate: 48000 [Hz]
  • Bit depth: 16 [bit]
  • Channels: 2 [ch]
  • Bit clock: 48000 * 16 * 2 * 4 = 6.144 [MHz]

Oscilloscope visualized the I2S signal

  • There is a Realtek ALC5639 (smart amp with I2C controls) in Switch.
  • The SoC (≒ NVIDIA Tegra X1) transmits the sound signal to it in I2S format.

(Off-topic: NVIDIA Jetson TK1 has ALC5640 (RT5640) in it. It is close to ALC5639 and has identical footprint. Perhaps Nintendo imitated the design of a evaluation board of NVIDIA.)

The spec of the FPGA board:

  • Board: SiPeed Tang Nano
  • FPGA: GOWIN GW1N-LV1 (LittleBee series)

The protocol of TOSLINK (optical) and coaxial cable (metal) is same. The RGB LED on Tang Nano is capable of transmitting S/PDIF signal. Connect a cable to a DAC and press the another side on the LED. Sound should come out. How interesting is it! 🤓

Step-by-step

  1. Disassemble your Switch. -> iFixit teardown

  2. Find the chip.

    • Prepare longer wires for convenience and extra length to guide the wires nearby the battery connector.
    ALC5639
  3. Solder wires for BCLK (bit clock), LRCLK (left-right channel clock), SDATA (serialized data), and the ground.

    • Solder them VERY CAREFULLY or Switch will lose its voice parmanently.
    • Microscope is strongly suggested.
    ALC5639 with soldered wires
  4. Guide the wires and connect with Tang Nano somehow

    Guide the wires
    • There is a tiny free space around the battery connector. Recommend you to guide wires here.
    • Mind your wires not to interfere with other structures.
    • The default pin assign:
    Pin #
    BCLK in 29
    LRCLK in 28
    SDATA in 27
    S/PDIF out 38
    S/PDIF out (LED) 18
  5. Build the circuitry

    Breadboard
    • The schematic is TBA
    • By default, the output signal comes out from the pin 38 (for coaxial) and the red LED (for optical / TOSLINK).
    • You can try the optical transmission with NO EXTERNAL PARTS.
    • Generic TTL-to-SPDIF level converter uses logic ICs for driver but we can build without the IC.
      • Remove DC offset with a capacitor (0.1uF = 100nF is recommended)
      • Lower the voltage with a voltage divider
        • I've adjusted it with volumes to achieve 0.5Vpp.
        • I'm not sure about output impedance; it works anyways!
        • No problem with shorter cable out there but perhaps longer cable causes problem.
  6. Open this repository with GOWIN EDA

  7. Run "Synthesize" in the "Process" tab.

  8. Run "Place & Route".

  9. Program the board with "Program Device". The bitstream should be in "nintendo-switch-i2s-to-spdif/impl/pnr/i2s2spdif.fs".

  10. BOOM!

About

I2S to S/PDIF conversion on SiPeed Tang Nano (GOWIN GW1N-LV1) which aims to convert Nintendo Switch's internal I2S signal.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published