Re: STICKY: The I2S sound thread. [I2S works]
I would recommend to output aplay directly to the the I2S alsa device, no alsa plugins in between (i.e. hw:xxx), to give you certainty of what data/format your I2S interface actually receives.
I2S slot width dai-tdm-slot-width must correspond to your codec sample width. IIUC your codec allows only 16bit and 24bit width (register DAI1/DAI2 Audio Data Bit Depth). Therefore the value in the DTS overlay must be adjusted accordingly.
An oscilloscope check of your I2S output from the codec is very handy in these situations. Even the cheapest scope would do.
I2S slot width dai-tdm-slot-width must correspond to your codec sample width. IIUC your codec allows only 16bit and 24bit width (register DAI1/DAI2 Audio Data Bit Depth). Therefore the value in the DTS overlay must be adjusted accordingly.
An oscilloscope check of your I2S output from the codec is very handy in these situations. Even the cheapest scope would do.
- lucifer_rahul
- Posts: 16
- Joined: Thu Mar 24, 2022 6:48 am
Re: STICKY: The I2S sound thread. [I2S works]
Thanks for the response. As you asked I added the lines as below to my overlay,
dai-tdm-slot-num = <2>;
dai-tdm-slot-width = <16>;
And on CRO I am able to see the I2S clocks and I2S data, but Still no luck on the Speaker side. I am not able to see anything happening over SPKL line and SPKR lines of my codec.
Can you tell like even though we are able to see I2S clock and I2S data on CRO still why the audio codec is not generating the audio. Any response is fine??
dai-tdm-slot-num = <2>;
dai-tdm-slot-width = <16>;
And on CRO I am able to see the I2S clocks and I2S data, but Still no luck on the Speaker side. I am not able to see anything happening over SPKL line and SPKR lines of my codec.
Can you tell like even though we are able to see I2S clock and I2S data on CRO still why the audio codec is not generating the audio. Any response is fine??
Re: STICKY: The I2S sound thread. [I2S works]
If your I2S already feeds data to the codec (easy to see on a scope with LRCLK as trigger), then the problem is with the codec setting now. Any data would be audible, even if some bit shift were to occur (e.g. I2S vs. left-justified discrepancy, etc.). It looks the problem is your codec configuration, not RPi I2S anymore. E.g. dumping the codec registers and comparing their values with the datasheet etc.
- lucifer_rahul
- Posts: 16
- Joined: Thu Mar 24, 2022 6:48 am
Re: STICKY: The I2S sound thread. [I2S works]
Thank you very much for the reply. Could you please also tell what configuration I should exactly check in my codec settings so that I can debug.
Re: STICKY: The I2S sound thread. [I2S works]
Your driver seems to be using standard regmap for register access https://elixir.bootlin.com/linux/latest ... 8088.c#L41 . The registers may be available in debugfs https://linux-zigbee-devel.narkive.com/ ... inux#post2
Also the driver seems to define LOTS of alsa controls, should be available via amixer (beware that alsamixer lists only SNDRV_CTL_ELEM_IFACE_MIXER ctl types, while amixer lists also SNDRV_CTL_ELEM_IFACE_PCM and maybe all https://elixir.bootlin.com/linux/latest ... und.h#L998 ). Likely just configuring the mixer controls will fix your problem.
Also the driver seems to define LOTS of alsa controls, should be available via amixer (beware that alsamixer lists only SNDRV_CTL_ELEM_IFACE_MIXER ctl types, while amixer lists also SNDRV_CTL_ELEM_IFACE_PCM and maybe all https://elixir.bootlin.com/linux/latest ... und.h#L998 ). Likely just configuring the mixer controls will fix your problem.
- lucifer_rahul
- Posts: 16
- Joined: Thu Mar 24, 2022 6:48 am
Re: STICKY: The I2S sound thread. [I2S works]
Thanks for the previous response. The codec configuration I extracted with the help of amixer command. And I found the below settings.
root@raspberrypi:/home/pi# amixer
Simple mixer control 'Headphone',0
Capabilities: volume pswitch
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 31
Front Left: 31 [100%] [3.00dB] Playback [on]
Front Right: 31 [100%] [3.00dB] Playback [on]
Simple mixer control 'Speaker',0
Capabilities: volume pswitch
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 31
Front Left: 31 [100%] [8.00dB] Playback [on]
Front Right: 31 [100%] [8.00dB] Playback [on]
Simple mixer control 'PCM',0
Capabilities: volume
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 255
Front Left: 255 [100%]
Front Right: 255 [100%]
Simple mixer control 'ADCL',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 15
Mono: 15 [100%]
Simple mixer control 'ADCL Boost',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 3
Mono: 3 [100%]
Simple mixer control 'ADCR',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 15
Mono: 15 [100%]
Simple mixer control 'ADCR Boost',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 3
Mono: 3 [100%]
Simple mixer control 'ALC',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'ALC Multiband',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'ALC Release Time',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 7
Mono: 0 [0%]
Simple mixer control 'ALC Threshold',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 7
Mono: 0 [0%]
Simple mixer control 'DAI1 ADC Filter',0
Capabilities: enum
Items: 'Off' 'fc=258/fs=16k' 'fc=500/fs=16k' 'fc=258/fs=8k' 'fc=500/fs=8k' 'fc=200'
Item0: 'Off'
Simple mixer control 'DAI1 DAC Filter',0
Capabilities: enum
Items: 'Off' 'fc=258/fs=16k' 'fc=500/fs=16k' 'fc=258/fs=8k' 'fc=500/fs=8k' 'fc=200'
Item0: 'Off'
Simple mixer control 'DAI1 Filter Mode',0
Capabilities: enum
Items: 'Voice' 'Music'
Item0: 'Music'
Simple mixer control 'DAI2 DC Block',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'EQ1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'EQ2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'EX Limiter Mode',0
Capabilities: enum
Items: 'Off' '100Hz' '400Hz' '600Hz' '800Hz' '1000Hz' '200-400Hz' '400-600Hz' '400-800Hz'
Item0: 'Off'
Simple mixer control 'EX Limiter Threshold',0
Capabilities: enum
Items: '0.6' '1.2' '1.8' '2.4' '3.0' '3.6' '4.2' '4.8'
Item0: '0.6'
Simple mixer control 'INA',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 7
Mono: 7 [100%]
Simple mixer control 'INB',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 7
Mono: 7 [100%]
Simple mixer control 'Left ADC Mixer INA1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left ADC Mixer INA2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left ADC Mixer INB1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left ADC Mixer INB2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left ADC Mixer MIC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left ADC Mixer MIC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left HP Mixer INA1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left HP Mixer INA2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left HP Mixer INB1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left HP Mixer INB2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left HP Mixer Left DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left HP Mixer Left DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left HP Mixer MIC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left HP Mixer MIC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left HP Mixer Right DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left HP Mixer Right DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left REC Mixer INA1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left REC Mixer INA2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left REC Mixer INB1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left REC Mixer INB2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left REC Mixer Left DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left REC Mixer Left DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left REC Mixer MIC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left REC Mixer MIC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left REC Mixer Right DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left REC Mixer Right DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer INA1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer INA2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer INB1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer INB2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer Left DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer Left DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer MIC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer MIC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer Right DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer Right DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'MIC1',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 31
Mono: 31 [100%]
Simple mixer control 'MIC1 Boost',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 2
Mono: 0 [0%] [0.00dB]
Simple mixer control 'MIC2',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 31
Mono: 31 [100%]
Simple mixer control 'MIC2 Boost',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 2
Mono: 0 [0%] [0.00dB]
Simple mixer control 'PWR Limiter Threshold',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 15
Mono: 0 [0%]
Simple mixer control 'PWR Limiter Time1',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 15
Mono: 0 [0%]
Simple mixer control 'PWR Limiter Time2',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 15
Mono: 0 [0%]
Simple mixer control 'PWR Limiter Weight',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 7
Mono: 0 [0%]
Simple mixer control 'Receiver',0
Capabilities: volume pswitch
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 31
Front Left: 0 [0%] [-62.00dB] Playback [on]
Front Right: 0 [0%] [-62.00dB] Playback [on]
Simple mixer control 'Right ADC Mixer INA1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right ADC Mixer INA2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right ADC Mixer INB1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right ADC Mixer INB2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right ADC Mixer MIC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right ADC Mixer MIC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right HP Mixer INA1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right HP Mixer INA2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right HP Mixer INB1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right HP Mixer INB2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right HP Mixer Left DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right HP Mixer Left DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right HP Mixer MIC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right HP Mixer MIC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right HP Mixer Right DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right HP Mixer Right DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right REC Mixer INA1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right REC Mixer INA2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right REC Mixer INB1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right REC Mixer INB2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right REC Mixer Left DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right REC Mixer Left DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right REC Mixer MIC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right REC Mixer MIC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right REC Mixer Right DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right REC Mixer Right DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right SPK Mixer INA1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right SPK Mixer INA2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right SPK Mixer INB1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right SPK Mixer INB2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right SPK Mixer Left DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right SPK Mixer Left DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right SPK Mixer MIC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right SPK Mixer MIC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right SPK Mixer Right DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right SPK Mixer Right DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'THD Limiter Threshold',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 15
Mono: 0 [0%]
Simple mixer control 'THD Limiter Time',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 7
Mono: 0 [0%]
I have connected my external speaker to SPKL-Speaker left line of the codec. And the amixer shows that Left SPK Mixer based settings of audio like Left and Right DAC are turned off. Could this be a problem?? Only speaker line is the output from the codec.
root@raspberrypi:/home/pi# amixer
Simple mixer control 'Headphone',0
Capabilities: volume pswitch
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 31
Front Left: 31 [100%] [3.00dB] Playback [on]
Front Right: 31 [100%] [3.00dB] Playback [on]
Simple mixer control 'Speaker',0
Capabilities: volume pswitch
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 31
Front Left: 31 [100%] [8.00dB] Playback [on]
Front Right: 31 [100%] [8.00dB] Playback [on]
Simple mixer control 'PCM',0
Capabilities: volume
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 255
Front Left: 255 [100%]
Front Right: 255 [100%]
Simple mixer control 'ADCL',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 15
Mono: 15 [100%]
Simple mixer control 'ADCL Boost',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 3
Mono: 3 [100%]
Simple mixer control 'ADCR',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 15
Mono: 15 [100%]
Simple mixer control 'ADCR Boost',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 3
Mono: 3 [100%]
Simple mixer control 'ALC',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'ALC Multiband',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'ALC Release Time',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 7
Mono: 0 [0%]
Simple mixer control 'ALC Threshold',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 7
Mono: 0 [0%]
Simple mixer control 'DAI1 ADC Filter',0
Capabilities: enum
Items: 'Off' 'fc=258/fs=16k' 'fc=500/fs=16k' 'fc=258/fs=8k' 'fc=500/fs=8k' 'fc=200'
Item0: 'Off'
Simple mixer control 'DAI1 DAC Filter',0
Capabilities: enum
Items: 'Off' 'fc=258/fs=16k' 'fc=500/fs=16k' 'fc=258/fs=8k' 'fc=500/fs=8k' 'fc=200'
Item0: 'Off'
Simple mixer control 'DAI1 Filter Mode',0
Capabilities: enum
Items: 'Voice' 'Music'
Item0: 'Music'
Simple mixer control 'DAI2 DC Block',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'EQ1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'EQ2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'EX Limiter Mode',0
Capabilities: enum
Items: 'Off' '100Hz' '400Hz' '600Hz' '800Hz' '1000Hz' '200-400Hz' '400-600Hz' '400-800Hz'
Item0: 'Off'
Simple mixer control 'EX Limiter Threshold',0
Capabilities: enum
Items: '0.6' '1.2' '1.8' '2.4' '3.0' '3.6' '4.2' '4.8'
Item0: '0.6'
Simple mixer control 'INA',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 7
Mono: 7 [100%]
Simple mixer control 'INB',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 7
Mono: 7 [100%]
Simple mixer control 'Left ADC Mixer INA1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left ADC Mixer INA2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left ADC Mixer INB1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left ADC Mixer INB2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left ADC Mixer MIC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left ADC Mixer MIC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left HP Mixer INA1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left HP Mixer INA2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left HP Mixer INB1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left HP Mixer INB2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left HP Mixer Left DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left HP Mixer Left DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left HP Mixer MIC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left HP Mixer MIC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left HP Mixer Right DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left HP Mixer Right DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left REC Mixer INA1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left REC Mixer INA2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left REC Mixer INB1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left REC Mixer INB2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left REC Mixer Left DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left REC Mixer Left DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left REC Mixer MIC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left REC Mixer MIC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left REC Mixer Right DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left REC Mixer Right DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer INA1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer INA2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer INB1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer INB2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer Left DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer Left DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer MIC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer MIC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer Right DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer Right DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'MIC1',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 31
Mono: 31 [100%]
Simple mixer control 'MIC1 Boost',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 2
Mono: 0 [0%] [0.00dB]
Simple mixer control 'MIC2',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 31
Mono: 31 [100%]
Simple mixer control 'MIC2 Boost',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 2
Mono: 0 [0%] [0.00dB]
Simple mixer control 'PWR Limiter Threshold',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 15
Mono: 0 [0%]
Simple mixer control 'PWR Limiter Time1',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 15
Mono: 0 [0%]
Simple mixer control 'PWR Limiter Time2',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 15
Mono: 0 [0%]
Simple mixer control 'PWR Limiter Weight',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 7
Mono: 0 [0%]
Simple mixer control 'Receiver',0
Capabilities: volume pswitch
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 31
Front Left: 0 [0%] [-62.00dB] Playback [on]
Front Right: 0 [0%] [-62.00dB] Playback [on]
Simple mixer control 'Right ADC Mixer INA1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right ADC Mixer INA2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right ADC Mixer INB1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right ADC Mixer INB2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right ADC Mixer MIC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right ADC Mixer MIC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right HP Mixer INA1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right HP Mixer INA2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right HP Mixer INB1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right HP Mixer INB2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right HP Mixer Left DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right HP Mixer Left DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right HP Mixer MIC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right HP Mixer MIC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right HP Mixer Right DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right HP Mixer Right DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right REC Mixer INA1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right REC Mixer INA2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right REC Mixer INB1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right REC Mixer INB2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right REC Mixer Left DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right REC Mixer Left DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right REC Mixer MIC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right REC Mixer MIC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right REC Mixer Right DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right REC Mixer Right DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right SPK Mixer INA1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right SPK Mixer INA2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right SPK Mixer INB1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right SPK Mixer INB2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right SPK Mixer Left DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right SPK Mixer Left DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right SPK Mixer MIC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right SPK Mixer MIC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right SPK Mixer Right DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Right SPK Mixer Right DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'THD Limiter Threshold',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 15
Mono: 0 [0%]
Simple mixer control 'THD Limiter Time',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 7
Mono: 0 [0%]
I have connected my external speaker to SPKL-Speaker left line of the codec. And the amixer shows that Left SPK Mixer based settings of audio like Left and Right DAC are turned off. Could this be a problem?? Only speaker line is the output from the codec.
Re: STICKY: The I2S sound thread. [I2S works]
These configs are specific to your codec which I know nothing about. You will have to check the datasheet and play with the settings.
- lucifer_rahul
- Posts: 16
- Joined: Thu Mar 24, 2022 6:48 am
Re: STICKY: The I2S sound thread. [I2S works]
Thanks for the response. The amixer is showing several settings. But we need only output for one speaker connected over the left speaker line for the codec. The amixer is saying that
Simple mixer control 'Left SPK Mixer Left DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer Left DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer Right DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer Right DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
All the above are linked with the codec left speaker output. And all are saying off. Could this be a problem??
Simple mixer control 'Left SPK Mixer Left DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer Left DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer Right DAC1',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Left SPK Mixer Right DAC2',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
All the above are linked with the codec left speaker output. And all are saying off. Could this be a problem??
Re: STICKY: The I2S sound thread. [I2S works]
Just try and see, I cannot say anything else :-)
- lucifer_rahul
- Posts: 16
- Joined: Thu Mar 24, 2022 6:48 am
Re: STICKY: The I2S sound thread. [I2S works]
A very much thanks for the suggestion for checking the codec settings via registers. I checked it and found that my Speaker power was not enabled. I enabled it and now I am able to get noise on the speaker. Thanks for this. But could you please also help me with clock synchronization also? Now, when I use aplay command I can see noise on CRO and speaker. I believe it is happening because MCLK and BCLK lines are not synchronized.
Could you please suggest a way where I can generate the MCLK line from RPi itself? I believe with this both clocks should be synchronized.
To do this I have been trying to use GPIO clock GP0, GP1, and GP2 for clock sourcing. But so far no luck. Could you please help with this too?
MCLK clock needs a frequency of at least 10MHz.
Re: STICKY: The I2S sound thread. [I2S works]
Noise can be due to missing synchronization, as well as due to incorrect I2S format RPi vs. codec, or both. The format is easy to check with your scope.
RPi cannot generate clean MCLK multiple of standard audio frequencies, it requires the jittery MASH divider https://www.diyaudio.com/community/thre ... er.376583/ . Why don't you switch your codec to I2S master and RPi to I2S slave instead, when you already have clean MCLK clock and your codec implements all the dividers?
RPi cannot generate clean MCLK multiple of standard audio frequencies, it requires the jittery MASH divider https://www.diyaudio.com/community/thre ... er.376583/ . Why don't you switch your codec to I2S master and RPi to I2S slave instead, when you already have clean MCLK clock and your codec implements all the dividers?
- lucifer_rahul
- Posts: 16
- Joined: Thu Mar 24, 2022 6:48 am
Re: STICKY: The I2S sound thread. [I2S works]
I have already followed this, which is making Codec as master and RPi as a slave for I2S. For example below are the interfacing "chunk" details from the device tree for the RPi (I2S slave) and codec (I2S master).
simple-audio-card,bitclock-master = <&dailink0_master>;
simple-audio-card,frame-master = <&dailink0_master>;
simple-audio-card,bitclock-slave = <&dailink0_slave>;
simple-audio-card,frame-slave = <&dailink0_slave>;
simple-audio-card,widgets =
"Speaker", "External Speaker";
simple-audio-card,routing =
"External Speaker", "SPKL",
"External Speaker", "SPKR";
dailink0_slave: simple-audio-card,cpu {
sound-dai = <&i2s>;
dai-tdm-slot-num = <2>;
dai-tdm-slot-width = <16>;
};
dailink0_master: simple-audio-card,codec {
sound-dai = <&max98089>;
};
With this configuration, Alsa is still recognizing the max98089 codec. But when I try to play some WAV file with aplay command it hangs endlessly. I mean the line Playing WAV will come and will continue to be there on the screen.
How do I clear this? Any suggestion is fine...
simple-audio-card,bitclock-master = <&dailink0_master>;
simple-audio-card,frame-master = <&dailink0_master>;
simple-audio-card,bitclock-slave = <&dailink0_slave>;
simple-audio-card,frame-slave = <&dailink0_slave>;
simple-audio-card,widgets =
"Speaker", "External Speaker";
simple-audio-card,routing =
"External Speaker", "SPKL",
"External Speaker", "SPKR";
dailink0_slave: simple-audio-card,cpu {
sound-dai = <&i2s>;
dai-tdm-slot-num = <2>;
dai-tdm-slot-width = <16>;
};
dailink0_master: simple-audio-card,codec {
sound-dai = <&max98089>;
};
With this configuration, Alsa is still recognizing the max98089 codec. But when I try to play some WAV file with aplay command it hangs endlessly. I mean the line Playing WAV will come and will continue to be there on the screen.
How do I clear this? Any suggestion is fine...
Re: STICKY: The I2S sound thread. [I2S works]
I do not know your DTS overlay code, I cannot help you with that.
Does your codec generate correct I2S clocks for RPi? Does RPi generate correct I2S data? All this can be checked with your scope.
Does your codec generate correct I2S clocks for RPi? Does RPi generate correct I2S data? All this can be checked with your scope.
- lucifer_rahul
- Posts: 16
- Joined: Thu Mar 24, 2022 6:48 am
Re: STICKY: The I2S sound thread. [I2S works]
Hi @phofman got the issue with the I2S now. The issue is when we try to set RPi as I2S slave the clocks for the I2S remain in master mode. This I debugged from I2S registers via cat command. The RPi I2S is always settings itself as master for clock. Also I got to know that there is variable that needs to be set so only the RPi I2S will become slave for clock. The variable is CLKM,
In clock master mode (CLKM=0), the PCM_CLK is an output and is driven from the PCM_MCLK clock input.
In clock slave mode (CLKM=1), the PCM_CLK is an input, supplied by some external clock source.
Reference : BCM2835-ARM-Peripherals datasheet https://www.raspberrypi.org/app/uploads ... herals.pdf says on page 120
Could you please help me like where can I set the variable CLKM to 1 ???
I have searched a lot but I didn't get any reference.
Many thanks in advance.
In clock master mode (CLKM=0), the PCM_CLK is an output and is driven from the PCM_MCLK clock input.
In clock slave mode (CLKM=1), the PCM_CLK is an input, supplied by some external clock source.
Reference : BCM2835-ARM-Peripherals datasheet https://www.raspberrypi.org/app/uploads ... herals.pdf says on page 120
Could you please help me like where can I set the variable CLKM to 1 ???
I have searched a lot but I didn't get any reference.
Many thanks in advance.
Re: STICKY: The I2S sound thread. [I2S works]
The master/slave mode of I2S is all about clocks. If your RPi clocks stay master, there is no reason to talk about a slave mode :-)lucifer_rahul wrote: ↑Wed Apr 27, 2022 8:04 amThe issue is when we try to set RPi as I2S slave the clocks for the I2S remain in master mode.
As I said before - try the master/slave DTS overlay from github.
The RPi I2S driver does it for you already.Could you please help me like where can I set the variable CLKM to 1 ???
https://github.com/torvalds/linux/blob/ ... i2s.c#L386
https://github.com/torvalds/linux/blob/ ... i2s.c#L540
https://github.com/torvalds/linux/blob/ ... i2s.c#L400
https://github.com/torvalds/linux/blob/ ... i2s.c#L544
SND_SOC_DAIFMT_XXX_XXX constants are standard part of Alsa SoC framework and are set by your DTS file + the corresponding driver. In case of https://github.com/AkiyukiOkayasu/Raspb ... ocodec.dts the driver is the simple-audio-card driver which gets configured by https://github.com/AkiyukiOkayasu/Raspb ... ec.dts#L18 -> https://github.com/torvalds/linux/blob/ ... tils.c#L55
https://elixir.bootlin.com/linux/latest ... re.c#L3165
config details https://github.com/torvalds/linux/blob/ ... -card.yaml
- lucifer_rahul
- Posts: 16
- Joined: Thu Mar 24, 2022 6:48 am
Re: STICKY: The I2S sound thread. [I2S works]
Hi, can anyone please explain why the dtoverlay=i2s-mmap is not working in rpi-5.15?
Any help is appreciated.
Any help is appreciated.
Re: STICKY: The I2S sound thread. [I2S works]
It has been removed ages ago as it's no longer needed.lucifer_rahul wrote: ↑Fri Jun 03, 2022 6:28 amHi, can anyone please explain why the dtoverlay=i2s-mmap is not working in rpi-5.15?
so long,
Hias
Re: STICKY: The I2S sound thread. [I2S works]
Dear friends,
I've used PCM5100 with CM4 raspberry pi to generate a clear Audio. The problem I faced is that, when I play a music, a very unclear audio play from the speaker.
I've attached a short video that could show the way sound played. And also attached the schematic of Audio part.
Could anyone help me what's wrong with it?
I've used PCM5100 with CM4 raspberry pi to generate a clear Audio. The problem I faced is that, when I play a music, a very unclear audio play from the speaker.
I've attached a short video that could show the way sound played. And also attached the schematic of Audio part.
Could anyone help me what's wrong with it?
- Attachments
-
- PCM5100_CM4.PNG
- PCM5100_CM4.PNG (45.4 KiB) Viewed 44735 times
-
- PCM5100_CM4_ Farima (1) (1).rar
- (112.47 KiB) Downloaded 593 times
- Gustavo_Murta
- Posts: 121
- Joined: Thu Dec 20, 2012 10:04 am
Re: STICKY: The I2S sound thread. [I2S works]
About I2S DAC PCM5100 and PCM5100A
It has optional features but some limitations.
For example, the Clock (MCK or SCK) can be emulated through an internal PLL.
https://www.ti.com/lit/ds/symlink/pcm5101.pdf
https://www.ti.com/lit/ds/symlink/pcm5100a.pdf
"The PCM510x requires a system clock to operate the digital interpolation filters and advanced segment DAC
modulators. The system clock is applied at the SCK input (pin 12) and supports up to 50MHz. The PCM510x
system-clock detection circuit automatically senses the system-clock frequency.
The PCM510x system-clock detection circuit automatically senses the system-clock frequency. Common audio sampling
frequencies of 8kHz, 16kHz, 32kHz - 44.1kHz - 48kHz, 88.2kHz - 96kHz, 176.4kHz -192kHz, and 384kHz with
±4% tolerance are supported.
System Clock PLL Mode
The system clock PLL mode allows designers to use a simple 3-wire I2S audio source when driving the DAC.
The 3-wire source reduces the need for a high frequency SCK, making PCB layout easier, and reduces high
frequency electromagnetic interference.
The device starts up expecting an external SCK input, but if BCK and LRCK start correctly while SCK remains at
ground level for 16 successive LRCK periods, then the internal PLL starts, automatically generating an internal
SCK from the BCK reference. The PCM510x disables the internal PLL when an external SCK is supplied;
specific BCK rates are required to generate an appropriate master clock
Table 11 describes the minimum and maximum BCK per LRCK for the integrated PLL to automatically generate an
internal SCK."
My observation:
With PCM5100 without SCK signal, you must use only common audio sampling
frequencies of 8kHz, 16kHz, 32kHz - 44.1kHz - 48kHz, 88.2kHz - 96kHz, 176.4kHz -192kHz, and 384kHz.
Then you must use the correct BCLK frequency in MHz:
Image
It has optional features but some limitations.
For example, the Clock (MCK or SCK) can be emulated through an internal PLL.
https://www.ti.com/lit/ds/symlink/pcm5101.pdf
https://www.ti.com/lit/ds/symlink/pcm5100a.pdf
"The PCM510x requires a system clock to operate the digital interpolation filters and advanced segment DAC
modulators. The system clock is applied at the SCK input (pin 12) and supports up to 50MHz. The PCM510x
system-clock detection circuit automatically senses the system-clock frequency.
The PCM510x system-clock detection circuit automatically senses the system-clock frequency. Common audio sampling
frequencies of 8kHz, 16kHz, 32kHz - 44.1kHz - 48kHz, 88.2kHz - 96kHz, 176.4kHz -192kHz, and 384kHz with
±4% tolerance are supported.
System Clock PLL Mode
The system clock PLL mode allows designers to use a simple 3-wire I2S audio source when driving the DAC.
The 3-wire source reduces the need for a high frequency SCK, making PCB layout easier, and reduces high
frequency electromagnetic interference.
The device starts up expecting an external SCK input, but if BCK and LRCK start correctly while SCK remains at
ground level for 16 successive LRCK periods, then the internal PLL starts, automatically generating an internal
SCK from the BCK reference. The PCM510x disables the internal PLL when an external SCK is supplied;
specific BCK rates are required to generate an appropriate master clock
Table 11 describes the minimum and maximum BCK per LRCK for the integrated PLL to automatically generate an
internal SCK."
My observation:
With PCM5100 without SCK signal, you must use only common audio sampling
frequencies of 8kHz, 16kHz, 32kHz - 44.1kHz - 48kHz, 88.2kHz - 96kHz, 176.4kHz -192kHz, and 384kHz.
Then you must use the correct BCLK frequency in MHz:
Image
- Attachments
-
- PCM5100A Table11.JPG
- PCM5100A Table11.JPG (44.59 KiB) Viewed 44653 times
- Cory Parsnipson
- Posts: 30
- Joined: Thu Apr 30, 2020 3:44 am
Re: STICKY: The I2S sound thread. [I2S works]
Does anyone know why if I try Adafruit's /dev/zero aplay method manually, everything works fine, but if I add this to a systemd service file, I can't hear any sound output?
In other words, this works:
Then in some other window:
Running this will produce sound.
If I create this file in /etc/systemd/system/aplay.service:
And then do "sudo systemctl start aplay" and then run the speaker-test, I don't hear anything.
This is on an RPi compute module 3+ with a fresh install of raspbian that's about two weeks old.
edit: Oops, forgot to mention that starting the service will cause the speaker test to hang, not just proceed normally while not outputting sound. I've tried adding "User=<user>" to my service file under "[Service]" incase it was a permissions issue and that didn't change anything...
In other words, this works:
Code: Select all
$ /usr/bin/aplay -D default -t raw -r 44100 -c 2 -f S16_LE /dev/zero
Code: Select all
$ speaker-test -c2 --test=wav -w /usr/share/sounds/alsa/Front_Center.wav
If I create this file in /etc/systemd/system/aplay.service:
Code: Select all
[Unit]
Description=Invoke aplay from /dev/zero at system start.
[Service]
ExecStart=/usr/bin/aplay -D default -t raw -r 44100 -c 2 -f S16_LE /dev/zero
[Install]
WantedBy=multi-user.target
This is on an RPi compute module 3+ with a fresh install of raspbian that's about two weeks old.
Code: Select all
Linux raspberrypi 5.15.61-v8+ #1579 SMP PREEMPT Fri Aug 26 11:16:44 BST 2022 aarch64 GNU/Linux- Cory Parsnipson
- Posts: 30
- Joined: Thu Apr 30, 2020 3:44 am
Re: STICKY: The I2S sound thread. [I2S works]
Just double posting to say I've discovered that what seems to be happening is that if I have aplay.service enabled, ALSA grabs the default audio device and then pulseaudio initializes with "dummy output" instead of the correct "analog-output" device because it is busy and that's why I can't hear anything. This doesn't happen if I run the command myself after startup or kill aplay.service and restart it.
So it looks like ALSA and pulseaudio aren't playing nicely with each other in this instance.
I'm brainstorming solutions for this now...
=======================================
e. I switched the service to use pacat (the pulse audio equivalent of aplay).
This goes in ~/.config/systemd/user/pacat.service. And then you run:
Note that there is no "sudo" in this command. Don't forget to disable the aplay service if necessary.
The pops when starting and stopping sound go away, though there is a crackle when the system starts up. The aplay version reduced this crackle to a single pop. Though apparently this noise is a driver issue and the Rpi firmware is not open source, so we're stuck with this.
I'm observing that this process fluctuates between 2% and 0.7% CPU usage and around 1% memory usage at all times in the background, which I think is slightly more than aplay.
So it looks like ALSA and pulseaudio aren't playing nicely with each other in this instance.
I'm brainstorming solutions for this now...
=======================================
e. I switched the service to use pacat (the pulse audio equivalent of aplay).
Code: Select all
[Unit]
Description=Invoke pacat from /dev/zero at system start.
Requires=pulseaudio.socket
[Service]
ExecStart=/usr/bin/pacat /dev/zero
[Install]
WantedBy=default.target
Code: Select all
systemctl --user enable pacat
Code: Select all
sudo systemctl disable aplay
I'm observing that this process fluctuates between 2% and 0.7% CPU usage and around 1% memory usage at all times in the background, which I think is slightly more than aplay.
Re: STICKY: The I2S sound thread.
Hi Rolerex,Rolerex wrote: ↑Tue Sep 17, 2019 10:42 am1/ I picked this loader to have a soundcard showing up in alsa. https://github.com/PaulCreaser/rpi-i2s-audio. I compiled it and put it in /lib/modules/$(uname -r) which is 4.14.79-v7+ for me. I added "my_loader" in /etc/modules which is the name of the .ko file compiled. I also added "snd-bcm2835", i'm not sure if it's necessary but i did it anyway.
I'm also trying to get a PDM-Mic on my Raspi-Zero working. I could reproduce almost all your steps (hope I got that modification of bcm2835-i2s.c right, because I'm using a more recent kernel..). But the my_loader.ko won't make a capture device show up: "arecord -l" shows nothing. Any idea why that could be?
I've also tried Adafruit's snd-i2smic-rpi, which does bring a capture device up, but I only get hiss on my recordings, with different sample- and bitrates.
Re: STICKY: The I2S sound thread. [I2S works]
I am afraid the PDM feature of the RPi I2S peripheral is used only by few people to get specific help here. But IMO you can troubleshoot on your own.
Register values of the PCM peripheral are listed in /sys/kernel/debug/regmap/fe203000.i2s/registers , with reference to https://datasheets.raspberrypi.com/bcm2 ... herals.pdf chapter 7 . Specifically I would check that the PDM mode is enabled - bit PDME/26 of register MODE_A/0x08 (enabled by your i2s driver changes). Also checking the generated bitclock with an oscilloscope may help, also checking the PDM signal from the microphone.
When hooking only one mic, you will get its signal only in one channel, with the other channel being undefined (the data line will be HiZ at the other half of the clock period). Did you check for the signal in the correct channel?
Register values of the PCM peripheral are listed in /sys/kernel/debug/regmap/fe203000.i2s/registers , with reference to https://datasheets.raspberrypi.com/bcm2 ... herals.pdf chapter 7 . Specifically I would check that the PDM mode is enabled - bit PDME/26 of register MODE_A/0x08 (enabled by your i2s driver changes). Also checking the generated bitclock with an oscilloscope may help, also checking the PDM signal from the microphone.
When hooking only one mic, you will get its signal only in one channel, with the other channel being undefined (the data line will be HiZ at the other half of the clock period). Did you check for the signal in the correct channel?
Re: STICKY: The I2S sound thread. [I2S works]
Thanks phofman, this is a good clue: My MODE_A/0x08 register is just zero, so I'll have a look again at modifying and compiling snd-bcm2835.
- chvsree2007
- Posts: 7
- Joined: Wed Nov 16, 2022 7:02 am
Re: STICKY: The I2S sound thread. [I2S works]
Hi, I ran the i2s.c app for Rpi4 Modem B with the below changes but not able to see any waveforms on the scope
BCM2835_PERI_BASE 0x7E000000
GPIO_BASE (BCM2835_PERI_BASE+0x200000)
I2S_BASE (BCM2835_PERI_BASE+0x203000)
CLOCK_BASE (BCM2835_PERI_BASE+0x101000)
Once I run the test .c file, I am able to reach while(1) loop but not able to view any waveform on the scope
Note: Also tried with CLOCK_BASE value as 0x7e101070, 0x7e101074 etc. based on the datasheet, page 82 [https://datasheets.raspberrypi.com/bcm2 ... herals.pdf]
Any suggestions would be helpful.
Thank you
BCM2835_PERI_BASE 0x7E000000
GPIO_BASE (BCM2835_PERI_BASE+0x200000)
I2S_BASE (BCM2835_PERI_BASE+0x203000)
CLOCK_BASE (BCM2835_PERI_BASE+0x101000)
Once I run the test .c file, I am able to reach while(1) loop but not able to view any waveform on the scope
Note: Also tried with CLOCK_BASE value as 0x7e101070, 0x7e101074 etc. based on the datasheet, page 82 [https://datasheets.raspberrypi.com/bcm2 ... herals.pdf]
Any suggestions would be helpful.
Thank you
Return to "Interfacing (DSI, CSI, I2C, etc.)"
Jump to
- Community
- General discussion
- Announcements
- Other languages
- Deutsch
- Español
- Français
- Italiano
- Nederlands
- 日本語
- Polski
- Português
- Русский
- Türkçe
- User groups and events
- Raspberry Pi Official Magazine
- Using the Raspberry Pi
- Beginners
- Troubleshooting
- Advanced users
- Assistive technology and accessibility
- Education
- Picademy
- Teaching and learning resources
- Staffroom, classroom and projects
- Astro Pi
- Mathematica
- High Altitude Balloon
- Weather station
- Programming
- C/C++
- Java
- Python
- Scratch
- Other programming languages
- Windows 10 for IoT
- Wolfram Language
- Bare metal, Assembly language
- Graphics programming
- OpenGLES
- OpenVG
- OpenMAX
- General programming discussion
- Projects
- Networking and servers
- Automation, sensing and robotics
- Graphics, sound and multimedia
- Other projects
- Media centres
- Gaming
- AIY Projects
- Hardware and peripherals
- Camera board
- Compute Module
- Official Display
- HATs and other add-ons
- Device Tree
- Interfacing (DSI, CSI, I2C, etc.)
- Keyboard computers (400, 500, 500+)
- Raspberry Pi Pico
- General
- SDK
- MicroPython
- Other RP2040 boards
- Zephyr
- Rust
- AI Accelerator
- AI Camera - IMX500
- Hailo
- Software
- Raspberry Pi OS
- Raspberry Pi Connect
- Raspberry Pi Desktop for PC and Mac
- Beta testing
- Other
- Android
- Debian
- FreeBSD
- Gentoo
- Linux Kernel
- NetBSD
- openSUSE
- Plan 9
- Puppy
- Arch
- Pidora / Fedora
- RISCOS
- Ubuntu
- Ye Olde Pi Shoppe
- For sale
- Wanted
- Off topic
- Off topic discussion