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

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.

4 years later

I'm getting somewhat similar message on Bela Mini:

Error: unable to initialise audio codec
Error: unable to initialise audio
Makefile:613: recipe for target 'runide' failed
make: *** [runide] Error 1

It happens from time to time and power cycling (hard reset) usually helps.

I'm suspecting this might have something to do with two unusual usage scenarios I'm exercising:
1. I'm using the "hidden" analog inputs on PocketBeagle (as discussed in this thread https://forum.bela.io/d/1054-lots-of-inputs-what-are-my-options/22 ) and @giuliomoro mentioned that this method is "not real-time safe at all" - I thought it means that there's a chance of audio drop-outs at most, but maybe the method messes something up in the audio codec as well - could it be so?
2. In this particular Bela Mini I didn't solder the cape directly to the PocketBeagle - I'm using male and female pin stripes soldered to the cape and PocketBeagle, respectively, so in case of any damage it would be easier to disconnect them and replace the broken part. Could it be that the pin-to-pin connection is loose at some critical pins, which causes the issue?

    krzysztofcybulski Error: unable to initialise audio codec

    This means that the codec initialisation didn't go well. Besides gnd and 3v3, the i2c2 scl and sda pins are the only relevant ones at this stage. Is your mini's pins were sawn and placed into regular sockets, it may be that the length of some of them is not quite enough to make a reliable contact and this may be causing the occasional glitch.

    krzysztofcybulski not real-time safe at all" - I thought it means that there's a chance of audio drop-outs at most, but maybe the method messes something up in the audio codec as well - could it be so?

    that won't cause any trouble. The reading is not real-time safe, therefore it takes place in a different thread. But that won't affect codec initialisation, which is what is causing trouble here.

    I don't want to get too optimistic too soon, but it looks like I've found the possible cause of the issue - I was trying to read the "hidden" PocketBeagle analog ins, while reading the "regular" analog ins at the same time by using [bang~] and [snapshot~]. When using each set of analog ins separately, it didn't seem to cause much issue, but when I've used them together, this might have been a little too much for Bela, possibly. I've replaced [bang~] with [metro] and the issue dissapeared (for the time being, at least).

      krzysztofcybulski When using each set of analog ins separately, it didn't seem to cause much issue, but when I've used them together, this might have been a little too much for Bela, possibly. I've replaced [bang~] with [metro] and the issue dissapeared (for the time being, at least)

      [bang~] + [snapshot~] surely increase CPU usage compared to a lower-frequency [metro]. But none of that should explain this error:

      krzysztofcybulski Error: unable to initialise audio codec
      Error: unable to initialise audio

      as codec is talked to before processing of the Pd patch even starts ...