Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Nintendo Switch I2S To SPDIF: Difference between revisions

From GameBrew
(Created page with "{{Infobox Switch Homebrews |title=Nintendo Switch I2S to S/PDIF |image=nintendoswitchi2stospdif.png |description=I2S to S/PDIF conversion on SiPeed Tang Nano (GOWIN GW1N-LV1) which aims to convert Nintendo Switch's internal I2S signal. |author=puhitaku |lastupdated=2020/08/15 |type=PC Utilities |version=2020 |license=MIT |download=https://dlhb.gamebrew.org/switchhomebrews/nintendoswitchi2stospdif.7z |website=https://github.com/puhitaku/nintendo-switch-i2s-to-spdif |sourc...")
 
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Infobox Switch Homebrews
{{Infobox Switch Homebrews
|title=Nintendo Switch I2S to S/PDIF
|title=Nintendo Switch I2S to S/PDIF
|image=nintendoswitchi2stospdif.png
|image=nintendoswitchi2stospdif02.png
|description=I2S to S/PDIF conversion on SiPeed Tang Nano (GOWIN GW1N-LV1) which aims to convert Nintendo Switch's internal I2S signal.
|description=I2S to S/PDIF conversion on SiPeed Tang Nano (GOWIN GW1N-LV1) which aims to convert Nintendo Switch internal I2S signal.
|author=puhitaku
|author=puhitaku
|lastupdated=2020/08/15
|lastupdated=2020/08/15
|type=PC Utilities
|type=Remote Play and Streaming
|version=2020
|version=2020
|license=MIT
|license=MIT
Line 13: Line 13:
|donation=  
|donation=  
}}
}}
{{#seo:
I2S to S/PDIF conversion on SiPeed Tang Nano (GOWIN GW1N-LV1), mainly aims to convert Nintendo Switch's internal sound signal.
|title=Switch Homebrew PC Tools (PC Utilities) - GameBrew
|title_mode=append
|image=nintendoswitchi2stospdif.png
|image_alt=Nintendo Switch I2S to S/PDIF
}}
The main goal of the SiPeed Tang Nano (GOWIN GW1N-LV1) project is to convert the internal sound signal of the Nintendo Switch from I2S to S/PDIF.


The project was motivated by the fact that while Nintendo claims that the Switch supports USB DACs, it doesn't seem to support UAC 2 and 3, which are high-end. After trying various DACs, it became clear that only cheap DACs worked well with the Switch, while the high-end ones did not. This raises questions about whether Nintendo understands why USB DACs are necessary and how the Switch's headphone output sounds.
The project was motivated by the fact that while Nintendo claims that the Switch supports USB DACs, it doesn't seem to support UAC 2 and 3, which are somewhat high-end. After trying various DACs, it became clear that only cheap DACs worked well with the Switch, while the high-end ones did not. This raises questions about whether Nintendo knows why USB DACs are necessary and how the Switch's headphone output sounds.


While achieving full-digital sound output is easy in TV mode using an S/PDIF splitter from the HDMI signal, it is not as straightforward in non-TV (portable) mode. The Switch's only options for audio output in portable mode are the poor-quality headphone output and incomplete UAC support.
While achieving full-digital sound output is easy in TV mode using an S/PDIF splitter from the HDMI signal, it is not as straightforward in non-TV (portable) mode. The Switch's only options for audio output in portable mode are the poor-quality headphone output and incomplete UAC support.
Line 27: Line 21:
Therefore, the project aims to directly extract the digital sound signal from the Switch to enable better audio output.
Therefore, the project aims to directly extract the digital sound signal from the Switch to enable better audio output.


https://dlhb.gamebrew.org/switchhomebrews/nintendoswitchi2stospdif-01.png<br>
==Screenshots==
https://dlhb.gamebrew.org/switchhomebrews/nintendoswitchi2stospdif3.png
 
