3

Context: I have an audio track separated into individual channels grouped by frequency and speaker location. I need to play all three of these channels simultaneously and perform instructions like play, stop, repeat, skip across all channels to keep them in sync.

This is part of an outdoor installation so the solution must be modular and robust.

If possible, the most elegant solution I could come up with is to use an Arduino Leonardo and stack 3 Adafruit Music Maker Shield on each other.

Reasons why I think it might be technically feasible:

1. Each shield can share communication over I2C

  1. Looking at the VS1053b Datasheet (the IC used in the shield) the chip at max load consumes Maximum 60mA, and typically 37mA. Arduino can drive a max of 500mA so these three shields should consume a small portion of that. The Arduino will also be powered via 12v power supply.

Details i'm not so clear on:

  1. How will I differentiate between each shield when sending instructions or do I need to even need consider this if I want them to function as one?
  • the shield in link uses SPI – Juraj Aug 21 '18 at 13:29
  • 1
    Using 12V as a power source isn't great. The voltage regulator has to burn off 7V to get down to 5V. With these 3 shield and the Leonardo itself, you are looking at around 1 Watt of power the voltage regulator is converting to heat. This will make it quite warm. – Gerben Aug 21 '18 at 14:32
  • I'd personally ditch the Arduino entirely and use something more powerful. Something with an I2S interface, and connect up a CODEC with enough channels to suit your needs. Then you play a single file that has all the channels in it. You know - like surround sound does. – Majenko Aug 21 '18 at 21:30
  • @Gerben So do you recommend to use a 5V 500mA power supply? – Edward Aug 21 '18 at 23:53
  • 2
    A 5V supply would be ideal. Connect it to the USB, not the barrel jack. – Gerben Aug 22 '18 at 6:48
1

The shield actually uses SPI.

So you will need to trace the chip select and make sure that each shield uses a different arduino pin.

0

The shields use SPI. There are more slave select pins on the shield for different devices of the shield. The first shield can use the default pins, but on next shields you must bend the default pins of the shield to side and connect them with a jumper cable to other set of pins of Arduino.

Then in sketch you need to define the select pins in constructor for each instance of the handling object Adafruit_VS1053.

Adafruit_VS1053_FilePlayer musicPlayer = 
  Adafruit_VS1053_FilePlayer(SHIELD_RESET, SHIELD_CS, SHIELD_DCS, DREQ, CARDCS);
Adafruit_VS1053_FilePlayer musicPlayer2 = 
  Adafruit_VS1053_FilePlayer(SHIELD_RESET, SHIELD_CS_2, SHIELD_DCS_2, DREQ_2, CARDCS);
Adafruit_VS1053_FilePlayer musicPlayer3 = 
  Adafruit_VS1053_FilePlayer(SHIELD_RESET, SHIELD_CS_3, SHIELD_DCS_3, DREQ_3, CARDCS);

They will be not in microseconds sync since you must instruct them individually.

Use only one SD card because the SD library can't support more of them. Advantages of one SD card are only one cs pin and less active devices on SPI. There is no direct read by the player from SD card on the same shield.

Note: The SPI device is the SD card not the adapter. An empty adapter is nothing on bus so you can put the card for example into the shield on top and do not need bend the SD card cs pins on other shields.

  • The audio is sound scapes so there are no vocals or beats to align so it being microseconds out of sync will be okay. Why use only one SD card? Each channel will be exported to its own track and each track will be on it's own SD card which will therefore have it's own shield so they can be all played together – Edward Aug 21 '18 at 23:31
  • added to answer – Juraj Aug 22 '18 at 4:34
  • I must use three separate SD cards as each channel has been exported as it's own track. So all three tracks must play at once. I still dont quite understand why you are suggesting to use one SD card in this case. – Edward Aug 22 '18 at 12:39
  • your tracks are files. 3 files on one SD card. the player opens a file from the SD card reads the next buffer and closes the file. when the buffer is almost empty, the player opens the file, reads the next part and closes the file. the 3 players can read files from the same SD card. SD library can't work with multiple SD cards. – Juraj Aug 22 '18 at 12:44
  • I understand now. Thank you for your help @Juraj – Edward Aug 22 '18 at 13:34

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.