MUSE PROTO board

Cool setup!
The speaker is second hand from other devices (Up cycling rules) I chose the best sounding one but because of that it is totally undocumented. I took the time to dismantle some and the internal design is pretty amazing. But as it is already a sealed speaker my feeling is that sealing it in another enclosure will not improve anything. If you do a 3d design just put the gasket against the printed hole.

I could give make the frequency response of the speaker later this week so you can get the exact equalizer correction you need.

Thank you. I did start to make a case to test whether enclosing the speaker would help, but after I made the lid I realised it was not having much effect. I even added a close-fitting fence around the speaker, in case the footprint of the PCB was too big, but again, no change. I guess thatā€™s because itā€™s already sealed, as you say.

You have the STL file of this board if you need it in the faq section

Hi, I have the muse Proto board connected to batteries an a speaker, everything works well with squeezelite, but when battery is dead and reconnected the power to charge the Proto does not come back as a LMS player.
Same as I read about muse luxe, the board start in recovery mode, the problem is that I can exit recovery mode, it shows again as LMS player, but no sound from the speaker. I found that after this occur, the DAC output in the hardware section is empty (blank), I can change to I2S and save, but the sound does not come back.
Only way to back to normal operation is flash again the Proto bin fileā€¦
Is this normal? Is there a way to fix this?

Thanks.

Hi Tobal
I think that this is not really an hardware problem as we donā€™t see this behaviour with other software we provide such as the simple bluetooth or radio example.

The talented Squeezelite team mentionned on slim device this issue and possible resolution, but iā€™m not sure it it has been resolved yet. I would recomand to utpdate via the web interface with the lattest generic version.

Sorry but canā€™t help more.

But the no sound problem after exit recovery is also a software problem?
How can I get sound again without start from zero?
(Reinstall the Proto bin file)

Thanks

I advance that this is a software issue because of this cross test : I have seen the issue on 3 different hardware when doing many unexpected hard reset : a standard ESP32 generic dev boad with a dac, Muse Proto and Muse Luxe, but I did not seen this issue with the Simple bluetooth sketch on the same hardwares.

This will require an important software modification of SqueezeLite that is a little bit above our skills, let me talk to Philippe44 about it

Hi!
Iā€™ve just bought this product (RASPIAUDIO ESPMUSE Proto esp32 Carte de dĆ©veloppement with Speaker and Microphone) and it has really cool design and functionality that absolutely covers my requirements (I am doing smart speaker).

I have some troubles building example from this repo https://github.com/RASPIAUDIO/Simple_Bluetooth_Speaker_ESP32, particularly this example https://github.com/RASPIAUDIO/Simple_Bluetooth_Speaker_ESP32/blob/master/speaker/speaker.ino , because probably I donā€™t have much experience with c++ and example is complex and contains multiple features. At the moment I have some troubles with imported dependencies that have breaking changes. It would be nice to know versions of such dependencies (esp-idf, arduino-esp32) or actualize speaker.ino.

What would really cool to have in github repo is a few simple sketches:

  • playing of a single file from SD card
  • simple button example
  • simple led example
  • simple recording and play example

Really big thanks for CAD.stl !

Hi Alesey,

Have you tried to copy the ā€œmuse_libā€ directory in your arduino library directory ? All dependencies should be there.

copy this directory to :
/your username/Documents/Arduino/libraries/

Yes, I did it. Iā€™ve added logs and explanation here:

In adruino try to downgrade your ESP32 board manager to 1.0.5:
" Note that for now the code ONLY COMPILES WITH VERSION 1.0.5"

Espressif have updated some library and it seems that some #define have been renamed.

1 Like

Thank you for your help, Raspiaudio!

I can compile it now, problem solved :slight_smile:

