StonedEdge
Posts: 81
Joined: Wed Oct 28, 2020 11:42 am

WM8960: CM4 (no i2s audio out, sound card detected)

Sat Jul 31, 2021 9:09 am

Hi all,

I'm running the latest version of RetroPie image (downloaded here for Pi 4 - https://retropie.org.uk/download/) and trying to interface with the WM8960 codec on a custom board via i2s, using the following driver - https://github.com/waveshare/WM8960-Audio-HAT).

I've successfully installed the drivers after updating all of the kernel modules and kernel headers, my order of operations are as follows:

1) sudo apt-get install raspberrypi-kernel-headers --> sudo apt-get dist-upgrade --> sudo apt-get update
2) git clone https://github.com/waveshare/WM8960-Audio-HAT
3) cd WM8960-Audio-HAT
4) sudo nano wm8960-soundcard.dts
5) Change target = <&i2c1>; to <&i2c0>; --> save file
5) sudo ./install.sh
6) sudo reboot
7) sudo i2cdetect -y 0 --> 1a appears (slave device).
8) sudo aplay -l
9) Try to adjust volume in alsamixer via sudo alsamixer (PCM output channels both are at zero, can't seem to figure out how to turn them on)
10) Try to load game in RetroPie, no audio out

Am I missing something here to get this card working? The card appears when running sudo aplay -l but I can't seem to get any audio out when trying to load a game in RetroPie, or when doing a speaker test from the command line running speaker-test. Considering switching out to a different codec if the drivers are not going to work on the latest version of Raspian Buster.

Kind regards,
Ben

aBUGSworstnightmare
Posts: 3475
Joined: Tue Jun 30, 2015 1:35 pm

Re: WM8960: CM4 (no i2s audio out, sound card detected)

Sat Jul 31, 2021 1:20 pm

1. Question: what makes this thread different from what's under discussion here: viewtopic.php?f=98&p=1895625#p1895392 ?

2. Question: how did you compile the overlay?
Typ approach would be

Code: Select all

 sudo dtc -@ -I dts -O dtb -o wm8960-soundcard.dtbo wm8960-soundcard.dts
sudo cp wm8960-soundcard.dtbo /boot/overlays/  
but as this seems to be a full driver I would prefer to compile it against the kernel.

StonedEdge
Posts: 81
Joined: Wed Oct 28, 2020 11:42 am

Re: WM8960: CM4 (no i2s audio out, sound card detected)

Sat Jul 31, 2021 4:49 pm

aBUGSworstnightmare wrote: 1. Question: what makes this thread different from what's under discussion here: viewtopic.php?f=98&p=1895625#p1895392 ?

2. Question: how did you compile the overlay?
Typ approach would be

Code: Select all

 sudo dtc -@ -I dts -O dtb -o wm8960-soundcard.dtbo wm8960-soundcard.dts
sudo cp wm8960-soundcard.dtbo /boot/overlays/  
but as this seems to be a full driver I would prefer to compile it against the kernel.
I’m not sure as I’m still a complete beginner, but I’ve essentially just used sudo nano to change the dts file and then saved it, and reinstalled via sudo ./install.sh

StonedEdge
Posts: 81
Joined: Wed Oct 28, 2020 11:42 am

Re: WM8960: CM4 (no i2s audio out, sound card detected)

Sun Aug 01, 2021 5:58 am

aBUGSworstnightmare wrote:
Sat Jul 31, 2021 1:20 pm
1. Question: what makes this thread different from what's under discussion here: viewtopic.php?f=98&p=1895625#p1895392 ?

2. Question: how did you compile the overlay?
Typ approach would be

Code: Select all

 sudo dtc -@ -I dts -O dtb -o wm8960-soundcard.dtbo wm8960-soundcard.dts
sudo cp wm8960-soundcard.dtbo /boot/overlays/  
but as this seems to be a full driver I would prefer to compile it against the kernel.
pi@retropie:~/WM8960-Audio-HAT $ wm8960-soundcard.dtb: Warning (unit_address_vs_reg): /fragment@2/overlay/wm8960: node has a r eg or ranges property, but no unit name

I tried executing this but got the above error: sudo dtc -@ -I dts -O dtb -o wm8960-soundcard.dtbo wm8960-soundcard.dts

This is the output of the dtbo file as well. I'm not sure but these 0xffffffff values don't look too promising.

Code: Select all

/dts-v1/;

/ {
        compatible = "brcm,bcm2708";

        fragment@0 {
                target = < 0xffffffff >;

                __overlay__ {
                        status = "okay";
                };
        };

        fragment@1 {
                target-path = [ 2f 00 ];

                __overlay__ {

                        wm8960_mclk {
                                compatible = "fixed-clock";
                                #clock-cells = < 0x00 >;
                                clock-frequency = < 0xbb8000 >;
                                phandle = < 0x02 >;
                        };
                };
        };

        fragment@2 {
                target = < 0xffffffff >;

                __overlay__ {
                        #address-cells = < 0x01 >;
                        #size-cells = < 0x00 >;
                        status = "okay";

                        wm8960 {
                                compatible = "wlf,wm8960";
                                reg = < 0x1a >;
                                #sound-dai-cells = < 0x00 >;
                                AVDD-supply = < 0xffffffff >;
                                DVDD-supply = < 0xffffffff >;
                                phandle = < 0x01 >;
                        };
                };
        };

        fragment@3 {
                target = < 0xffffffff >;

                __overlay__ {
                        compatible = "simple-audio-card";
                        simple-audio-card,format = "i2s";
                        simple-audio-card,name = "wm8960-soundcard";
                        status = "okay";
                        simple-audio-card,widgets = "Microphone\0Mic Jack\0Line\0Line In\0Line\0Line Out\0Speaker\0Speaker\0Headphone\0                                                      Headphone Jack";
                        simple-audio-card,routing = "Headphone Jack\0HP_L\0Headphone Jack\0HP_R\0Speaker\0SPK_LP\0Speaker\0SPK_LN\0LINP                                                      UT1\0Mic Jack\0LINPUT3\0Mic Jack\0RINPUT1\0Mic Jack\0RINPUT2\0Mic Jack";
                        phandle = < 0x03 >;

                        simple-audio-card,cpu {
                                sound-dai = < 0xffffffff >;
                        };

                        simple-audio-card,codec {
                                sound-dai = < 0x01 >;
                                clocks = < 0x02 >;
                                clock-names = "mclk";
                                phandle = < 0x04 >;
                        };
                };
        };

        __overrides__ {
                alsaname = [ 00 00 00 03 73 69 6d 70 6c 65 2d 61 75 64 69 6f 2d 63 61 72 64 2c 6e 61 6d 65 00 ];
                compatible = [ 00 00 00 01 63 6f 6d 70 61 74 69 62 6c 65 00 ];
                master = [ 00 00 00 00 3d 32 21 33 00 ];
        };

        __symbols__ {
                wm8960_mclk = "/fragment@1/__overlay__/wm8960_mclk";
                wm8960 = "/fragment@2/__overlay__/wm8960";
                slave_overlay = "/fragment@3/__overlay__";
                dailink0_slave = "/fragment@3/__overlay__/simple-audio-card,codec";
        };

        __fixups__ {
                i2s = "/fragment@0:target:0\0/fragment@3/__overlay__/simple-audio-card,cpu:sound-dai:0";
                i2c0 = "/fragment@2:target:0";
                vdd_5v0_reg = "/fragment@2/__overlay__/wm8960:AVDD-supply:0";
                vdd_3v3_reg = "/fragment@2/__overlay__/wm8960:DVDD-supply:0";
                sound = "/fragment@3:target:0";
        };

        __local_fixups__ {

                fragment@3 {

                        __overlay__ {

                                simple-audio-card,codec {
                                        sound-dai = < 0x00 >;
                                        clocks = < 0x00 >;
                                };
                        };
                };

                __overrides__ {
                        alsaname = < 0x00 >;
                        compatible = < 0x00 >;
                };
        };
};
(mod edit to add code tags)

