Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: respeaker 4-mic array and raspberry pi 5 support #342

Open
KamelAbdelouahab opened this issue Jul 9, 2024 · 8 comments
Open

[Bug]: respeaker 4-mic array and raspberry pi 5 support #342

KamelAbdelouahab opened this issue Jul 9, 2024 · 8 comments
Labels

Comments

@KamelAbdelouahab
Copy link

Describe the bug

Hi,

I'm currently building a 4 channel microphone HAT for the raspberry pi based on the AC108. Something similar to the respeaker 4-mic array respeaker 4-mic array (which can not be found anywhere btw) with some camera placeholders.

The current driver is based on the work of HinTak work .

On the RPI-4:
The HAT works pretty well and is able to capture 4 channel audio

On the RPI-5:
I patched the device tree with the new I2S producer/consumer paradigm, which lets me see the sound device and have some records.

/ {
	compatible = "brcm,bcm2712";

	fragment@0 {
		target = <&i2s_clk_consumer>;
		__overlay__ {
			#sound-dai-cells = <0>;
			status = "okay";
		};
	};
...

	fragment@3 {
		target = <&sound>;

		sound_overlay: __overlay__ {
			compatible = "seeed-voicecard";
			seeed-voice-card,format = "dsp_a";
			seeed-voice-card,name = "seeed-4mic-voicecard"; 
			status = "okay";
		
			seeed-voice-card,bitclock-master = <&codec_dai>;
			seeed-voice-card,frame-master = <&codec_dai>;
			seeed-voice-card,channels-playback-override = <4>;
			seeed-voice-card,channels-capture-override  = <4>;

			cpu_dai: seeed-voice-card,cpu {
				sound-dai = <&i2s_clk_consumer>;
				dai-tdm-slot-num     = <4>;
				dai-tdm-slot-width   = <32>;
				//dai-tdm-slot-tx-mask = <1 1 0 0>;
				//dai-tdm-slot-rx-mask = <1 1 0 0>;
			};
			codec_dai: seeed-voice-card,codec {
				sound-dai = <&ac108_a>;
				clocks =  <&ac108_mclk>;
			};
		};
	};
};

However, only one channel among the 4 seems to contain data, other channels have only zeros:
image

Do you have any suggestions related to the cause of this behaviour ? Can this come from the RP1 firmware ?

Expected behavior

Expected behaviour, once the AC108 is detected is a 4-channel audio record, but only one channel (number 2) gets data

Platform

Driver and kernel modules are the same (I literally use the same SD card and I forced and kernel8). The only difference that I see is that the RPi-5 involves the RP1 chip to handle the I2S.

Linux rpi-5b 6.6.31+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.31-1+rpt1 (2024-05-29) aarch64 GNU/Linux

Relevant log output

No response

@HinTak
Copy link
Contributor

HinTak commented Jul 9, 2024

RP5's audio is different from RP4 's . See raspberrypi/linux#5743

There is an older discussion here
HinTak#19
(Though I would really prefer people use the upstream issue tracker)

@KamelAbdelouahab
Copy link
Author

I would have loved to participate in the discussion in HinTak#19. But the owner of this repository has limited the ability to comment to users that are collaborators on this repository. 😃

I will try to use the rpi upstream issue tracker.

@HinTak
Copy link
Contributor

HinTak commented Jul 9, 2024

By "upstream" I mean here, and anywhere else instead of my fork. The limit was intentional. I should have closed it off a lot earlier.

@deansouth8
Copy link

al. I should have closed it off a lot earlier.

Are you saying that THIS upstream driver installation should in theory work for the KEYESTUDIO ReSpeaker 2-Mic Pi HAT V1.0 on latest 64bit Pi 5 or, the scripts at the HinTak git?

@HinTak
Copy link
Contributor

HinTak commented Aug 10, 2024

@deansouth8 I don't know why I need to make this declaration: I am just another past customer of seeedstudio, who happens to be somewhat knowledgeable in linux driver in general. I have no intention of doing seeedstudio's staff work for them. Hence anything I post in public is provided as is, and I prefer not to hear about complaints or bug reports (and people's expectations that I deal with them). If you want to commission me to do that work, please get in touch privately; or you could click on the donate link under my profile for past work. But I have no affiliation with seeedstufio and therefore will not deal with issues/complaints that they should deal with.

@deansouth8
Copy link

I was truly simply asking for a couple distinctions however; No expectation of you taking on responsibilities without compensation.

But I'll continue to allow my intuition to read between the lines. I think I'll take away from this that...
There may be some clues or answers on your git fork but, nothing yet has yet been adopted by seeedstudio or elsewhere.
The limit of comments and stifling of free communication there at the fork was intentional but, not because it functions elsewhere. It's clear this respeaker fork is the proper location for free communication topic.
Leave [HinTak] alone about it unless you pay.

Understood.

@HinTak
Copy link
Contributor

HinTak commented Aug 11, 2024

It is for this kind of abuse going on for many years that I closed off comments on my repo. If you have a complaint / comments / problems about seeedstudio device's driver support, please talk to a seeedstudio employee. Harassing a 3rd party who is nice enough to post "what works for me" publicly, is quite appalling. Enough said.

@HinTak
Copy link
Contributor

HinTak commented Aug 11, 2024

On my repo it is simply one branch for one kernel series - if you are using kernel X.Y.Z, you use the vX.Y branch.

I think upstream stopped updating after about 5.1x .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants