Unicorpse - so I tried the 3.3V and basically went back to basics, even resoldering one of the resistor dividers and trying the different voltage out pins etc, still with no change.

I take it this means that it didn't work powering from 3.3V ? Ok, but that was worth trying.

Unicorpse However and I hope this isn't me being dumb from the very start... But I tried powering one of the sensors from the analog 5V, and the second sensor separately powered from the P9.07 pin - and it worked! (Still resistor divider on each sensor echo out).

That does not make any sense, I have no idea what is going on here.

Unicorpse Both sensors are a teeny bit delayed it seems but I'm over the moon that they are both working and sending readable data! I

Not sure how any of the above would make any difference in terms of delay, but again, I don't understand what the problem was /is.

Unicorpse What do you think? Is this performing as expected - was I supposed to do this from the very start?? Vice versa are there any reasons why I shouldn't do this?

I am very surprised it didn't work otherwise. If it works... good for you! but I am very confused.

Unicorpse Thank you so much again for all your help with this - there's no way I would have kept pushing on without your suggestions or support and I've learned a lot in the process.

ha, you are welcome. In the process I lost a lot of confidence in determinism and science πŸ™‚

Unicorpse But I tried powering one of the sensors from the analog 5V, and the second sensor separately powered from the P9.07 pin - and it worked!

I mean ... maybe there is one explanation, but it will sound very silly. Let's say you that [for whatever reason], you have exactly 29mA spare current available from the 5V supply. Now:
- if you connect the two sensors to P9.07, they will draw 30mA total (15mA each) and therefore will not work.
- If you connect only one sensor at the 5V from the analog out header, this will actually be underpowered at 3.5V, and draw less current, 10.5mA, but nevertheless work.
- If you connect both sensors there, then the voltage will be so low that they will both stop working (even though they do not exceed the available current).
- if you plug one on P9.07 and one on the analog out, they will absorb 15mA and 10.5mA respectively, so everything will work fine

However:

  • I would expect you to have far more than 29mA available on the 5V rail (there should be at least 200mA, I estimate)
  • if you were actually overloading the 5V rail, I would expect the power management IC to just shut down everything.
  • this does not explain why connecting only one sensor to P9.07 does not work.
  • Β―\_(ツ)_/Β―
13 days later

Hi! Sorry for the slow reply... I've been working away on the project but was meaning to get back to you to talk it through to see if we can't get to the bottom of this mystery πŸ™‚

However in the meantime a terrible thing has happened (day before installation - wonderful...). I'm not sure how but my render file has completely disappeared from the Bela completely randomly. I remember I had copy and pasted my code onto this thread but that appears to have been edited out. Is it possible to go back through the thread archive to recover the code I copied, so I can copy it back onto the bela please??

Once this project is over I'd love to go through the possibilities to see what the issue might have been!

Unicorpse Me again... I'm trying to recreate the custom cpp file but now getting this error:

ehmm... I posted it above, minutes after your earlier comment.

giuliomoro Sorry I missed this reply before writing again! Thanks - I'll test that out now

How do I check the board version?

    Unicorpse How do I check the board version?

    run grep v0 /etc/motd in the console at the bottom of the IDE. Also, do you know when you last updated your core code (if ever?)

    (also, I am going to edit out your code again).

      giuliomoro Sorry, yes my page didn't update before I wrote again in a panic πŸ™‚ I tested that code you linked to and it is working again! Thank you!! Edit away... Got that code saved this time...!

      I do not think I have ever updated my core code! Is there a description of that on the bela guides?

      And on running the version check it's "Bela image, v0.3.6b, 23 October 2018"

      Sound quality is suddenly very bad even though it's running the same PD patch & audio files... Not sure what could have changed there...

        hmm. Do you get error messages in the console?

        Unicorpse And on running the version check it's "Bela image, v0.3.6b, 23 October 2018"

        Oh that's sad: I believe a fix to a problem similar to the one you reported (content of the file disappearing) was fixed around March 2018, so the above tells us that you already have the fix in your code, which means we should start chasing a new bug.

          giuliomoro Ah ok, that is sad πŸ™ hopefully it helps hone down the issue though!

          Also now seeing these errors, may have seen some of these previously with the old code but not sure:

          Too many messages have been printed to the console too quickly. Reduce your printing frequency
          Underrun detected: 8 blocks dropped
          3 mode switches detected on the audio thread!

            Unicorpse Too many messages have been printed to the console too quickly. Reduce your printing frequency
            Underrun detected: 8 blocks dropped
            3 mode switches detected on the audio thread!

            if you get these only once at the beginning, then it should be fine. Not sure what else could have changed since then? Can you print the values from the sensors and make sure they are ok?

              giuliomoro The sensor values are printing ok so that seems fine.

              I just tried to restart the bela & the ide to see if there were any changes and got these errors though, that I've never seen before... Something seems to have gone awry here?

              Nov 03 17:17:08 bela stdbuf[740]: make: Leaving directory '/root/Bela'
              Nov 03 17:17:08 bela systemd[1]: bela_startup.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
              Nov 03 17:17:08 bela systemd[1]: bela_startup.service: Unit entered failed state.
              Nov 03 17:17:08 bela systemd[1]: bela_startup.service: Failed with result 'exit-code'.
              Nov 03 17:17:08 bela systemd[1]: bela_startup.service: Service hold-off time over, scheduling restart.
              Nov 03 17:17:08 bela systemd[1]: Stopped Run Bela at boot.
              Nov 03 17:17:08 bela systemd[1]: bela_startup.service: Start request repeated too quickly.
              Nov 03 17:17:08 bela systemd[1]: Failed to start Run Bela at boot.
              Nov 03 17:17:08 bela systemd[1]: bela_startup.service: Unit entered failed state.
              Nov 03 17:17:08 bela systemd[1]: bela_startup.service: Failed with result 'exit-code'.

                Unicorpse Nov 03 17:17:08 bela systemd[1]: bela_startup.service: Unit entered failed state.

                this means that the program that starts at boot has crashed repeatedly shortly after being started. Not sure what the reason for that would be. Try maybe to clean the project (in the project tab), then rebuild it. Then go to the configuration tab and set the startup program to "β€’none" and then to your program again.

                  giuliomoro Thanks - I'm not sure how to clean it or what to change...

                  Do you mean change "Run project on boot" in the Settings tab to "none"? When this is the case the project still runs when started manually but the audio still sounds really bad.

                  Could it be a settings thing - though I'm not sure what could differ from the old code? The sample rate is set to 22050 just now (for 8 channels) - it must have been that before but the audio sounds stuttery and low quality so could it be related?

                  Alternatively, if this has happened from nowhere with the code disappearing - has the board failed somewhere?

                    Unicorpse Alternatively, if this has happened from nowhere with the code disappearing - has the board failed somewhere?

                    this is very unlikely: the code disappearing is a problem with the editor (IDE), but that has nothing to do with the actual audio processing.

                    Unicorpse - it must have been that before but the audio sounds stuttery and low quality so could it be related?

                    can you try to:
                    - remove all connections to [dac~] in your patch.
                    - add to the patch

                    [osc~ 440]
                    | 
                    [dac~]

                    can you hear the sinewave just fine?

                      giuliomoro Thanks that's reassuring at least!

                      Ok I tried that - osc works fine as a standalone patch on my laptop (of course), but interestingly, when it's uploaded to the Bela there is no sound?

                      oh. Does it work in a new project (without the render.cpp file)?

                        giuliomoro It doesn't appear to... Not hearing anything. I tested it with a completely blank patch and just that osc too (tried including a "; pd dsp 1" message too, and sending to all 10 channels on the dac~)