VS1010D Virtual Memory, AAC, WMA and OGG Decoders

Designing hardware and software for systems that use the VS1010 MP3 Audio DSP Microcontroller.
Arek
Senior User
Posts: 65
Joined: Thu 2016-09-01 10:58

Re: VS1010D Virtual Memory, AAC, WMA and OGG Decoders

Post by Arek » Fri 2019-02-01 15:10

Hi Panu,

it works!
For your files: I use MX25L1606E SPI memory.

Unfortunately, I can play only in terrminal mode.
Where can I find "vs1010dRom.h"?

Many thanks
AM

Arek
Senior User
Posts: 65
Joined: Thu 2016-09-01 10:58

Re: VS1010D Virtual Memory, AAC, WMA and OGG Decoders

Post by Arek » Mon 2019-02-04 15:42

Hallo,

first impressions.
In UART controlled mode works well with different bitrates.
Semi controlled (manual "bootx s:boot.x" and then start my dlx-programm) failed.
It looks, my programm take too much of MCU resources.

Following messages I get back:
OGG 64kbps C$SUM FAIL: 20000:V620=1
OGG 112kbps C$SUM FAIL: 20000:V620=1
OGG 500kbps C$SUM FAIL: 20000:V620=1

WMA 24kbps C$SUM FAIL: 30000:V6b5=1
WMA 96kbps C$SUM FAIL: 30000:V6b5=1
WMA 256kbps C$SUM FAIL: 30000:V6b5=1

AAC 6kbps C$SUM FAIL: 10000:V6b5=1
AAC 96kbps C$SUM FAIL: 10000:V6b5=1
AAC 320kbps C$SUM FAIL: 10000:V6b5=1

Any idea how can I find or check the MCU load?

Many thanks
am

User avatar
Panu
VLSI Staff
Posts: 2608
Joined: Tue 2010-06-22 13:43

Re: VS1010D Virtual Memory, AAC, WMA and OGG Decoders

Post by Panu » Mon 2019-02-04 16:39

Hi!
1) Great that you have got it working from the UART!
2) Yeah... it's a heap problem. I've identified it but need some time to come up with a fix.

I've identified the memory areas that can be used *during* playing files with the cache, but that's only the first step... maybe tomorrow :)

Code: Select all

	heap[0] = 0x4000; heapend[0] = 0x47ff; // Instruction memory
	heap[1] = 0x1880; heapend[1] = 0x1dff; // X Data memory
	heap[2] = 0x0450; heapend[2] = 0x05ff; // Y Data memory
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

User avatar
Panu
VLSI Staff
Posts: 2608
Joined: Tue 2010-06-22 13:43

Re: VS1010D Virtual Memory, AAC, WMA and OGG Decoders

Post by Panu » Tue 2019-02-05 11:00

Hi!

Here's a 2nd version of the page fault handler / cache environment program (boot.x). This one sets the heap more correctly than the last one and allows loading user programs that play files using the cache. Additionally, it tries to run the program USERCODE.DLX after loading, so if you have a custom player, you can rename the project as USERCODE and it will load automatically after the BOOTX S:BOOT.X phase.

This environment allows 1408 words of X data, 432 words of Y data and 2048 words of program memory for user applications. BETWEEN playing songs you could use the entire chip, but this environment only allows loading code and data to the safe areas.

Get the boot.x file from inside the zip file to try it out!

-Panu
Attachments
arch-VirtualLoadEEC1-2019-02-05-10-54-RunUserProgram.zip
Page Fault (Cache) handler for VS1010D, version 2
(35.56 KiB) Downloaded 3 times
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

Arek
Senior User
Posts: 65
Joined: Thu 2016-09-01 10:58

Re: VS1010D Virtual Memory, AAC, WMA and OGG Decoders

Post by Arek » Tue 2019-02-05 13:32

Hi Panu,

thank you very much for update.

Unfortunately my VS1010 write me others messages as awaiting.

With boot.x (from VirtualSD)
VS1010>bootx s:boot.x
bootx s:boot.x

Reset virtual memory
BootFromX(BOOT.X)
Loaded 746 bytes.
VLoad Ok.
S1010>
and the new one:
VS1010>bootx s:boot.x
bootx s:boot.x

Reset virtual memory
BootFromX(BOOT.X)
Loaded 814 bytes.
E'Out of buffers!'
E'Out of buffers'
VLoad Ok.
S1010>
Any hints?

User avatar
Panu
VLSI Staff
Posts: 2608
Joined: Tue 2010-06-22 13:43

Re: VS1010D Virtual Memory, AAC, WMA and OGG Decoders