aBUGSworstnightmare
Posts: 3475
Joined: Tue Jun 30, 2015 1:35 pm

Re: WM8960: CM4 (no i2s audio out, sound card detected)

Sun Aug 01, 2021 7:20 am

StonedEdge wrote:
Sun Aug 01, 2021 5:58 am
aBUGSworstnightmare wrote:
Sat Jul 31, 2021 1:20 pm
1. Question: what makes this thread different from what's under discussion here: viewtopic.php?f=98&p=1895625#p1895392 ?

2. Question: how did you compile the overlay?
Typ approach would be

Code: Select all

 sudo dtc -@ -I dts -O dtb -o wm8960-soundcard.dtbo wm8960-soundcard.dts
sudo cp wm8960-soundcard.dtbo /boot/overlays/  
but as this seems to be a full driver I would prefer to compile it against the kernel.
pi@retropie:~/WM8960-Audio-HAT $ wm8960-soundcard.dtb: Warning (unit_address_vs_reg): /fragment@2/overlay/wm8960: node has a r eg or ranges property, but no unit name

I tried executing this but got the above error: sudo dtc -@ -I dts -O dtb -o wm8960-soundcard.dtbo wm8960-soundcard.dts

This is the output of the dtbo file as well. I'm not sure but these 0xffffffff values don't look too promising.

.....
Please use "code " tags when adding code as it make the post easier to read.

I've just downloaded the sources you've linked above, simply changed the I2C bus from 1 to 0 and tried to compile:

Code: Select all

pi@raspberrypi:~/Desktop/WM8960-Audio-HAT-master $ sudo dtc -@ -I dts -O dtb -o wm8960-soundcard.dtbo wm8960-soundcard.dts
wm8960-soundcard.dtbo: Warning (unit_address_vs_reg): /fragment@2/__overlay__/wm8960: node has a reg or ranges property, but no unit name
Same error as you! So I've opened the overlay and had a look at fragment_2. Well, I need to say that I'm not a Linux pro but I'm dealing with some I2C devices atm and finding my way how to write these overlay files (when stuff is scattered over tons of documentations most of the time).
So, as the compile error says that fragment has an I2C address definition "reg = <0x1a>;" - slave address of your I2C device - but is lacking it in the name.

That's why I've changed line no 31 and added the address value - "wm8960: wm8960@1a".
Compiles fine and compiling it back ("dtc -I dtb -O dts -o wm8960-soundcard_back.dts wm8960-soundcard.dtbo" ) gives below. '0xffffffff ' are there as the symbols are missing --> comiling against the kernel should solve this.

Code: Select all

/dts-v1/;

/ {
	compatible = "brcm,bcm2708";

	fragment@0 {
		target = < 0xffffffff >;

		__overlay__ {
			status = "okay";
		};
	};

	fragment@1 {
		target-path = [ 2f 00 ];

		__overlay__ {

			wm8960_mclk {
				compatible = "fixed-clock";
				#clock-cells = < 0x00 >;
				clock-frequency = < 0xbb8000 >;
				phandle = < 0x02 >;
			};
		};
	};

	fragment@2 {
		target = < 0xffffffff >;

		__overlay__ {
			#address-cells = < 0x01 >;
			#size-cells = < 0x00 >;
			status = "okay";

			wm8960@1a {
				compatible = "wlf,wm8960";
				reg = < 0x1a >;
				#sound-dai-cells = < 0x00 >;
				AVDD-supply = < 0xffffffff >;
				DVDD-supply = < 0xffffffff >;
				phandle = < 0x01 >;
			};
		};
	};

	fragment@3 {
		target = < 0xffffffff >;

		__overlay__ {
			compatible = "simple-audio-card";
			simple-audio-card,format = "i2s";
			simple-audio-card,name = "wm8960-soundcard";
			status = "okay";
			simple-audio-card,widgets = "Microphone\0Mic Jack\0Line\0Line In\0Line\0Line Out\0Speaker\0Speaker\0Headphone\0Headphone Jack";
			simple-audio-card,routing = "Headphone Jack\0HP_L\0Headphone Jack\0HP_R\0Speaker\0SPK_LP\0Speaker\0SPK_LN\0LINPUT1\0Mic Jack\0LINPUT3\0Mic Jack\0RINPUT1\0Mic Jack\0RINPUT2\0Mic Jack";
			phandle = < 0x03 >;

			simple-audio-card,cpu {
				sound-dai = < 0xffffffff >;
			};

			simple-audio-card,codec {
				sound-dai = < 0x01 >;
				clocks = < 0x02 >;
				clock-names = "mclk";
				phandle = < 0x04 >;
			};
		};
	};

	__overrides__ {
		alsaname = [ 00 00 00 03 73 69 6d 70 6c 65 2d 61 75 64 69 6f 2d 63 61 72 64 2c 6e 61 6d 65 00 ];
		compatible = [ 00 00 00 01 63 6f 6d 70 61 74 69 62 6c 65 00 ];
		master = [ 00 00 00 00 3d 32 21 33 00 ];
	};

	__symbols__ {
		wm8960_mclk = "/fragment@1/__overlay__/wm8960_mclk";
		wm8960 = "/fragment@2/__overlay__/wm8960@1a";
		slave_overlay = "/fragment@3/__overlay__";
		dailink0_slave = "/fragment@3/__overlay__/simple-audio-card,codec";
	};

	__fixups__ {
		i2s = "/fragment@0:target:0\0/fragment@3/__overlay__/simple-audio-card,cpu:sound-dai:0";
		i2c0 = "/fragment@2:target:0";
		vdd_5v0_reg = "/fragment@2/__overlay__/wm8960@1a:AVDD-supply:0";
		vdd_3v3_reg = "/fragment@2/__overlay__/wm8960@1a:DVDD-supply:0";
		sound = "/fragment@3:target:0";
	};

	__local_fixups__ {

		fragment@3 {

			__overlay__ {

				simple-audio-card,codec {
					sound-dai = < 0x00 >;
					clocks = < 0x00 >;
				};
			};
		};

		__overrides__ {
			alsaname = < 0x00 >;
			compatible = < 0x00 >;
		};
	};
};


