Regarding the problem of playing the same song over and over again when playing the playlist of SPRESENSE,

Asked 1 years ago, Updated 1 years ago, 292 views

Currently, I am trying to play the playlist in the PresenseArduino tutorial on the following site on the Presense.
https://developer.sony.com/develop/spresense/docs/arduino_tutorials_ja.html
After following the procedure and displaying the list, the first song will be displayed between each song as shown in the image below.The first song always plays in between even when it actually works.
List songs on the Spresense serial monitor

This symptom occurred in version 2.5.0 or later of the Presence Reference Board and was verified to work properly in 2.4.0.How do I get to work properly with version 2.5.0 and later?

sense

2022-12-04 23:59

1 Answers

After analyzing the difference between SDKv2.4 and SDKv2.5,
The size and contents of the internally auto-generated alias_list_alltrack.bin file are different and
This seems to be the reason why the playlist is not displayed correctly.

Recreate this file on your sketch to avoid this problem.

static void update_alias_file(const char*dirname)
{
  char fname [64];
  File file;
  uint32_t size;
  uint32_t*buffer;
  uint32_ti;

  sprintf(fname, "%s/alias_list_alltrack.bin", dirname);

  /* Read alias file into buffer*/
  file=File(fname,FILE_READ);
  size = file.size();
  buffer=(uint32_t*)malloc(size);
  file.read(buffer,size);
  file.close();

  /* Create the correct alias file*/
  if(buffer[1]==0x0){
    unlink(fname);
    file=File(fname,FILE_WRITE);
    for(i=0;i<size/4;i+=2){
      file.write(uint8_t*)&buffer[i], 4);
    }
    file.close();
  }
  free(buffer);
  thePlaylist.select(Playlist::ListTypeAllTrack, "");
}
success=thePlaylist.init(playlist_dirname);
  if(!success){
    printf("ERROR: no exist playlist file%s/TRACK_DB.CSV\n",
           playlist_dirname);
    while(1);
  }

  update_alias_file(playlist_dirname); // ★★★ Add


2022-12-05 04:09

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.