Can a file be played other than from it's beginning (addressed start/stop)

Writing software for systems that use VLSI Solution's devices as slave codecs to a host microcontroller.
Post Reply
BooLeon
User
Posts: 4
Joined: Fri 2022-02-11 18:36

Can a file be played other than from it's beginning (addressed start/stop)

Post by BooLeon »

Hello,
I would like to record a musical performance and quickly isolate a tricky part to be replayed multiple times. A desirable scenario would be to replay the recorded file from the start, push a button to mark the start of the section of interest and then push another button (or maybe the same) to mark the end. This section could then be played (started) manually for discussion or repeatedly as a loop.
I have reviewed a few MP3 player modules with various processors but find they all require a file to be played from it's beginning.
Is there a VLSI product that will allow addressed or possibly counter register starts and stops even if the file has to be transferred to some other type of memory?
User avatar
pasi
VLSI Staff
Posts: 2019
Joined: Thu 2010-07-15 16:04

Re: Can a file be played other than from it's beginning (addressed start/stop)

Post by pasi »

Can the playback and recording be in different devices? Are you only looking at the playback device? Are you only interested in one unit, or is this intended to become a product?

How accurate would the repeat need to be?

The mp3 decoder in e.g. vs1005 supports "go-to" option in 1 second resolution, you "just" need a player routine to tell it to do that. A callback function gets control during decoding, so it could monitor the decode position for this kind of A-B repeat.

The VS1000 Audio Module could be programmed to do the same with Ogg Vorbis format, but there's not that much software development documentation available (unless we help). There's no recording possible with vs1000 Audio Module.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
BooLeon
User
Posts: 4
Joined: Fri 2022-02-11 18:36

Re: Can a file be played other than from it's beginning (addressed start/stop)

Post by BooLeon »

This will be a product utilizing an ATmega328PB, separate recording and playback devices would be acceptable if cost and additional hardware is kept to a minimum. A single record/playback solution that supports WAV format would be preferred however.

One second accuracy on starts and stops is OK as long as there's minimum roll-off out to 20k. Does a VS1053 have the "go-to" option with 1 second resolution and if so, how would it differ from the VS1005 in this application?
Thank you for your response.
User avatar
pasi
VLSI Staff
Posts: 2019
Joined: Thu 2010-07-15 16:04

Re: Can a file be played other than from it's beginning (addressed start/stop)

Post by pasi »

What's the storage, and would it be handled by the ATmega328PB?

vs1053 is a slave decoder (unless you run an app such as the standalone player on it), so your controller would be responsible for the A-B repeat by remembering file positions. With higher samplerates the loop accuracy would be much better than 1 second. (Indicating the position in seconds might be a little harder though.) Looping a WAV would be trivial and make sample-exact A-B loop possible. Encoding is possible with the same chip.

vs1063 would be a little more convenient, because its encoding mode outputs also the WAV header and has a lot of different encoding formats for WAV and mp3 and Ogg Vorbis. If you don't use mp3, then other variants of the "63" could also be used.

With these slave decoders you only need to develop code for your own controller. You may need to upload small patches, depending on the features you want to use.

vs1005 is a system chip. The storage would connect directly, and communication with your controller would probably be UART. The vs1005 would need to run a small application that gives your controller the required features.

What's "minimum roll-off out to 20k"?
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
BooLeon
User
Posts: 4
Joined: Fri 2022-02-11 18:36

Re: Can a file be played other than from it's beginning (addressed start/stop)

Post by BooLeon »

CD quality stereo recording of up to 5 minutes is our goal with starts and stops other than at file beginning and ending as described earlier. A control signal of 19.2KHz will be mixed with one of the channels which is where my comment of "minimum roll-off out to 20k" (20KHz) came from. "Looping a WAV would be trivial and make sample-exact A-B loop possible." If this is true, which of your VS1053 development board/starter kits that could be controlled from an ATmega328PB would you recommend? Also, what type of memory would you suggest when the VS1053 is no longer part of the development board?
Hannu
Senior User
Posts: 409
Joined: Mon 2016-05-30 11:54
Location: Finland
Contact:

Re: Can a file be played other than from it's beginning (addressed start/stop)

Post by Hannu »

Just one small thing. ATMega328P can run 16 MHz at 4.5 to 5V but datasheet chapter 28.4 graph for rating the max speed. And the 5V is too high for any VSxxxx absolute maximum for IOVDD is usually 3.6V.

ATMega328P datasheet chapter: 28.4 If I did my calculation correctly the slope is 8 MHz / 1.8 V and for 3.3V it would be 2.7 + 0.6 V and that would give 2.666 MHz resulting 10 MHz

For math exercise:
48k * 16b * 2 = 1.536 Mb/s data speed. That's straight minimum frequency of data transfer. If the data is read through SCI, multiply by 2 or 3.
48k * 2B * 2 = 192kB/s And now 10 MHz clock 52 cycles/byte.

And with that calculation, I would say that the poor MCU is very busy if it handles also the storage media.

Also where is the 19.2kHz signal generated With AVR or some analog way or how? And is it software sine gen or high passed UART or something other interseting?

Pasi has better answers about VS10xx boards and software.
BooLeon
User
Posts: 4
Joined: Fri 2022-02-11 18:36

Re: Can a file be played other than from it's beginning (addressed start/stop)

Post by BooLeon »

Since we have a supply of ATmega328PB, we were hoping to use it. Even though the "PB" is a bit faster than the "P" (~12MHZ @ 3.3V datasheet chapter 33.4 graph), we may need to consider other options after reviewing Hannu's calculations.

The 19.2KHz sine signal will be mixed with audio of less than 14KHz bandwidth. It will be hardware generated, encoded (switched), and recovered via a notch filter.

As requested earlier. we are hoping Pasi can suggest a VS1053 development board/starter kit.
User avatar
pasi
VLSI Staff
Posts: 2019
Joined: Thu 2010-07-15 16:04

Re: Can a file be played other than from it's beginning (addressed start/stop)

Post by pasi »

The vs10xx prototyping board is probably the simplest and easiest to interface with your own processor. The prototyping board can be jumpered to be slave instead of standalone, and then wired to your own processor board (for SCI/SDI command/data SPI connections and e.g. reset).

https://www.vlsi.fi/en/support/evaluati ... board.html
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
Post Reply