(Orange LED on the Chord Mojo indicates that it's receiving 48kHz digital sound.)
(Orange LED on the Chord Mojo indicates that it's receiving 48kHz digital sound.)
== 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]
https://dlhb.gamebrew.org/switchhomebrews/nintendoswitchi2stospdif-02.png
* 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: [https://github.com/torvalds/linux/blob/d4db4e553249eda9016fab2e363c26e52c47926f/arch/arm/boot/dts/tegra124-jetson-tk1.dts 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 ===
<ol>
<li><p>Disassemble your Switch. [https://www.ifixit.com/Teardown/Nintendo+Switch+Teardown/78263 -&gt; iFixit teardown]</p></li>
<li><p>Find the chip.</p>
<ul>
<li>Prepare longer wires for convenience and extra length to guide the wires nearby the battery connector.</li></ul>
https://dlhb.gamebrew.org/switchhomebrews/nintendoswitchi2stospdif-03.png</li>
<li><p>Solder wires for BCLK (bit clock), LRCLK (left-right channel clock), SDATA (serialized data), and the ground.</p>
<ul>
<li>Solder them VERY CAREFULLY or Switch will lose its voice parmanently.</li>
<li>Microscope is strongly suggested.</li></ul>
https://dlhb.gamebrew.org/switchhomebrews/nintendoswitchi2stospdif-04.png</li>
<li><p>Guide the wires and connect with Tang Nano somehow</p>
https://dlhb.gamebrew.org/switchhomebrews/nintendoswitchi2stospdif-05.png</p>
<ul>
<li>There is a tiny free space around the battery connector. Recommend you to guide wires here.</li>
<li>Mind your wires not to interfere with other structures.</li>
<li>The default pin assign:</li></ul>
{| class="wikitable"
! Pin
!align="right"| #
|-
| BCLK in
|align="right"| 29
|-
| LRCLK in
|align="right"| 28
|-
| SDATA in
|align="right"| 27
|-
| S/PDIF out
|align="right"| 38
|-
| S/PDIF out (LED)
|align="right"| 18
|}
</li>
<li><p>Build the circuitry</p>
https://dlhb.gamebrew.org/switchhomebrews/nintendoswitchi2stospdif-06.png
<ul>
<li>The schematic is TBA</li>
<li>By default, the output signal comes out from the pin 38 (for coaxial) and the red LED (for optical / TOSLINK).</li>
<li>You can try the optical transmission with NO EXTERNAL PARTS.</li>
<li>[https://sound-au.com/project85.htm Generic TTL-to-SPDIF level converter] uses logic ICs for driver but we can build without the IC.
<ul>
<li>Remove DC offset with a capacitor (0.1uF = 100nF is recommended)</li>
<li>Lower the voltage with a voltage divider
<ul>
<li>I've adjusted it with volumes to achieve 0.5Vpp.</li>
<li>I'm not sure about output impedance; it works anyways!</li>
<li>No problem with shorter cable out there but perhaps longer cable causes problem.</li></ul>
</li></ul>
</li></ul>
</li>
<li><p>Open this repository with GOWIN EDA</p></li>
<li><p>Run &quot;Synthesize&quot; in the &quot;Process&quot; tab.</p></li>
<li><p>Run &quot;Place &amp; Route&quot;.</p></li>
<li><p>Program the board with &quot;Program Device&quot;. The bitstream should be in &quot;nintendo-switch-i2s-to-spdif/impl/pnr/i2s2spdif.fs&quot;.</p></li>
<li><p>BOOM!</p></li></ol>


== External links ==
== External links ==
* Official Website - https://github.com/puhitaku/nintendo-switch-i2s-to-spdif
* GitHub - https://github.com/puhitaku/nintendo-switch-i2s-to-spdif
* Github - https://github.com/puhitaku/nintendo-switch-i2s-to-spdif

Latest revision as of 12:45, 6 July 2024

Nintendo Switch I2S to S/PDIF
Nintendoswitchi2stospdif02.png
General
Authorpuhitaku
TypeRemote Play and Streaming
Version2020
LicenseMIT License
Last Updated2020/08/15
Links
Download
Website
Source

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

The project was motivated by the fact that while Nintendo claims that the Switch supports USB DACs, it doesn't seem to support UAC 2 and 3, which are somewhat high-end. After trying various DACs, it became clear that only cheap DACs worked well with the Switch, while the high-end ones did not. This raises questions about whether Nintendo knows why USB DACs are necessary and how the Switch's headphone output sounds.

While achieving full-digital sound output is easy in TV mode using an S/PDIF splitter from the HDMI signal, it is not as straightforward in non-TV (portable) mode. The Switch's only options for audio output in portable mode are the poor-quality headphone output and incomplete UAC support.

Therefore, the project aims to directly extract the digital sound signal from the Switch to enable better audio output.

Screenshots

nintendoswitchi2stospdif3.png

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

External links

Advertising: