• Hardware
  • failed to write register 1 on codec...

Hi,

I seem to have an error with one of my bela-capes. The audio thread won't start up and it fails with the error:

Failed to write register
1 on codec
Failed to reset codec
Error: unable to initialise audio codec
Error: unable to initialise audio

Sounds like the I2c device was not inited properly.

Maybe the cape file has not ben loaded properly or you are using the wrong device tree file?or a hardware issue?

Is this a BeagleBone Black? Does the error affect the cape or the SD image? (Can you try swapping them around?) there is another thread here on how to check the status of the i2c bus

    I've tried on different beaglebones Black with the same SD and same Bela-cape -> error occurred.
    Same SD, same BeagleBone Black, different Bela-cape -> no error.

    My fear is that I accidentally blew something up on that one Bela-cape.

    Where is the link to the how to check the i2c bus status?

      nescivi to check if the codec is responding to I2C, run this command:

      i2cdetect -y -r 2

      You should be able to see something like the following:

           0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
      00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
      10: -- -- -- -- -- -- -- -- 18 -- -- -- -- -- -- -- 
      20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
      30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
      40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
      50: -- -- -- -- UU UU UU UU -- -- -- -- -- -- -- -- 
      60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
      70: -- -- -- -- -- -- -- --  

      which shows there is a device active at address 0x18 which is the address of the codec.

      ok...

      I am missing the 0x18...

          0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
      00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
      10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
      20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
      30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
      40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
      50: -- -- -- -- UU UU UU UU -- -- -- -- -- -- -- -- 
      60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
      70: -- -- -- -- -- -- -- --   

      the voltages on the audiocodec chip seem fine; i2c channels also connect correctly.

      nescivi it looks like the codec has been damaged, you will probably need a new cape. There are some 1.8v signals going into the MCASP port of the codec which can be damaged if they are connected to anything higher, they are P9 pins 25, 28, 29, 30 and 31.

      We will follow up offline on what to do in your case.

      10 months later

      I had the same errors and am also missing the 0x18 when I run the command i2cdetect -y -r 2

      are there any other troubleshooting techniques or is the bela cape likely shot?

      10 months later

      Hi guys,

      I have ran into the same error apparently on Bela Mini:

      "Failed to write register 1 on I2c codec
      Failed to reset I2C codec
      Error: unable to initialise audio codec
      Error: unable to initialise audio"

      Not sure where to run the "i2cdetect -y -r 2" command tho.
      Could you guide me to perform this check please?

      Thank you,

      Adrien

      You can run i2cdetect -y -r 2 in the console at the bottom of the IDE.

      Also, make sure you power cycle the board by completely removing the power (e.g.: disconnect the USB and re-connect it, do not simply do reboot), as some times the codec gets stuck and requires such a hard reboot.

      7 days later

      Thank you Giulio!
      Seems good then if I don't misinterprete.

           0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
      00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
      10: -- -- -- -- -- -- -- -- 18 -- -- -- -- -- -- -- 
      20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
      30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
      40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
      50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
      60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
      70: -- -- -- -- -- -- -- --                         

      Yeah that looks ok. Can you add --verbose in the User Command Line Arguments: field in the IDE project setting and then run the project again? That may print some more useful details.

      Same result

            0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
       00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
       10: -- -- -- -- -- -- -- -- 18 -- -- -- -- -- -- -- 
       20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
       30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
       40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
       50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
       60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
       70: -- -- -- -- -- -- -- --                         

      I mean, run the Bela program with --verbose and if it fails, see if you get some extra information

      6 months later

      Hi,

      I'm having the same issue with a CTAG FACE cape. Using the command

      i2cdetect -y -r 2

      I get the following result:

           0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
      00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
      10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
      20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
      30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
      40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
      50: -- -- -- -- UU UU UU UU -- -- -- -- -- -- -- -- 
      60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
      70: -- -- -- -- -- -- -- --     

      I have received the FACE Cape recently, is this a hardware issue (cape damaged)?
      (I have a Bela Cape with a BeagleBone Black working with no problems)

      The codec for the CTAG cards is not on the I2C bus, so it's normal not to see it with i2cdetect. The CTAG cards need Bela image v0.3.6a or later. You can check the version of your image you are running by reading it above the prompt when you log into the board, or running grep v0 /etc/motd. If you have an older Bela SD card, you would have to update it to the latest release.

      Once you have a suitable image, does the problem persist?

      If it does, can you run ls /dev/spidev* on the board and post the result?
      If you obtain /dev/spidev32766.0 /dev/spidev32766.1, then it means that the SPI devices used to configure the codec are correctly initialized. If you don't see those there, that would be very weird.

      If the devices are listed, but the problem persist, then run board_detect on the board and post the result.

      Then, run the Bela program that you are trying to start with --verbose (either from the command line, or adding --verbose to the "Command line options" in the IDE tab) and post the result of that.