Anyhow: change your overlay source file to below and run the provided script to see if that makes a difference.

Code: Select all

/dts-v1/;
/plugin/;

/ {
    compatible = "brcm,bcm2708";

    fragment@0 {
        target = <&i2s>;
        __overlay__ {
            status = "okay";
        };
    };
    fragment@1 {
		target-path="/";
		__overlay__ {
                        wm8960_mclk: wm8960_mclk {
                                compatible = "fixed-clock";
                                #clock-cells = <0>;
                                clock-frequency = <12288000>;
                        };

		};
    };
    fragment@2 {
		target = <&i2c0>;
		__overlay__ {
			#address-cells = <1>;
			#size-cells = <0>;
			status = "okay";

			wm8960: wm8960@1a{
				compatible = "wlf,wm8960";
				reg = <0x1a>;
				#sound-dai-cells = <0>;
				AVDD-supply = <&vdd_5v0_reg>;
				DVDD-supply = <&vdd_3v3_reg>;
			};
		};
    };


    fragment@3 {
        target = <&sound>;
        slave_overlay: __overlay__ {
                compatible = "simple-audio-card";
                simple-audio-card,format = "i2s";
                simple-audio-card,name = "wm8960-soundcard"; 
                status = "okay";
                simple-audio-card,widgets =
                        "Microphone", "Mic Jack",
                        "Line", "Line In",
                        "Line", "Line Out",
                        "Speaker", "Speaker",
                        "Headphone", "Headphone Jack";
                simple-audio-card,routing =
                        "Headphone Jack", "HP_L",
                        "Headphone Jack", "HP_R",
                        "Speaker", "SPK_LP",
                        "Speaker", "SPK_LN",
                        "LINPUT1", "Mic Jack",
                        "LINPUT3", "Mic Jack",
                        "RINPUT1", "Mic Jack",
                        "RINPUT2", "Mic Jack";




                simple-audio-card,cpu {
                    sound-dai = <&i2s>;
                };
                dailink0_slave: simple-audio-card,codec {
                    sound-dai = <&wm8960>;
			clocks = <&wm8960_mclk>;
			clock-names = "mclk";

                };
        };
    };

    __overrides__ {
        alsaname = <&slave_overlay>,"simple-audio-card,name";
        compatible = <&wm8960>,"compatible";
        master = <0>,"=2!3";
    };
};


StonedEdge
Posts: 81
Joined: Wed Oct 28, 2020 11:42 am

Re: WM8960: CM4 (no i2s audio out, sound card detected)

Sun Aug 01, 2021 4:48 pm

aBUGSworstnightmare wrote:
Sun Aug 01, 2021 7:20 am
StonedEdge wrote:
Sun Aug 01, 2021 5:58 am
aBUGSworstnightmare wrote:
Sat Jul 31, 2021 1:20 pm
1. Question: what makes this thread different from what's under discussion here: viewtopic.php?f=98&p=1895625#p1895392 ?

2. Question: how did you compile the overlay?
Typ approach would be

Code: Select all

 sudo dtc -@ -I dts -O dtb -o wm8960-soundcard.dtbo wm8960-soundcard.dts
sudo cp wm8960-soundcard.dtbo /boot/overlays/  
but as this seems to be a full driver I would prefer to compile it against the kernel.
pi@retropie:~/WM8960-Audio-HAT $ wm8960-soundcard.dtb: Warning (unit_address_vs_reg): /fragment@2/overlay/wm8960: node has a r eg or ranges property, but no unit name

I tried executing this but got the above error: sudo dtc -@ -I dts -O dtb -o wm8960-soundcard.dtbo wm8960-soundcard.dts

This is the output of the dtbo file as well. I'm not sure but these 0xffffffff values don't look too promising.

.....
Please use "code " tags when adding code as it make the post easier to read.

I've just downloaded the sources you've linked above, simply changed the I2C bus from 1 to 0 and tried to compile:

Code: Select all

pi@raspberrypi:~/Desktop/WM8960-Audio-HAT-master $ sudo dtc -@ -I dts -O dtb -o wm8960-soundcard.dtbo wm8960-soundcard.dts
wm8960-soundcard.dtbo: Warning (unit_address_vs_reg): /fragment@2/__overlay__/wm8960: node has a reg or ranges property, but no unit name
Same error as you! So I've opened the overlay and had a look at fragment_2. Well, I need to say that I'm not a Linux pro but I'm dealing with some I2C devices atm and finding my way how to write these overlay files (when stuff is scattered over tons of documentations most of the time).
So, as the compile error says that fragment has an I2C address definition "reg = <0x1a>;" - slave address of your I2C device - but is lacking it in the name.

That's why I've changed line no 31 and added the address value - "wm8960: wm8960@1a".
Compiles fine and compiling it back ("dtc -I dtb -O dts -o wm8960-soundcard_back.dts wm8960-soundcard.dtbo" ) gives below. '0xffffffff ' are there as the symbols are missing --> comiling against the kernel should solve this.

Code: Select all

/dts-v1/;

/ {
	compatible = "brcm,bcm2708";

	fragment@0 {
		target = < 0xffffffff >;

		__overlay__ {
			status = "okay";
		};
	};

	fragment@1 {
		target-path = [ 2f 00 ];

		__overlay__ {

			wm8960_mclk {
				compatible = "fixed-clock";
				#clock-cells = < 0x00 >;
				clock-frequency = < 0xbb8000 >;
				phandle = < 0x02 >;
			};
		};
	};

	fragment@2 {
		target = < 0xffffffff >;

		__overlay__ {
			#address-cells = < 0x01 >;
			#size-cells = < 0x00 >;
			status = "okay";

			wm8960@1a {
				compatible = "wlf,wm8960";
				reg = < 0x1a >;
				#sound-dai-cells = < 0x00 >;
				AVDD-supply = < 0xffffffff >;
				DVDD-supply = < 0xffffffff >;
				phandle = < 0x01 >;
			};
		};
	};

	fragment@3 {
		target = < 0xffffffff >;

		__overlay__ {
			compatible = "simple-audio-card";
			simple-audio-card,format = "i2s";
			simple-audio-card,name = "wm8960-soundcard";
			status = "okay";
			simple-audio-card,widgets = "Microphone\0Mic Jack\0Line\0Line In\0Line\0Line Out\0Speaker\0Speaker\0Headphone\0Headphone Jack";
			simple-audio-card,routing = "Headphone Jack\0HP_L\0Headphone Jack\0HP_R\0Speaker\0SPK_LP\0Speaker\0SPK_LN\0LINPUT1\0Mic Jack\0LINPUT3\0Mic Jack\0RINPUT1\0Mic Jack\0RINPUT2\0Mic Jack";
			phandle = < 0x03 >;

			simple-audio-card,cpu {
				sound-dai = < 0xffffffff >;
			};

			simple-audio-card,codec {
				sound-dai = < 0x01 >;
				clocks = < 0x02 >;
				clock-names = "mclk";
				phandle = < 0x04 >;
			};
		};
	};

	__overrides__ {
		alsaname = [ 00 00 00 03 73 69 6d 70 6c 65 2d 61 75 64 69 6f 2d 63 61 72 64 2c 6e 61 6d 65 00 ];
		compatible = [ 00 00 00 01 63 6f 6d 70 61 74 69 62 6c 65 00 ];
		master = [ 00 00 00 00 3d 32 21 33 00 ];
	};

	__symbols__ {
		wm8960_mclk = "/fragment@1/__overlay__/wm8960_mclk";
		wm8960 = "/fragment@2/__overlay__/wm8960@1a";
		slave_overlay = "/fragment@3/__overlay__";
		dailink0_slave = "/fragment@3/__overlay__/simple-audio-card,codec";
	};

	__fixups__ {
		i2s = "/fragment@0:target:0\0/fragment@3/__overlay__/simple-audio-card,cpu:sound-dai:0";
		i2c0 = "/fragment@2:target:0";
		vdd_5v0_reg = "/fragment@2/__overlay__/wm8960@1a:AVDD-supply:0";
		vdd_3v3_reg = "/fragment@2/__overlay__/wm8960@1a:DVDD-supply:0";
		sound = "/fragment@3:target:0";
	};

	__local_fixups__ {

		fragment@3 {

			__overlay__ {

				simple-audio-card,codec {
					sound-dai = < 0x00 >;
					clocks = < 0x00 >;
				};
			};
		};

		__overrides__ {
			alsaname = < 0x00 >;
			compatible = < 0x00 >;
		};
	};
};


Anyhow: change your overlay source file to below and run the provided script to see if that makes a difference.

Code: Select all

/dts-v1/;
/plugin/;

/ {
    compatible = "brcm,bcm2708";

    fragment@0 {
        target = <&i2s>;
        __overlay__ {
            status = "okay";
        };
    };
    fragment@1 {
		target-path="/";
		__overlay__ {
                        wm8960_mclk: wm8960_mclk {
                                compatible = "fixed-clock";
                                #clock-cells = <0>;
                                clock-frequency = <12288000>;
                        };

		};
    };
    fragment@2 {
		target = <&i2c0>;
		__overlay__ {
			#address-cells = <1>;
			#size-cells = <0>;
			status = "okay";

			wm8960: wm8960@1a{
				compatible = "wlf,wm8960";
				reg = <0x1a>;
				#sound-dai-cells = <0>;
				AVDD-supply = <&vdd_5v0_reg>;
				DVDD-supply = <&vdd_3v3_reg>;
			};
		};
    };


    fragment@3 {
        target = <&sound>;
        slave_overlay: __overlay__ {
                compatible = "simple-audio-card";
                simple-audio-card,format = "i2s";
                simple-audio-card,name = "wm8960-soundcard"; 
                status = "okay";
                simple-audio-card,widgets =
                        "Microphone", "Mic Jack",
                        "Line", "Line In",
                        "Line", "Line Out",
                        "Speaker", "Speaker",
                        "Headphone", "Headphone Jack";
                simple-audio-card,routing =
                        "Headphone Jack", "HP_L",
                        "Headphone Jack", "HP_R",
                        "Speaker", "SPK_LP",
                        "Speaker", "SPK_LN",
                        "LINPUT1", "Mic Jack",
                        "LINPUT3", "Mic Jack",
                        "RINPUT1", "Mic Jack",
                        "RINPUT2", "Mic Jack";




                simple-audio-card,cpu {
                    sound-dai = <&i2s>;
                };
                dailink0_slave: simple-audio-card,codec {
                    sound-dai = <&wm8960>;
			clocks = <&wm8960_mclk>;
			clock-names = "mclk";

                };
        };
    };

    __overrides__ {
        alsaname = <&slave_overlay>,"simple-audio-card,name";
        compatible = <&wm8960>,"compatible";
        master = <0>,"=2!3";
    };
};

Great news, this worked and the soundcard now appears after checking with aplay -l, no compiling errors! Nice work. I still cannot get any sound out of it yet, despite it appearing in the list of sound cards. T_T

Here’s the settings I have in alsamixer. I did buy these chips from a non-reputable seller so I am wondering if they are fakes, but I don’t think they would be as the card is recognized via i2c as 0x1a on the bus.