What Iā€™ve done so far (MacOs):

  1. (was not required) Uninstalled Arduino + removed /Users/aleksey/Documents/Arduino (sketches and libraries) + removed /Users/aleksey/Library
  2. (was not required) Downloaded and installed the latest version of Arduino
  3. Installed Esp32 board version 1.05 (<<< that was important)
  4. Copied muse_lib to /Users/aleksey/Library/
  5. Copied sketch from here https://raw.githubusercontent.com/RASPIAUDIO/Simple_Bluetooth_Speaker_ESP32/master/speaker/speaker.ino
  6. Verify

I had:

In file included from /Users/aleksey/Documents/Arduino/muse_test/muse_test.ino:20:0:

/Users/aleksey/Documents/Arduino/libraries/muse_lib/src/Audio.h:15:10: fatal error: FS.h: No such file or directory

#include ā€œFS.hā€

^~~~~~

compilation terminated.

  1. I forget to select the board (ā€œESP32 Wrover Moduleā€),

Now it compiles!


I still have some trouble with playing files from SD. Iā€™ve built a sketch that can only work with .wav and 44100 kHz but it looks far from optimal.

Could you provide the simplest sketch for reading a file by name from SD card and playing it?
Could you provide supported SD card capacities and expected file system format? I have a 32Gb microSD card with FAT32, will it work?

Here is my sketch:

#include "Arduino.h"
#include "SD.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "esp_log.h"
#include <driver/i2s.h>
#include "SPIFFS.h"

#define I2SR (i2s_port_t)0
#define VM GPIO_NUM_0       // button
#define ONled 0
#define PW GPIO_NUM_21        // Amp power ON
#define GAIN GPIO_NUM_23      //
#define BLOCK_SIZE 128
#define SD_CS 13

bool testOK;
static bool mp3ON;

const i2s_config_t i2s_configR = {
  .mode = i2s_mode_t(I2S_MODE_MASTER | I2S_MODE_RX | I2S_MODE_TX ), // Receive, transfer
  .sample_rate = 44100,                         //
  .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT, //
  .channel_format = I2S_CHANNEL_FMT_ONLY_RIGHT, // although the SEL config should be left, it seems to transmit on right
  .communication_format = i2s_comm_format_t(I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB),
  .intr_alloc_flags = ESP_INTR_FLAG_LEVEL1,     // Interrupt level 1
  .dma_buf_count = 4,                           // number of buffers
  .dma_buf_len = BLOCK_SIZE                           // samples per buffer
};

i2s_pin_config_t pin_configR =
{
  .bck_io_num = 5 ,    // BCKL
  .ws_io_num = 25 ,    // LRCL
  .data_out_num = 26,  // DOUT
  .data_in_num = 35    // DIN
};

static void playAudio(void)
{
  int16_t s0, s1;
  static int8_t c[44100];
  int l;
  size_t t;
  uint16_t s16[64];
  int a = 0;

  i2s_set_clk(I2SR, 44100, I2S_BITS_PER_SAMPLE_16BIT, I2S_CHANNEL_MONO);

  File f = SD.open("/500hz44100Mono.wav", FILE_READ);
  // File f = SPIFFS.open("/bluetooth.wav", FILE_READ);
  if (f == NULL) printf("err opening file\n");
  // header read
  f.read((uint8_t*)c, 44);

  do
  {
  // data read
  l = (int)f.read((uint8_t*)c, 44100);
  if (l < 0) printf("Erreur \n");
  //  i2s_zero_dma_buffer(I2SR);
  for (int i = 0; i < l; i++)
  {
    // sample value 8bits -> 16
    s0 = (((int16_t)(c[i] & 0xFF)) - 128) << 8 ;
    // attenuation  a
    s0 = s0 >> a;
    // buffering -> s16
    s16[i % 64] = (uint16_t)s0;
    if (((i + 1) % 64) ==  0)
    {
      int n = 0;
      //sending
      while (n == 0) n = i2s_write_bytes(I2SR, (const char*)s16, 128, portMAX_DELAY);
    }
  }
  }while(l > 0);
  // muting after playing
  for (int i = 0; i < 64; i++)s16[i] = 0;
  int n = 0;
  while (n == 0) n = i2s_write_bytes(I2SR, (const char*)s16, 128, portMAX_DELAY);
  i2s_zero_dma_buffer(I2SR);

  f.close();
  printf ("Play End\n");
}

