Hi!
I have a problem to decode IR then Music Shield play music. If music stopped, then decode work OK.
I found that if I send data to vs1053 chip from static buffer, then decode work OK, but if I get data from SD card, then decode don't work.
I found then music play In DEBUG mode - pressing same button on IR remote getting different results.
I testing any settings for timer1 (using music shield code) and timer2 (using IR code) - nothing good.
I testing lot a music and IR library - same result.
SR(TIMER1_OVF_vect) //Timer1 Service
{
//fill vs1053
while (digitalRead(VS_DREQ) == 1 && playingState == PS_PLAY && cur_file.isOpen() && !fastforward)
{
byte readLen = 0;
readLen = cur_file.read(readBuf, READ_BUF_LEN);
//READ_BUF_LEN=32 - I change this settings from 2 to 128. If set it to 2 , then IR decode almost OK, but music played bad.
vs1053.writeData(readBuf, readLen);
if (readLen < READ_BUF_LEN)
{
vs1053.writeRegister(SPI_MODE, 0, SM_OUTOFWAV);
vs1053.sendZerosToVS10xx();
playingState = PS_POST_PLAY;
break;
}
}
//update
if (++timerloop >= 20)
{
player._hardtime_update();
timerloop = 0;
}
}
I have no idea how reading from SD card affect to IR decode.
...sorry for my english