Hopefully it’s just something simple... I am using a 24Mhz xtal for MCLK if that means anything, I think the dtbo was set to 12.28Mhz, assuming there is some sort of divisor going on in the code tho. The serial data line has activity on it when trying to play an mp3 file via mpg123 <mp3 file>. I’m also assuming that I don’t need to compile any overlays related to setting the Pi as i2s slave for this DAC.

Code: Select all


pi@retropie:~ $ amixer -c0
Simple mixer control 'Headphone',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 127
  Mono:
  Front Left: Playback 102 [80%] [-19.00dB]
  Front Right: Playback 102 [80%] [-19.00dB]
Simple mixer control 'Headphone Playback ZC',0
  Capabilities: pswitch
  Playback channels: Front Left - Front Right
  Mono:
  Front Left: Playback [on]
  Front Right: Playback [on]
Simple mixer control 'Speaker',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 127
  Mono:
  Front Left: Playback 101 [80%] [-20.00dB]
  Front Right: Playback 101 [80%] [-20.00dB]
Simple mixer control 'Speaker AC',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 5
  Mono: 4 [80%]
Simple mixer control 'Speaker DC',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 5
  Mono: 4 [80%]
Simple mixer control 'Speaker Playback ZC',0
  Capabilities: pswitch
  Playback channels: Front Left - Front Right
  Mono:
  Front Left: Playback [on]
  Front Right: Playback [on]
Simple mixer control 'PCM Playback -6dB',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Mono Output Mixer Left',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Mono Output Mixer Right',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Playback',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 255
  Front Left: 215 [84%] [-20.00dB]
  Front Right: 215 [84%] [-20.00dB]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 63
  Front Left: Capture 39 [62%] [12.00dB] [on]
  Front Right: Capture 39 [62%] [12.00dB] [on]
Simple mixer control '3D',0
  Capabilities: volume volume-joined pswitch pswitch-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 15
  Mono: 3 [20%] Playback [off]
Simple mixer control '3D Filter Lower Cut-Off',0
  Capabilities: enum
  Items: 'Low' 'High'
  Item0: 'Low'
Simple mixer control '3D Filter Upper Cut-Off',0
  Capabilities: enum
  Items: 'High' 'Low'
  Item0: 'High'
Simple mixer control 'ADC Data Output Select',0
  Capabilities: enum
  Items: 'Left Data = Left ADC;  Right Data = Right ADC' 'Left Data = Left ADC;          Right Data = Left ADC' 'Left Data = Right ADC; Right Data = Right ADC' 'Left Da        ta = Right ADC; Right Data = Left ADC'
  Item0: 'Left Data = Left ADC;  Right Data = Right ADC'
Simple mixer control 'ADC High Pass Filter',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'ADC PCM',0
  Capabilities: cvolume
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 255
  Front Left: Capture 195 [76%] [0.00dB]
  Front Right: Capture 195 [76%] [0.00dB]
Simple mixer control 'ADC Polarity',0
  Capabilities: enum
  Items: 'No Inversion' 'Left Inverted' 'Right Inverted' 'Stereo Inversion'
  Item0: 'No Inversion'
Simple mixer control 'ALC Attack',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 15
  Mono: 2 [13%]
Simple mixer control 'ALC Decay',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 15
  Mono: 3 [20%]
Simple mixer control 'ALC Function',0
  Capabilities: enum
  Items: 'Off' 'Right' 'Left' 'Stereo'
  Item0: 'Off'
Simple mixer control 'ALC Hold Time',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 15
  Mono: 0 [0%]
Simple mixer control 'ALC Max Gain',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 7
  Mono: 7 [100%]
Simple mixer control 'ALC Min Gain',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 7
  Mono: 0 [0%]
Simple mixer control 'ALC Mode',0
  Capabilities: enum
  Items: 'ALC' 'Limiter'
  Item0: 'ALC'
Simple mixer control 'ALC Target',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 15
  Mono: 11 [73%]
Simple mixer control 'DAC Deemphasis',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'DAC Mono Mix',0
  Capabilities: enum
  Items: 'Stereo' 'Mono'
  Item0: 'Stereo'
Simple mixer control 'DAC Polarity',0
  Capabilities: enum
  Items: 'No Inversion' 'Left Inverted' 'Right Inverted' 'Stereo Inversion'
  Item0: 'No Inversion'
Simple mixer control 'Left Boost Mixer LINPUT1',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Left Boost Mixer LINPUT2',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'Left Boost Mixer LINPUT3',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'Left Input Boost Mixer LINPUT1',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 3
  Mono: 0 [0%] [0.00dB]
Simple mixer control 'Left Input Boost Mixer LINPUT2',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 7
  Mono: 0 [0%] [-99999.99dB]
Simple mixer control 'Left Input Boost Mixer LINPUT3',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 7
  Mono: 0 [0%] [-99999.99dB]
Simple mixer control 'Left Input Mixer Boost',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'Left Output Mixer Boost Bypass',0
  Capabilities: volume volume-joined pswitch pswitch-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 7
  Mono: 2 [29%] [-15.00dB] Playback [off]
Simple mixer control 'Left Output Mixer LINPUT3',0
  Capabilities: volume volume-joined pswitch pswitch-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 7
  Mono: 2 [29%] [-15.00dB] Playback [off]
Simple mixer control 'Left Output Mixer PCM',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Noise Gate',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Noise Gate Threshold',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 31
  Mono: 6 [19%]
Simple mixer control 'Right Boost Mixer RINPUT1',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Right Boost Mixer RINPUT2',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'Right Boost Mixer RINPUT3',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'Right Input Boost Mixer RINPUT1',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 3
  Mono: 0 [0%] [0.00dB]
Simple mixer control 'Right Input Boost Mixer RINPUT2',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 7
  Mono: 0 [0%] [-99999.99dB]
Simple mixer control 'Right Input Boost Mixer RINPUT3',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 7
  Mono: 0 [0%] [-99999.99dB]
Simple mixer control 'Right Input Mixer Boost',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'Right Output Mixer Boost Bypass',0
  Capabilities: volume volume-joined pswitch pswitch-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 7
  Mono: 2 [29%] [-15.00dB] Playback [off]
Simple mixer control 'Right Output Mixer PCM',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Right Output Mixer RINPUT3',0
  Capabilities: volume volume-joined pswitch pswitch-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 7
  Mono: 2 [29%] [-15.00dB] Playback [off]
