Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

I2S and external DAC: only one channel

Featured Replies

Hi everyone,

 

I got my OrangePi Zero 2W to work with MAX98357A board, the violet one, but I can only hear one channel. I didn't modify ALSA much, just focused on DTS:

 

...
    fragment@1 {
        target-path = "/soc";
        __overlay__ {
            ahub0_plat: ahub0_plat {
                #sound-dai-cells = <0>;
		compatible	= "allwinner,sunxi-snd-plat-ahub";
                apb_num		= <2>;	/* for dma port 5 */
		dmas		= <&dma 5>, <&dma 5>;
		dma-names	= "tx", "rx";
		playback_cma	= <128>;
		capture_cma	= <128>;
		tx_fifo_size	= <128>;
		rx_fifo_size	= <128>;
                tdm_num         = <0>;
                tx_pin          = <0>;
                rx_pin          = <0>;

		pinctrl-names = "default", "sleep";
                pinctrl_used;
		pinctrl-0 = <&ahub_daudio0_pins_a>, <&ahub_daudio0_pins_b>, <&ahub_daudio0_pins_c>;
		pinctrl-1 = <&ahub_daudio0_pins_d>;

                status = "okay";
            };
            ahub0_mach: ahub0_mach {
                compatible = "allwinner,sunxi-snd-mach";
		soundcard-mach,name = "ahubi2s0";
		soundcard-mach,format = "i2s";
                soundcard-mach,frame-master = <&ahub0_cpu>;
                soundcard-mach,bitclock-master = <&ahub0_cpu>;
                soundcard-mach,slot-num         = <2>;
                soundcard-mach,slot-width       = <32>;

		status = "okay";

                ahub0_cpu: soundcard-mach,cpu {
		    sound-dai = <&ahub0_plat>;
                    soundcard-mach,pll-fs   = <4>;
                    soundcard-mach,mclk-fs  = <0x100>;
		};

		ahub0_codec: soundcard-mach,codec {
		};
            };
            hdmi: hdmi@6000000 {
                status = "disabled";
            };
        };
    };
...

 

Did I miss something, and now I'm hearing only the left channel?

 

Has anyone managed to listen to stereo using external DAC?

 

Best!

1 hour ago, D said:

MAX98357A

Looks like that one can take stereo input but it is mostly designed to output one channel only. 

Did not research on my own but asked LLM. Since you experience one channel output only it might be correct about this behavior and also the overlay seems correct.

 

In case you're interested in the output summary:

 

Spoiler
Quote

Summary:
Your device tree overlay for Orange Pi Zero 2W configures a stereo I2S interface, but the MAX98357A is a mono DAC that outputs audio only on one channel based on the hardware SD_MODE pin level. The missing element is the explicit handling of mono channel selection either by wiring SD_MODE pin or using two MAX98357A chips for stereo sound. Your current single DAC setup can output sound only on the channel corresponding to the SD_MODE pin, which is likely the right channel in your case.

Additional possible actions:

  • Check SD_MODE pin wiring on the MAX98357A module (low = left channel output, high = right channel).

  • Adjust the audio driver or overlay to output mono sound on the correct channel.

  • Consider adding a second MAX98357A for stereo outputs or mix the stereo signal to mono before sending to the DAC.

This analysis is based on the MAX98357A datasheet, Orange Pi Zero 2W hardware info, and typical device tree configurations for Allwinner SoCs.

 

 

 

  • Author

Unfortunately, LLM is wrong here. There are MAX98357A boards, such as the violet one, which support (L+R)/2 and single/selected channel modes. I was able to configure the board using ESP32 and a sinus wave, so I can confirm it is possible and the board is not malfunctioning.
For some reason, the sunxi driver (or ALSA) misbehaves, and I can't determine where the problem is.

  • Author

 

Linux 6.1.31-sun50iw9 #1.0.4 SMP Wed Aug  6 19:06:53 UTC 2025 aarch64 GNU/Linux


I couldn't find any known kernel issues.

Edited by D

  • Author

These drivers should not differ much from each other, right?

Anyway, I found a reasonable patch to fix this behavior. I couldn't see this in the Armbian kernel, but what I need is: patch.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.