Post by Panu » Tue 2019-02-05 14:05

Hmm, it looks like you're running your own code and, hmm, could it be that you really are out of buffers? There can only be one file open with the cache system running. Do you fclose all files that you open as soon as possible?

Is it similar if you don't name your program as usercode.dlx, and run it from the command line instead?

Oh, and hmm, I've only tried to play music from the SD card... let me check if there are problems with the SPI flash

-Panu

[Edit]
Ok, I get similar kinds of problems when I try with music in the SPI flash. Strange. Music from SD seems to work fine even with my own player. Might be memory corruption somewhere. I will investigate.

-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

Arek
Senior User
Posts: 65
Joined: Thu 2016-09-01 10:58

Re: VS1010D Virtual Memory, AAC, WMA and OGG Decoders

Post by Arek » Tue 2019-02-05 14:42

Hi,

thanks for quick answer.

Fist I've tried to start it from config. (usercode.dlx already in SPI):
C#0d1fcd
VS1010D VSOS 4.20
Files:6. Buffers:3.
Runlevel 7
SPIF:c214, 2048K

SD:120 MiB
SpiCacheDrv v7
S: SPI Flash c214

Runlevel 7 MyMP3 <- message from config

Reset virtual memory
BootFromX(BOOT.X)
Loaded 814 bytes.
E'Out of buffers!'

Then I start it UART controlled.
Get the same answer for both situations: with and without "usercode.dlx".

My audio placed in SD, program in SPI memory.

am

Arek
Senior User
Posts: 65
Joined: Thu 2016-09-01 10:58

Re: VS1010D Virtual Memory, AAC, WMA and OGG Decoders

Post by Arek » Tue 2019-02-05 15:34

One thing.
My program:
Total words: I 1407, X 317, Y 0

User avatar
Panu
VLSI Staff
Posts: 2608
Joined: Tue 2010-06-22 13:43

Re: VS1010D Virtual Memory, AAC, WMA and OGG Decoders

Post by Panu » Tue 2019-02-05 15:34

I think I have an idea of what might happening at your end. Here's the theory:

You are running the bootx s:boot.x step from config.txt. Now, config.txt file is open. Then the system is out of buffers when it tries to load the next program. This way I got somewhat similar error message. I fixed this in boot.x by adding code that forces the first vsos file to be closed and the first vsos buffer to be free. Now it works at least in my end.

Here's a dump of SPI flash content that I am using to test it. It contains config.txt that plays automatically using the cache, if runlevel is 15. First it does the bootx s:boot.x. Then it does the USERCODE step, and I included a simple test player that I am working on as a proof of concept. It plays all files from all subdirectories. With this contents, it first plays TheRobots as MP3, then as AAC. Then it repeats. Hit [ESC] on the UART to stop it.

The source code of the player code which I am using is included in the zip.

-Panu
C#0d1fcd
VS1010D VSOS 4.20
Files:6. Buffers:3.
Runlevel 15
SPIF:c217, 16384K
SD:922 MiB
SpiCacheDrv v7
S: SPI Flash c217
Reset virtual memory
BootFromX(BOOT.X)
Loaded 830 bytes.
PLAYALL player by Panu, early test version
S:TheRobotsM_192kbps.mp3
>TheRobotsM_192kbps.mp3 ok
S:TheRobotsA_192kbps.aac
>TheRobotsA_192kbps.aac
Attachments
arch-VirtualLoadEEC1-2019-02-05-15-21-v3.zip
Boot.x that clears first open file and buffer, thus making it possible to run bootx s:boot.x from config.txt.
(35.66 KiB) Downloaded 3 times
cacheplayspi2.zip
SPI flash contents of my test player setup
(1.46 MiB) Downloaded 5 times
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

Arek
Senior User
Posts: 65
Joined: Thu 2016-09-01 10:58

Re: VS1010D Virtual Memory, AAC, WMA and OGG Decoders

Post by Arek » Wed 2019-02-06 11:31

Hi Panu,

get it running but in UART mode only! ("config" has been changed to Runlevel 7)
C#0d1fcd
VS1010D VSOS 4.20
Files:6. Buffers:3.
Runlevel 7
SPIF:c214, 2048K

SD:120 MiB
SpiCacheDrv v7
S: SPI Flash c214
1L_gtr-nylon22.mp3 <- auto play from SD, I breake it and make manual start


VS1010>bootx s:boot.x
bootx s:boot.x

Reset virtual memory
BootFromX(BOOT.X)
Loaded 830 bytes.
PLAYALL player by Panu, early test version
S:TheRobotsA_192kbps.aac
>TheRobotsA_192kbps.aac
...

Post Reply