pi@retropie:~ $ Simple mixer control 'Headphone',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 127
  Mono:
  Front Left: Playback 102 [80%] [-19.00dB]
  Front Right: Playback 102 [80%] [-19.00dB]
Simple mixer control 'Headphone Playback ZC',0
  Capabilities: pswitch
  Playback channels: Front Left - Front Right
  Mono:
  Front Left: Playback [on]
  Front Right: Playback [on]
Simple mixer control 'Speaker',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 127
  Mono:
  Front Left: Playback 101 [80%] [-20.00dB]
  Front Right: Playback 101 [80%] [-20.00dB]
Simple mixer control 'Speaker AC',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 5
  Mono: 4 [80%]
Simple mixer control 'Speaker DC',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 5
  Mono: 4 [80%]
Simple mixer control 'Speaker Playback ZC',0
  Capabilities: pswitch
  Playback channels: Front Left - Front Right
-bash: Simple: command not found
  Mono:
  Front Left: Playback [on]
  Front Right: Playback [on]
Simple mixer control 'PCM Playback -6dB',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Mono Output Mixer Left',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Mono Output Mixer Right',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Playback',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 255
  Front Left: 215 [84%] [-20.00dB]
  Front Right: 215 [84%] [-20.00dB]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 63
  Front Left: Capture 39 [62%] [12.00dB] [on]
  Front Right: Capture 39 [62%] [12.00dB] [on]
Simple mixer control '3D',0
  Capabilities: volume volume-joined pswitch pswitch-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 15
  Mono: 3 [20%] Playback [off]
Simple mixer control '3D Filter Lower Cut-Off',0
  Capabilities: enum
  Items: 'Low' 'High'
  Item0: 'Low'
Simple mixer control '3D Filter Upper Cut-Off',0
  Capabilities: enum
  Items: 'High' 'Low'
  Item0: 'High'
Simple mixer control 'ADC Data Output Select',0
  Capabilities: enum
  Items: 'Left Data = Left ADC;  Right Data = Right ADC' 'Left Data = Left ADC;          Right Data = Left ADC' 'Left Data = Right ADC; Right Data = Right ADC' 'Left Da        ta = Right ADC; Right Data = Left ADC'
  Item0: 'Left Data = Left ADC;  Right Data = Right ADC'
Simple mixer control 'ADC High Pass Filter',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'ADC PCM',0
  Capabilities: cvolume
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 255
  Front Left: Capture 195 [76%] [0.00dB]
  Front Right: Capture 195 [76%] [0.00dB]

aBUGSworstnightmare
Posts: 3475
Joined: Tue Jun 30, 2015 1:35 pm

Re: WM8960: CM4 (no i2s audio out, sound card detected)

Sun Aug 01, 2021 5:31 pm

StonedEdge wrote:
Sun Aug 01, 2021 4:48 pm
Great news, this worked and the soundcard now appears after checking with aplay -l, no compiling errors! Nice work. I still cannot get any sound out of it yet, despite it appearing in the list of sound cards. T_T

Here’s the settings I have in alsamixer. I did buy these chips from a non-reputable seller so I am wondering if they are fakes, but I don’t think they would be as the card is recognized via i2c as 0x1a on the bus.

Hopefully it’s just something simple... I am using a 24Mhz xtal for MCLK if that means anything, I think the dtbo was set to 12.28Mhz, assuming there is some sort of divisor going on in the code tho. The serial data line has activity on it when trying to play an mp3 file via mpg123 <mp3 file>. I’m also assuming that I don’t need to compile any overlays related to setting the Pi as i2s slave for this DAC.
...
ahm... You have a different main clock ... So change the overlay source and rebuild it. What do you expect to happen in case of timings that were just crap?
How are the other overlays related to this hardware? Sorry, but please explain. The Pi is not the slave to the DAC, the Pi is the master.

StonedEdge
Posts: 81
Joined: Wed Oct 28, 2020 11:42 am

Re: WM8960: CM4 (no i2s audio out, sound card detected)

Mon Aug 02, 2021 12:16 am

aBUGSworstnightmare wrote:
Sun Aug 01, 2021 5:31 pm
StonedEdge wrote:
Sun Aug 01, 2021 4:48 pm
Great news, this worked and the soundcard now appears after checking with aplay -l, no compiling errors! Nice work. I still cannot get any sound out of it yet, despite it appearing in the list of sound cards. T_T

Here’s the settings I have in alsamixer. I did buy these chips from a non-reputable seller so I am wondering if they are fakes, but I don’t think they would be as the card is recognized via i2c as 0x1a on the bus.

Hopefully it’s just something simple... I am using a 24Mhz xtal for MCLK if that means anything, I think the dtbo was set to 12.28Mhz, assuming there is some sort of divisor going on in the code tho. The serial data line has activity on it when trying to play an mp3 file via mpg123 <mp3 file>. I’m also assuming that I don’t need to compile any overlays related to setting the Pi as i2s slave for this DAC.
...
ahm... You have a different main clock ... So change the overlay source and rebuild it. What do you expect to happen in case of timings that were just crap?
How are the other overlays related to this hardware? Sorry, but please explain. The Pi is not the slave to the DAC, the Pi is the master.
Hmm? I think I’m correct in saying that the DAC is the i2s master (I.e it is the one generating its own clocks from master clock, not the Pi). The Pi is the i2c master though, controlling audio settings of the DAC. I’m referencing the datasheet here, it does look like they have used a 24Mhz crystal... I am driving the codec clocks with this external xtal
https://www.waveshare.com/w/upload/b/b6 ... matic..pdf

aBUGSworstnightmare
Posts: 3475
Joined: Tue Jun 30, 2015 1:35 pm

Re: WM8960: CM4 (no i2s audio out, sound card detected)

Mon Aug 02, 2021 5:52 am

StonedEdge wrote:
Mon Aug 02, 2021 12:16 am
aBUGSworstnightmare wrote:
Sun Aug 01, 2021 5:31 pm
StonedEdge wrote:
Sun Aug 01, 2021 4:48 pm
Great news, this worked and the soundcard now appears after checking with aplay -l, no compiling errors! Nice work. I still cannot get any sound out of it yet, despite it appearing in the list of sound cards. T_T