#define SPI_MOSI 15
#define SPI_MISO 2
#define SPI_SCK 14

void setup()
{
  Serial.begin(115200);
  esp_err_t err;

  if (!SPIFFS.begin(true))Serial.println("Erreur SPIFFS");

  SPI.begin(SPI_SCK, SPI_MISO, SPI_MOSI);
  if(!SD.begin(SD_CS))
  {
    Serial.printf("SD initialization failed!\n");
  } else {
    Serial.printf("SD initialization successfully\n");
  }
  
  //Init buton
  gpio_reset_pin(VM);
  gpio_set_direction(VM, GPIO_MODE_INPUT);
  gpio_set_pull_mode(VM, GPIO_PULLDOWN_ONLY);

  // Amp power enable
  gpio_reset_pin(PW);
  gpio_set_direction(PW, GPIO_MODE_OUTPUT);
  gpio_set_level(PW, 1);

  gpio_reset_pin(GAIN);
  gpio_set_direction(GAIN, GPIO_MODE_OUTPUT);  
  gpio_set_pull_mode(GAIN, GPIO_PULLDOWN_ONLY);   // 15dB
  i2s_driver_install(I2SR, &i2s_configR, 0, NULL);
  i2s_set_pin(I2SR, &pin_configR);
  i2s_stop(I2SR);
}

void loop() {
 
  if (gpio_get_level(VM) == 0)
  {
    //playing 
    printf("Playing\n");
    i2s_start(I2SR);
    playAudio();
    delay(100);
    i2s_stop(I2SR);
  }
}

Could you provide the simplest sketch to read a file by name from the SD card and play it back?

// Plays: 8bit mono 44100hz wav file:

#include "Arduino.h"
#include "SD.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "esp_log.h"
#include <driver/i2s.h>
#include "SPIFFS.h"

const uint8_t VOLUME = 31; // 0..63

#define I2SR (i2s_port_t)0
#define VM GPIO_NUM_0       // button
#define ONled 0
#define PW GPIO_NUM_21        // Amp power ON
#define GAIN GPIO_NUM_23      //
#define BLOCK_SIZE 128
#define SD_CS 13

const i2s_config_t i2s_configR = {
  .mode = i2s_mode_t(I2S_MODE_MASTER | I2S_MODE_RX | I2S_MODE_TX ), // Receive, transfer
  .sample_rate = 44100,                         //
  .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT, //
  .channel_format = I2S_CHANNEL_FMT_ONLY_RIGHT, // although the SEL config should be left, it seems to transmit on right
  .communication_format = i2s_comm_format_t(I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB),
  .intr_alloc_flags = ESP_INTR_FLAG_LEVEL1,     // Interrupt level 1
  .dma_buf_count = 64,                           // number of buffers
  .dma_buf_len = BLOCK_SIZE                           // samples per buffer
};

#define I2S_DOUT      26
#define I2S_BCLK      5
#define I2S_LRC       25
#define I2S_DIN       35

i2s_pin_config_t pin_configR =
{
  .bck_io_num = I2S_BCLK,   
  .ws_io_num = I2S_LRC,   
  .data_out_num = I2S_DOUT,
  .data_in_num = I2S_DIN
};

