Help, VS1053 wont play this ogg vorbis

Writing software for systems that use VLSI Solution's devices as slave codecs to a host microcontroller.
Post Reply
torntrousers
User
Posts: 2
Joined: Fri 2016-02-19 17:01

Help, VS1053 wont play this ogg vorbis

Post by torntrousers »

Hi, I'm trying to use a VS1053b with an ESP8266 and have some code that works ok to play mp3's or wav's but it wont play the attached .ogg.

Should the vs1053 be able to play ogg vorbis format? Or should my code that works for wav and mp3 do something different for the ogg format?

This is what the start of the ogg stream looks like, or the complete ogg file (which just says "hello") is attached.
oggHeader.png
oggHeader.png (40.28 KiB) Viewed 12054 times
Thanks for any help or pointers!
Attachments
hello.ogg
(5.42 KiB) Downloaded 337 times
User avatar
Panu
VSDSP Expert
Posts: 2829
Joined: Tue 2010-06-22 13:43

Re: Help, VS1053 wont play this ogg vorbis

Post by Panu »

Hi!

VS1053 plays Ogg Vorbis. However, your file is not Ogg Vorbis, it is Ogg Opus. We don't have an Opus decoder, at least not yet.

Could you use Ogg Vorbis instead?

-Panu
torntrousers
User
Posts: 2
Joined: Fri 2016-02-19 17:01

Re: Help, VS1053 wont play this ogg vorbis

Post by torntrousers »

I see. Thanks for the answer. My choices are flac, wav and this ogg one (i don't have control of the source) , and as i'm trying to stream it I was hoping the ogg one would work. What are the chances of a Opus decoder any time soon?
User avatar
Henrik
VLSI Staff
Posts: 1294
Joined: Tue 2010-06-22 14:10

Re: Help, VS1053 wont play this ogg vorbis

Post by Henrik »

Hello!

An Opus decoder is certainly in our roadmap, but unfortunately we don't have a schedule for it yet.

Kind regards,
- Henrik
Good signatures never die. They just fade away.
dmitriy
User
Posts: 3
Joined: Tue 2017-10-31 20:05

Re: Help, VS1053 wont play this ogg vorbis

Post by dmitriy »

Hi, I can not play the .ogg file, while .mp3 is playing.
The HDAT1 register receives the value 20327 ('og').

the file is transmitted over TCP blocks 4000-4500 bytes.. in vs1053 data is transmit of 32 bytes, at DREQ

Where there can be a bug :( ?
Attachments
scr.png
scr.png (14.62 KiB) Viewed 11376 times
sample.ogg
(340.78 KiB) Downloaded 280 times
User avatar
pasi
VLSI Staff
Posts: 2122
Joined: Thu 2010-07-15 16:04

Re: Help, VS1053 wont play this ogg vorbis

Post by pasi »

Hi Dmitriy,

It seems your sample.ogg triggers a bug in the stream ID handling. (Vorbis: Ogg streams that have the highest bit set in stream serial number are not played.) You need the vs1053b patches package loaded to play it.

You can get the vs1053b patches package from: http://www.vlsi.fi/en/support/software/ ... tches.html
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
dmitriy
User
Posts: 3
Joined: Tue 2017-10-31 20:05

Re: Help, VS1053 wont play this ogg vorbis

Post by dmitriy »

Thanks for the answer! It turned out to reproduce the stream with the help of another encoder ogg.

Prompt yet such a moment, can the chip simultaneously reproduce and record the stream?

I understand without patches I can not do and will have to connect a memory card, as long as I deal with it, the existing card does not start yet.

host chip ESP32.
User avatar
pasi
VLSI Staff
Posts: 2122
Joined: Thu 2010-07-15 16:04

Re: Help, VS1053 wont play this ogg vorbis

Post by pasi »

You cannot encode and decode Ogg Vorbis at the same. (Not even with vs1163a/vs1063a.)
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
dmitriy
User
Posts: 3
Joined: Tue 2017-10-31 20:05

Re: Help, VS1053 wont play this ogg vorbis

Post by dmitriy »

The patch has loaded, ogg has been correctly playing.

now I understand with record, with the same patch (vs1053b-patches.plg). Data goes without a title, I can not understand what they are like.
maybe it's ADPCM?

Received data length
23225ms >> TX len: 128
23227ms >> TX len: 128
23244ms >> TX len: 128
23246ms >> TX len: 128
23247ms >> TX len: 128
23249ms >> TX len: 128
23266ms >> TX len: 128
23268ms >> TX len: 128
23270ms >> TX len: 128
23271ms >> TX len: 128
23289ms >> TX len: 128
23290ms >> TX len: 128
23292ms >> TX len: 128
23294ms >> TX len: 128

How to get an ogg? What am I doing wrong?

code:

Code: Select all

  vs1053player.write_register(VS1053_REG_MODE, VS1053_MODE_SM_RESET | VS1053_MODE_SM_ADPCM | VS1053_MODE_SM_SDINEW);

  vs1053player.write_register(VS1053_SCI_AICTRL0, 44100);

  while (! vs1053player.data_request() );
  
  /* Rec level: 1024 = 1. If 0, use AGC */
  vs1053player.write_register(VS1053_SCI_AICTRL1, 0);

  while (! vs1053player.data_request() );
  
  /* Maximum AGC level: 1024 = 1. Only used if SCI_AICTRL1 is set to 0. */
  vs1053player.write_register(VS1053_SCI_AICTRL2, 4096);

  while (! vs1053player.data_request() );
  
  /* Miscellaneous bits that also must be set before recording. */
  vs1053player.write_register(VS1053_SCI_AICTRL3, 0);

  while (! vs1053player.data_request() );

  LoadUserCode();    // Load plugin

  while (! vs1053player.data_request() );
  
  //vs1053player.write_register(VS1053_SCI_AIADDR, 0x34);
  //vs1053player.write_register(VS1053_SCI_AIADDR, 0x0300); 
  
 //  while (! vs1053player.data_request() );
Attachments
Снимок.PNG
Снимок.PNG (50.95 KiB) Viewed 11364 times
User avatar
pasi
VLSI Staff
Posts: 2122
Joined: Thu 2010-07-15 16:04

Re: Help, VS1053 wont play this ogg vorbis

Post by pasi »

VS1053b only has IMA ADPCM and PCM encoding in ROM. When working with vs1053b, you need to software reset and load the Ogg Vorbis encoder application.

(Yes, looks like IMA ADPCM.)
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
Post Reply