Here’s the settings I have in alsamixer. I did buy these chips from a non-reputable seller so I am wondering if they are fakes, but I don’t think they would be as the card is recognized via i2c as 0x1a on the bus.

Hopefully it’s just something simple... I am using a 24Mhz xtal for MCLK if that means anything, I think the dtbo was set to 12.28Mhz, assuming there is some sort of divisor going on in the code tho. The serial data line has activity on it when trying to play an mp3 file via mpg123 <mp3 file>. I’m also assuming that I don’t need to compile any overlays related to setting the Pi as i2s slave for this DAC.
...
ahm... You have a different main clock ... So change the overlay source and rebuild it. What do you expect to happen in case of timings that were just crap?
How are the other overlays related to this hardware? Sorry, but please explain. The Pi is not the slave to the DAC, the Pi is the master.
Hmm? I think I’m correct in saying that the DAC is the i2s master (I.e it is the one generating its own clocks from master clock, not the Pi). The Pi is the i2c master though, controlling audio settings of the DAC. I’m referencing the datasheet here, it does look like they have used a 24Mhz crystal... I am driving the codec clocks with this external xtal
https://www.waveshare.com/w/upload/b/b6 ... matic..pdf
I2S != I2C and 'master clock' has no relation to 'bus master'; it's the clock were other required clocks get derived from fig 36 in the data sheet)
Which part of the overlay tells you it is the audio master ?
https://statics.cirrus.com/pubs/proData ... 0_v4.4.pdf

Your OS knows nothing on your hardware, so you need to 'tell' it what to do. I.e. which timings to use etc.. Your overlay and your hardware are inconsistant in case the value 'clock-frequency = <12288000>;' is considered as the input clock to the DAC (as this is 24MHz). I will leave this data sheet digging up to you .. But sorry, from my brief look at it the max mCLK or PLL input frequency given in table 40 is 12,288MHz. Table 45 gives you the divisors needed for 24MHz mclk, up to you if that is what waveshare has implemented. Would also recommend to check which crystal is used on their HAT.

Why not ask waveshare to support? They should know which value to use here.

StonedEdge
Posts: 81
Joined: Wed Oct 28, 2020 11:42 am

Re: WM8960: CM4 (no i2s audio out, sound card detected)

Tue Aug 03, 2021 5:08 am

aBUGSworstnightmare wrote:
Mon Aug 02, 2021 5:52 am
StonedEdge wrote:
Mon Aug 02, 2021 12:16 am
aBUGSworstnightmare wrote:
Sun Aug 01, 2021 5:31 pm

ahm... You have a different main clock ... So change the overlay source and rebuild it. What do you expect to happen in case of timings that were just crap?
How are the other overlays related to this hardware? Sorry, but please explain. The Pi is not the slave to the DAC, the Pi is the master.
Hmm? I think I’m correct in saying that the DAC is the i2s master (I.e it is the one generating its own clocks from master clock, not the Pi). The Pi is the i2c master though, controlling audio settings of the DAC. I’m referencing the datasheet here, it does look like they have used a 24Mhz crystal... I am driving the codec clocks with this external xtal
https://www.waveshare.com/w/upload/b/b6 ... matic..pdf
I2S != I2C and 'master clock' has no relation to 'bus master'; it's the clock were other required clocks get derived from fig 36 in the data sheet)
Which part of the overlay tells you it is the audio master ?
https://statics.cirrus.com/pubs/proData ... 0_v4.4.pdf

Your OS knows nothing on your hardware, so you need to 'tell' it what to do. I.e. which timings to use etc.. Your overlay and your hardware are inconsistant in case the value 'clock-frequency = <12288000>;' is considered as the input clock to the DAC (as this is 24MHz). I will leave this data sheet digging up to you .. But sorry, from my brief look at it the max mCLK or PLL input frequency given in table 40 is 12,288MHz. Table 45 gives you the divisors needed for 24MHz mclk, up to you if that is what waveshare has implemented. Would also recommend to check which crystal is used on their HAT.

Why not ask waveshare to support? They should know which value to use here.
I got the amp working with the latest version of RetroPie for the Pi4, however it required me to run sudo-apt dist-upgrade and also install the latest version of the kernel to even install the drivers. Obviously RetroPie runs on a much earlier version of the kernel (4.7.51-v71+) so I was getting bus errors etc on the latest kernel.

Looks like this DAC drivers are outdated and not compatible. I tried to contact Waveshare 2 weeks ago but didn't hear anything, looks like they are not supporting their products.

aBUGSworstnightmare
Posts: 3475
Joined: Tue Jun 30, 2015 1:35 pm

Re: WM8960: CM4 (no i2s audio out, sound card detected)

Tue Aug 03, 2021 5:52 am

From https://www.waveshare.com/wiki/WM8960_Audio_HAT
Question:
For systems with different kernels, how should I download the corresponding drivers?
Answer:
Check the kernel version first
uname -a
If the kernel version of your system is lower than 5.0 (that is, the Raspberry Pi system version is before 2020-05-27), please download the following driver:
git clone -b rpi-4.9.y https://github.com/waveshare/WM8960-Audio-HAT.git
If the kernel version is higher than 5.0, please download the following driver:
git clone https://github.com/waveshare/WM8960-Audio-HAT
【Note】Please do not run both of the above two commands!
so why not use retropi with one of these kernels?

Not supporting 'their' product? Lol!!! You're copying the design and then expect them to support? Nice approach...
Don't even know if you are just doing a DIY project or if you're up for FOC consulting by the forum members...

Have you even tried to add the 'new driver source' and build it against the kernel? Or do you simply relay on waveshare scripts (from github)?

StonedEdge
Posts: 81
Joined: Wed Oct 28, 2020 11:42 am

Re: WM8960: CM4 (no i2s audio out, sound card detected)

Tue Aug 03, 2021 8:17 am

aBUGSworstnightmare wrote:
Tue Aug 03, 2021 5:52 am
From https://www.waveshare.com/wiki/WM8960_Audio_HAT
Question:
For systems with different kernels, how should I download the corresponding drivers?
Answer:
Check the kernel version first
uname -a
If the kernel version of your system is lower than 5.0 (that is, the Raspberry Pi system version is before 2020-05-27), please download the following driver:
git clone -b rpi-4.9.y https://github.com/waveshare/WM8960-Audio-HAT.git
If the kernel version is higher than 5.0, please download the following driver:
git clone https://github.com/waveshare/WM8960-Audio-HAT
【Note】Please do not run both of the above two commands!
so why not use retropi with one of these kernels?

