giuliomoro / Bela-dhruva

Other
1 stars 0 forks source link

Trill example fails #2

Closed DhruvaG2000 closed 3 years ago

DhruvaG2000 commented 3 years ago

I was just trying out the Trill examples and it seems like there is an i2c bus issue.

# make PROJECT=bar-sound CL=-v run BELA_USE_DEFINE=BELA_USE_POLL
Failed to stop bela_startup.service: Unit bela_startup.service not loaded.
No process to kill
Building library Oscillator
Building library Trill
Building library Trill
Linking...
 ...done
Running /root/Bela-report/projects/bar-sound/bar-sound -v
Xenomai not explicitly inited
Xenomai is going to be inited by us
Bela_initAudio()
Starting with period size 16 ;analog enabled
DAC level 99999997952.000000 dB; ADC level 99999997952.000000 dB; headphone level 99999997952.000000 dB
Detected hardware: Bela
Hardware specified at the command line: NoHardware
Hardware specified in the user's belaconfig: NoHardware
Hardware to be used: Bela
Codec mode: 0 ()
fifoFactor: 1
core audioFrames: 16
Project name: bar-sound
PRU memory mapped to ARM:
digital: 0xb62ab000 0xb62ab400
audio: 0xb62ac000 0xb62ac040 0xb62ac080 0xb62ac0c0
analog: 0xb6f89000 0xb6f89080 0xb6f89100 0xb6f89180
analog offset: 0xcdf000 0xcdf080 0xcdf100 0xcdf180
Failed to open /dev/i2c-1 I2C Bus
Unable to initialise I2C communication
Unable to initialise Trill Bar
Couldn't initialise audio rendering: setup() returned false
Error: unable to initialise audio
make: *** [Makefile:658: runonly] Error 1
giuliomoro commented 3 years ago

it may well be that you are passing the wrong i2c bus as an argument to setup(). I think we went through this in early July ? Use i2cdetect to see what i2c bus the Trill is actually connected to

DhruvaG2000 commented 3 years ago

I think it maybe on i2c-2

$ i2cdetect -r -y 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
giuliomoro commented 3 years ago

That would look fine for Trill Bar

DhruvaG2000 commented 3 years ago

Changed the following line in the example:

 88         if(touchSensor.setup(2, Trill::BAR) != 0) {

and it worked

Should we also add the IS_AM572x flag to the examples?

giuliomoro commented 3 years ago

No not for now. That should be in the documentation.