To get I2S audio out, what setup or configuration is required?

Robert AlexanderRobert Alexander New Member Posts: 15

We are using the UP-CHT01 and I'm trying just to get sound out for alert type sounds. I don't have room for a big stereo DAC. So I have been trying to use this simple DAC/Amp:
https://learn.adafruit.com/adafruit-max98357-i2s-class-d-mono-amp/

I've downloaded the Aaeon Framework referred to here:
https://forum.up-community.org/discussion/2918/where-can-i-get-a-up-board-sdk-to-write-my-software-to-control-gpio-pins

I think I have a current BIOS and in it have set I2S/GPIO to I2S

I've connected the decoder/amp to the PCM pins of the GPIO as follows:

Amp Vin to pin2 5V and also tried pin1 3.3v with the same success.
Amp GND to pin6 GND
Amp DIN to pin40 PCM_DOUT
Amp BCLK to pin12 PCM_CLK
Amp LRCLK to pin19 PCM_FS (word select = Left Right Clock = Frame Sync)

Now I am able to get a noise out of the speaker when I play a sound or test the speaker but it's not the right sound. It's just sounds like radio tuning chirps.
Are there more settings in the BIOS or some way to configure the Intel SST Audio Device?

Comments

  • glodiglodi New Member Posts: 2

    I've a question ralating BIOS of UP-Board UP-CHT01 R0.7 (UPC1DM07), too:

    How to disable ALC5672 sound codec entry of DSDT ACPI table?

    looking at "iasl -dl dsdt.dat" it seems there is a ALC5672 / RT5672 codec connected on CLK3, I2C2, I2S2.
    (see attachment)

    This makes no sense: 19.2 MHz CLK3 MCLK not available on HAT connector.

    This non-existing Sound codec on Up-Board ACPI table loads 10EC5672 driver which fails on booting:

    On booting linux 4.16.7 I get following error message:
    [ 8.576921] rt5670 i2c-10EC5672:00: Device with ID register 0xffff9547 is not rt5670/72

    Ralating linux sound driver selection on "sound/soc/intel/common/soc-acpi-intel-cht-match.c"
    this prevent loading of default driver "bytcht_nocodec", which just makes I2S available on cherry trail.

    Robert Alexander:
    Linux SST firmware set output to I2S mode, 48 kHz, CLK Master

    Codec needs to be configured as slave, additionally codec must have
    - ether PLL to synchronize internal CLK to 48 kHz frame clock
    - or accepts asynchronous data.
    cause there is no 19,2 MHz MCLK available on UP-Board.

    Maybe Windows driver configures digital snd similar.

    Are there any BIOS-setting or -update availabe without entry of fake sound-codec on DSDT ACPI table ?

  • Robert AlexanderRobert Alexander New Member Posts: 15

    This is interesting information that may be helpful. The codec I'm trying to use does not use the CLK Master thus, I believe, should be working asynchronously. I suppose I could try putting Linux on my test machine and try running the script given for using it on the Pi. That will let me know if this is the hardware or the OS.
    Changing the bios setting does make a difference though. (It's just a chirping noise but it does happen when I'm supposed to get the notification sounds.) So can the call for the ALC5672 driver be disabled by selecting GPIO over I2S in the HAP config in the BIOS?

  • glodiglodi New Member Posts: 2

    It seems on UP-Bios setting "I2S" allways enable ALC5672 device entry on DSDT table.
    If have found no setting to get I2S without ALC5672 codec device.

    ALC5672 used on UP-Audio-HAT - It seems Up-Board Bios supports this codec only.

    Without Kernel Patch I2S Signal can enabled with removing ALC5672 Device by ACPI override:

    • UP Bios/HAT configuration: I2S, ACPI mode
    • Override ACPI DSDT table as written on https://www.kernel.org/doc/Documentation/acpi/initrd_table_override.txt
      Read out ACPI, dissasemble DSDT, remove UP-Audio-Hat ALC5672 device
      Device (RTKC)
      {
      Name (_ADR, Zero) // _ADR: Address
      Name (_HID, "10EC5672") // _HID: Hardware ID
      Name (_CID, "10EC5672") // _CID: Compatible ID
      Name (_DDN, "ALC5672") // _DDN: DOS Device Name
      Name (_UID, One) // _UID: Unique ID
      Name (_PR0, Package (0x01) // _PR0: Power Resources for D0
      ....
      }

    • recompile DSDT (with updated revision) and add to kernel initrd.

    • now, on each boot linux read patched DSDT table.
      [ 0.010623] ACPI: DSDT ACPI table found in initrd [kernel/firmware/acpi/dsdt.aml][0x16094]

    • I2S driver bytcht_nocodec should be loaded cause no other audio codec found:
      [ 10.340215] bytcht_nocodec bytcht_nocodec: snd-soc-dummy-dai <-> media-cpu-dai mapping ok
      [ 10.340291] bytcht_nocodec bytcht_nocodec: snd-soc-dummy-dai <-> deepbuffer-cpu-dai mapping ok
      [ 10.340331] bytcht_nocodec bytcht_nocodec: snd-soc-dummy-dai <-> ssp2-port mapping ok

    • for ALSA following UCM files required https://github.com/plbossart/UCM/tree/master/bytcht-nocodec

    • now Sound card available "sysdefault:CARD=bytchtnocodec"
      Audio:
      Device-1: Intel HDMI/DP LPE Audio driver: HdmiLpeAudio message: bus/chip ids unavailable
      Device-2: bytcht-nocodec driver: bytcht-nocodec message: bus/chip ids unavailable
      Sound Server: ALSA v: k4.20.0-1-default

    PCM5102A codec does not work cause this codec requires 16,20,24 or 32 data bit for PLL [email protected]
    Cherry trail I2S have 25 data bits with resulting BCLK frequency of 48 kHz * 2 * 25 = 2.4 MHz.
    (caused by internal 9.6 MHz audio clock frequency)

    3-Wire-I2S Frame Sync based audio codecs should work.

    This cheap board works fine: "Adafruit I2S Stereo Decoder - UDA1334A Breakout"

    Checked with OpenSUSE Tumbleweed, default Kernel, Plasma5 / Pulseaudio.

Sign In or Register to comment.