Not supporting 'their' product? Lol!!! You're copying the design and then expect them to support? Nice approach...
Don't even know if you are just doing a DIY project or if you're up for FOC consulting by the forum members...

Have you even tried to add the 'new driver source' and build it against the kernel? Or do you simply relay on waveshare scripts (from github)?
I am not sure what you meant by "new driver source" - I am not really an expert software engineer but I'm trying to learn here. I've done exactly what you described above, deleted the original .dtbo file from the folder and then ran the above two commands whilst in a folder with the .dts and .dtbo files.

What I meant is that if you sell a product and it doesn't work it's not great on their part, when you buy the hardware I would have thought the software is just as important to get a product working... sorry if I was being rude. Some people have said "don't ask here, just ask waveshare as you wont find the answer here, which made me hesitant in even asking anyone any questions". And I guess to a point, yes for this amp I am not too familiar with its drivers, so was hoping that I could just use their design in my own DIY project. I don't see a problem with it.

Anyway, let me reiterate that sound does indeed work in the configuration menu though. I can hear the clicks of moving up and down the menus, albeit it very laggy. Sometimes the inputs skip a few lines and move the cursor up randomly up and down when I push up on the DPAD, for example. I'm not sure what is causing the bus error, but here is a picture of the error.

https://i.imgur.com/oTj2Bxk.jpg

aBUGSworstnightmare
Posts: 3475
Joined: Tue Jun 30, 2015 1:35 pm

Re: WM8960: CM4 (no i2s audio out, sound card detected)

Tue Aug 03, 2021 8:24 am

https://www.raspberrypi.org/documentati ... uilding.md has the info on how to build the kernel.
As waveshare is stating 'their driver' is fixing a bug which is present in the upstream version I would try to replace the driver in the tree by their version and build it against the kernel.

Make sure to add the overlay as well.

P.S. I'm not a SW expert either!

StonedEdge
Posts: 81
Joined: Wed Oct 28, 2020 11:42 am

Re: WM8960: CM4 (no i2s audio out, sound card detected)

Tue Aug 03, 2021 8:30 am

aBUGSworstnightmare wrote:
Tue Aug 03, 2021 8:24 am
https://www.raspberrypi.org/documentati ... uilding.md has the info on how to build the kernel.
As waveshare is stating 'their driver' is fixing a bug which is present in the upstream version I would try to replace the driver in the tree by their version and build it against the kernel.

Make sure to add the overlay as well.

P.S. I'm not a SW expert either!
Hmm okay, thanks for pointing that first bit out. I'll try and piece it together myself, but essentially my understanding would be to run the above command you provided to convert the dts into a blob, and then recompile the kernel. I'll give it a go.

Cheers

aBUGSworstnightmare
Posts: 3475
Joined: Tue Jun 30, 2015 1:35 pm

Re: WM8960: CM4 (no i2s audio out, sound card detected)

Tue Aug 03, 2021 11:00 am

StonedEdge wrote:
Tue Aug 03, 2021 8:30 am
aBUGSworstnightmare wrote:
Tue Aug 03, 2021 8:24 am
https://www.raspberrypi.org/documentati ... uilding.md has the info on how to build the kernel.
As waveshare is stating 'their driver' is fixing a bug which is present in the upstream version I would try to replace the driver in the tree by their version and build it against the kernel.

Make sure to add the overlay as well.

P.S. I'm not a SW expert either!
Hmm okay, thanks for pointing that first bit out. I'll try and piece it together myself, but essentially my understanding would be to run the above command you provided to convert the dts into a blob, and then recompile the kernel. I'll give it a go.

Cheers
NO! sorry, but it's not that simple! There is a waveshare overlay in the tree, so you need to check what lets the sources (overlay, driver, etc) - in Raspberry Github - differ to the ones from Waveshare git and then update the files in the Rpi repro (if needed).
Once this is done build the kernel.

StonedEdge
Posts: 81
Joined: Wed Oct 28, 2020 11:42 am

Re: WM8960: CM4 (no i2s audio out, sound card detected)

Wed Aug 11, 2021 6:22 am

aBUGSworstnightmare wrote:
Tue Aug 03, 2021 11:00 am
StonedEdge wrote:
Tue Aug 03, 2021 8:30 am
aBUGSworstnightmare wrote:
Tue Aug 03, 2021 8:24 am
https://www.raspberrypi.org/documentati ... uilding.md has the info on how to build the kernel.
As waveshare is stating 'their driver' is fixing a bug which is present in the upstream version I would try to replace the driver in the tree by their version and build it against the kernel.

Make sure to add the overlay as well.

P.S. I'm not a SW expert either!
Hmm okay, thanks for pointing that first bit out. I'll try and piece it together myself, but essentially my understanding would be to run the above command you provided to convert the dts into a blob, and then recompile the kernel. I'll give it a go.

Cheers
NO! sorry, but it's not that simple! There is a waveshare overlay in the tree, so you need to check what lets the sources (overlay, driver, etc) - in Raspberry Github - differ to the ones from Waveshare git and then update the files in the Rpi repro (if needed).
Once this is done build the kernel.
Yeah it works now. I just hooked it up to i2c1 in the end.

aBUGSworstnightmare
Posts: 3475
Joined: Tue Jun 30, 2015 1:35 pm

Re: WM8960: CM4 (no i2s audio out, sound card detected)

Wed Aug 11, 2021 6:46 am

StonedEdge wrote:
Wed Aug 11, 2021 6:22 am
aBUGSworstnightmare wrote:
Tue Aug 03, 2021 11:00 am
StonedEdge wrote:
Tue Aug 03, 2021 8:30 am


Hmm okay, thanks for pointing that first bit out. I'll try and piece it together myself, but essentially my understanding would be to run the above command you provided to convert the dts into a blob, and then recompile the kernel. I'll give it a go.

Cheers
NO! sorry, but it's not that simple! There is a waveshare overlay in the tree, so you need to check what lets the sources (overlay, driver, etc) - in Raspberry Github - differ to the ones from Waveshare git and then update the files in the Rpi repro (if needed).
Once this is done build the kernel.
Yeah it works now. I just hooked it up to i2c1 in the end.
Then please explain why that makes a difference!

Return to “Interfacing (DSI, CSI, I2C, etc.)”