VS1205G, “Rec” program get stuck while recording

Discussion about writing software for VS1005 and the VSOS Operating System. Also posts about VS1005-related hardware design and device drivers should be posted here.
Post Reply
afu
User
Posts: 4
Joined: Tue 2017-09-12 4:32

VS1205G, “Rec” program get stuck while recording

Post by afu » Tue 2017-09-12 9:05

Dear engineer,
We trying to use VS1205G to record audio input and save it to the USB flash disk as a mp3 file. We find that the "Rec" program usually get stcuk for a few seconds while recording, meanwhile the data get lost, shell print some messages like "VID_1908 PID_1320 Generic Mass storage.
Has anyone ever tested record audio to a USB flash disk ?

Here are some details:

Hareware: vs1005 breakout board v1.1
VSOS kernel: VSOS 3.42 build May 18 2017 13:32:02
SYS: small_root in VSOS_342_RootAndLibrariesSourceCode package.

We test it using the SHELL:
1. power up breakout board
2. plug in the USB flash disk(8Gb, fat32)
3. load the usb driver:

S:>USBHOST D

VID_1908 PID_1320 Generic Mass storage
2 drive(s).
D: USB Flash

4.start record:

D:>Rec -fm -cs -r48000 1.mp3
Recording 48000 Hz stereo at quality 7
~050a'1.mp3

VID_1908 PID_1320 Generic Mass storage

VID_1908 PID_1320 Generic Mass storage

VID_1908 PID_1320 Generic Mass storage

VID_1908 PID_1320 Generic Mass storage

VID_1908 PID_1320 Generic Mass storage

VID_1908 PID_1320 Generic Mass storage

VID_1908 PID_1320 Generic Mass storage

VID_1908 PID_1320 Generic Mass storage

VID_1908 PID_1320 Generic Mass storage

VID_1908 PID_1320 Generic Mass storage
Output buffer size 34816 bytes
~030a=1
~030a=2

VID_1908 PID_1320 Generic Mass storage

VID_1908 PID_1320 Generic Mass storage

VID_1908 PID_1320 Generic Mass storage

VID_1908 PID_1320 Generic Mass storage

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

Re: VS1205G, “Rec” program get stuck while recording

Post by Panu » Tue 2017-09-12 10:36

Hi!

The "VID_1908 PID_1320 Generic Mass storage" message is printed when the USB mass storage driver initializes. You should see this message only once during initialization. If you see it more than once, it's an error.

It means that there is a problem with the USB flash device and the OS is doing its best to recover and reinitialize the USB flash device. It's often an electrical problem: how do you feed the 5 volts power to the USB flash? Please measure that the 5 volt voltage is stable.

One curious printout can be found:
2 drive(s).
Usually there is only 1 drive (LUN) in the USB flash. Do you know why it has two LUNs? How does it show in Windows or Linux?
How many flashes have you tested it with? Does it work reliably with other flashes?
Has anyone ever tested record audio to a USB flash disk ?
Yes, but I'd avoid it if possible, because USB flashes have wildly different performance figures, some have long delays and some use a lot of power. And writing to the flash is dangerous - if there's a power failure during the write, the user can loose a lot of valuable data if the flash corrupts. In your product, make sure that there's a lot of power always available to the flash.

To help with USB flash delays during recording, Henrik has written a driver called FILEBUF.DL3 to help with recording to the flash. It can provide buffering for at least a few hundred milliseconds while the OS is waiting for the flash to finish writing each block.

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

afu
User
Posts: 4
Joined: Tue 2017-09-12 4:32

Re: VS1205G, “Rec” program get stuck while recording

Post by afu » Tue 2017-09-12 11:15

Hi,
Thanks a lot for your reply.

1. We supply the breakout board with a 5V power from another DSP board, we will check the power first.

2. "2 drive(s)" is because the USB flash disk have two partitions, it shows two disks in Windows.

3. We will try the FILEBUF.DL3 driver later.

afu
User
Posts: 4
Joined: Tue 2017-09-12 4:32

Re: VS1205G, “Rec” program get stuck while recording

Post by afu » Wed 2017-09-13 3:23

Hi!
It's often an electrical problem: how do you feed the 5 volts power to the USB flash? Please measure that the 5 volt voltage is stable.
We used a 5V-4.5A adapter as the Breakout board's power yesterday, the problem still exists.
To help with USB flash delays during recording, Henrik has written a driver called FILEBUF.DL3 to help with recording to the flash.
The dirver FILEBUF.DL3 has already been used in "Rec", we can find the relevant code in "Rec" solution.

We found another weird thing:
When use ADC/DAC for input/output, the record is OK(we tested 90 minutes yesterday). The problem arises when we use I2s slave mode. We need to use vs1205 chip as an I2s slave(48KHz sample rate) in our project .Can you give us more advice?

Thanks!

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

Re: VS1205G, “Rec” program get stuck while recording

Post by Panu » Mon 2017-09-18 16:13

Hi!
The problem arises when we use I2s slave mode.
Ok, that is very useful information! There must be some negative interaction with the interrupt handlers. Please send us your CONFIG.TXT contents and the commands that you use to run the encoder, as well as the complete serial port output of VS1005, starting from reset until the end of recording, so we can try to recreate the situation.

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

afu
User
Posts: 4
Joined: Tue 2017-09-12 4:32

Re: VS1205G, “Rec” program get stuck while recording

Post by afu » Tue 2017-09-19 6:36

Hi,

The record command: "Rec -fm -cs -r48 1.mp3".

CONFIG.TXT and serial port output file please see the attachments.
Attachments
config.txt
(1.83 KiB) Not downloaded yet
Serial10_2017-09-18_09-13-03.log
(3.76 KiB) Not downloaded yet

Post Reply

Who is online

Users browsing this forum: No registered users