I applied the above changes to cvi_board_init.c and do not see valid I2S signals on the TX+/- and RX +/- signals. I do see periodic bursts of noise on these pins that seem to be unrelated to audio activity.
Running aplay junk.wav on a valid WAV file delays for the proper duration of the audio file and the following appears in dmesg:
[ 309.296127] cvitek-i2s 4120000.i2s: Audio system clk=24576000, sample rate=8000
[ 311.290543] cvi_i2s_shutdown not start *dai = 000000003538aef8, *dai->playback_dma_data = 000000005c444c97
So it seems that there are still some kinks to work out of the max98357 driver. Great progress though!
I’ve confirmed that the mic input is working to capture audio. I injected a 440Hz sine tone into the lower terminal of the mic footprint (as viewed from the top with the “milkv” logo right-side up) and was able to capture the waveform at the proper frequency into a .wav file for analysis. I’ve attached an Audacity plot. Note that the 0dB full scale signal appears to be ~1Vpp so an ordinary electret microphone will generate a fairly weak signal.
and playing to that device does not generate errors. The interesting thing is that now an additional line appears in dmesg when playing to either device (compare to my postings earlier in this thread above, note the cvitek-i2s-subsys lines):
[ 176.302750] cvitek-i2s 4130000.i2s: Audio system clk=16384000, sample rate=8000
[ 176.302835] cvitek-i2s-subsys 4108000.i2s_subsys: Set clk_sdma_aud0~3 to 16384000
[ 178.298603] cvi_i2s_shutdown not start *dai = 00000000f070b332, *dai->playback_dma_data = 00000000441b583f
[ 205.619981] cvitek-i2s 4120000.i2s: Audio system clk=24576000, sample rate=8000
[ 205.620068] cvitek-i2s-subsys 4108000.i2s_subsys: Set clk_sdma_aud0~3 to 24576000
[ 207.615152] cvi_i2s_shutdown not start *dai = 00000000fb404674, *dai->playback_dma_data = 0000000016d59df9
I still don’t see any activity on the TX+/- and RX+/- pins that seem to be related to audio though.
I’ve got a few other minor tweaks to the DTS that I’m going to try.
Did a little test to see if the internal audio DAC is actually working on the LED output pin: I disabled the LED blink script and then played a 440Hz tone out through the on-chip codec DAC connected to the LED pin and the LED blinked at a fast rate, suggesting that the on-chip audio output is working.
Big question is why the I2S bus signals aren’t showing up on the the TX+/- & RX+/- pins. Like dnech above I’ve confirmed that the pinmux control registers for those pins are all set to 7.
I captured the pin waveform and found that there is a regular interval of data transmission, even if the audio is not played. I am looking for any configuration abnormalities and unsure if it is related to ETH.
I’ve seen the regular burst of data too. No idea what it is and agree that it is unrelated to audio activity. It’s also very high frequency which would suggest that it’s 100Mbps ethernet, despite the fact that the pinmux registers are set to 7 which should be the I2S port. I’m wondering if the ethernet needs to be completely disabled - perhaps by removing it from the kernel configuration?
Because I see these bursts of data coming out even before running aplay and also well after it completes.
I disabled several items in build/boards/cv180x/cv1800b_milkv_duo_sd/linux/cvitek_cv1800b_milkv_duo_sd_defconfig which appeared to be related to ethernet and I still see the bursts of data:
I tried using the devmem command line tool to read & write to the pinmux registers as suggested above by dnech. I was able to write and read back the expected values as written and attempted a variety of values - none had any effect on the signals observed on the ETH pins. I was still seeing the bursts of activity on the TX+/- pins regardless of the pinmux settings for addresses 0x030010c0 - 0x030010cc. It’s almost as if the documentation for those registers is incorrect, or else there’s some other settings that override their function.
I tried that and now I see completely different patterns of digital data on the TX/RX pins. I also can no longer ssh or ping the Duo over the USB RNDIS interface. The serial console on pins 16 & 17 still works and ifconfig shows net device usb0 with the expected IPv4 address, but nothing shows up on the USB port of the host.
Yeah, it really does - the RX pins (yellow/red) are inverse of the TX pins (blue/green). But notice - it’s really slow data, toggling at only a few Hz. Very weird.
I haven’t tried your suggestion of poking around in the 0x03009000 address range yet but I want to try that too. I notice that address space is marked “Reserved” in the datasheet. Yay - undocumented features!