static void playAudio(char* fileName)
{
  printf("Playing file ");
  printf(fileName);
  printf("\n");
  
  int16_t s0, s1;
  static int8_t c[44100];
  int l;
  size_t t;
  uint16_t s16[64];
  int a = 0;

  i2s_set_clk(I2SR, 44100, I2S_BITS_PER_SAMPLE_16BIT, I2S_CHANNEL_MONO);

  File f = SD.open(fileName, FILE_READ);
  if (f == NULL) printf("err opening file\n");
  
  f.read((uint8_t*)c, 44);

  do
  {
    l = (int)f.read((uint8_t*)c, 44100);
    if (l < 0) printf("Error \n");
    for (int i = 0; i < l; i++)
    {
      s0 = (((int16_t)(c[i] & 0xFF)) - 128) << 8 ;
      s0 = s0 >> a;  
      s0 = s0 * VOLUME >> 6;
      s16[i % 64] = (uint16_t)s0;
      if (((i + 1) % 64) ==  0)
      {
        int n = 0;
        while (n == 0) n = i2s_write_bytes(I2SR, (const char*)s16, 128, portMAX_DELAY);
      }
    }
  } while (l > 0);
  
  // muting after playing
  for (int i = 0; i < 64; i++)s16[i] = 0;
  int n = 0;
  while (n == 0) n = i2s_write_bytes(I2SR, (const char*)s16, 128, portMAX_DELAY);
  i2s_zero_dma_buffer(I2SR);

  f.close();
  printf ("Stop\n");
}

#define SPI_MOSI 15
#define SPI_MISO 2
#define SPI_SCK 14

void setup()
{
  Serial.begin(115200);
  esp_err_t err;

  if (!SPIFFS.begin(true))Serial.println("SPIFFS failed \n");

  SPI.begin(SPI_SCK, SPI_MISO, SPI_MOSI);
  if (!SD.begin(SD_CS))
  {
    Serial.printf("SD initialization failed!\n");
  } else {
    Serial.printf("SD initialization successfully\n");
  }
  
  //Init buton
  gpio_reset_pin(VM);
  gpio_set_direction(VM, GPIO_MODE_INPUT);
  gpio_set_pull_mode(VM, GPIO_PULLDOWN_ONLY);

  // Amp power enable
  gpio_reset_pin(PW);
  gpio_set_direction(PW, GPIO_MODE_OUTPUT);
  gpio_set_level(PW, 1);

  gpio_reset_pin(GAIN);
  gpio_set_direction(GAIN, GPIO_MODE_OUTPUT);  
  gpio_set_pull_mode(GAIN, GPIO_PULLDOWN_ONLY);   // 15dB
  i2s_driver_install(I2SR, &i2s_configR, 0, NULL);
  i2s_set_pin(I2SR, &pin_configR);
  i2s_stop(I2SR);
}

void loop() {
  if (gpio_get_level(VM) == 0)
  {
    i2s_start(I2SR);
    //playAudio("/500hz44100Mono.wav"); 
    playAudio("/1/cherepaha-aha-aha-8bit-mono.wav");
    delay(100);
    i2s_stop(I2SR);
  }
}

My new Muse Proto board will not show up as a bluetooth device.

I followed the (1-Quick and dirty (no soldering)) instuctions on

downloaded the bin-file and the program.
Ran the program and added the bin-file and found the port
The progress took about 5 seconds to go from Idle to Sync, Download and then to Finish. (Not 3 minutes like the instruction indicated).

The command window that pops up shows this
Uploading stubā€¦
Running stubā€¦
Stub runningā€¦
FLASH_CRYPT_CNT 0
ABS_DONE_0 False

is stub and send flash finish

Iā€™m no progarmmer so is there an easy way to get tihs to work?

Hi Chris and welcome!
Seems that you forgot to tick the checkbox on the left of the path of the file to upload :sweat_smile:image

Silly me, I missed that one. So this time it took about 3 minutes to run the process but still no Bluetooth device MUSE_SEAKER shows up.

I will have to try myself next week.

But meanwhile may I recommend you to try Squeezelite it does Bluetooth too and much more such as multirooms

Use the new method 1 with a Chrome browser. Looking forward to have your feedback on how easy to use this method.

That worked! And so supereasy :slight_smile: It took me a while to find the IP-address to log in to the device, the description on the chrome browser installation mentioned how to log in on the temporary wi-fi created but didnā€™t mention the IP-adddress 192.168.4.1 to the user interface. But after that itā€™s been a breeze. Thank you.

COOL donā€™t hesitate to share your creation!