Opus support for VS1005 / VSOS

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
User avatar
Henrik
VLSI Staff
Posts: 1230
Joined: Tue 2010-06-22 14:10

Opus support for VS1005 / VSOS

Post by Henrik »

Dear Forum Members,

it is with great pleasure and pride that I present you our latest addition for the VS1005 / VSOS audio codec family: an Opus speech encoder / decoder. Our new encoder can encode speech at data rates as staggeringly low as 8 kbit/s! To hear what kind of quality to expect, check out the samples attached to this message.

The package contains a README.TXT file that I have included below:

Code: Select all

	Opus Encoder / Decoder v1.00
	----------------------------
	  for VSOS 3.63 or higher
	 2021-09-30  VLSI Solution

This package contains an Opus Encoder / Decoder for VS1005 running VSOS.

To test and use the encoder and decoder:
1) Copy the files in the SYS/ directory to your VS1005 Developer Board's
   SYS/ directory.
2) Copy example Opus RAW .OPR files from the Opus/ directory to the main
   directory of an SD card.
3) See the provided config.txt file, and use portions of it as appropriate
   in your S:CONFIG.TXT.
3.1) Note the "dec6" option on the AUIADC / AuInput command lines. The option
     allows for 8 and 16 kHz sample rates, required by the Opus Encoder and
     otherwise unavailable.

To test playback of an opus file, try either command:

S:>AuInfo d:16KQ10.OPU
d:16KQ10.OPU:
     size: 34.6 KiB
   format: Raw Opus
     conf: 1 channels at 16000 Hz
     time: 0:04.8 seconds
  bitrate: 58.6 kbit/s
  analyze: 0.01 seconds
S:>PlayFile d:16KQ10.OPU
Playing '16KQ10.OPU'
[00:04]Decode finished.

... or ...

S:>D:
D: SD/SD Card
D:>PlayDir
~0205'34
~0308=1
~0205=1
~050b'08KQ00.OPR
~030a=0
~030b=2
~030a=1
~030b=22
[... etc ...]


To record, do the following. Note that The VS1005 Opus Library is intended
as a speech codec: it can only record in mono, and only at 8 or 16 kHz.

S:>rec -h
Usage: Rec [-fm|-fo|-ff|-cs|-cm|-cl|-cr|-q{x}|-b{x}|-r{x}|-f|+f|-h] outFile
-fm|-fv|-fo|-ff	Format MP3|Ogg Vorbis|Opus|FLAC (alternative: file suffix)
-cs|-cm|-cl|-cr	Stereo|Mono|Left|Right
-qx	Set quality to x (0-10, higher is better)
-bx	Set bitrate to x kbit/s (1-511)
-rx	Set sample rate to x Hz, or x kHz if x<1000
-f/+f	Use / Don't Use FILEBUF library for audio data buffering
-h	Show this help
outFile	The output file name (e.g. D:REC.MP3|.OGG|.OPR|.FLA)
~010b=1
S:>Rec -cr -q5 -r8 d:08kq05.opr
Recording Opus: 8000 Hz mono at quality 5
~050a'd:08kq05.opr
~030a=1
~030a=2
~030a=3
~030a=4
[... when ready, push 'q' to end recording ...]
~010b=1
S:>


The format created by the Opus Encoder is VLSI Proprietary Opus Raw,
which is suitable for streaming. The format is very simple: there is
no file header, and each raw frame consists of the following bytes:

n    - 1 byte telling how many bytes there are going to be in the Opus frame.
data - n bytes of data.

A converter running on a Microsoft Windows PC that can convert from
VLSI Opus Raw to standard Ogg Opus is provided by VLSI Solution. The
converter is used as follows:

C:\>oggopus 08kq05.opr 08kq05.opus

where 08kq05.opr is the VLSI Opus Raw file to read, and 08kq05.opus is
the Ogg Opus file to write. The Ogg Opus file can be opened with any
standard software that can read the format, like the open source audio
tool Audacity.


Future expansion
----------------

This is the first pre-release of the Opus RAW encoder / decoder.
In time, the package will be expanded with:

1) Opus RAW codec that can do full-duplex encoding / decoding in real time.
   This can be used for low-latency low-bitrate communications.

2) Ogg Opus decoder that can decode everything Opus in mono/stereo up to
   48 kHz.
The package contains example audio files in the VLSI Proprietary Opus Raw format. To make it easier to have an idea of what kind of a sound quality you get at each setting, I have attached to this message a couple of the example files converted to standard .WAV format.

I hope you find this new package useful!

Kind regards,
- Henrik
Attachments
OpusV100.zip
Opus encoder / decoder package for VS1005. See README.TXT inside package for details.
(350.93 KiB) Downloaded 13 times
08KQ00.wav
Opus example: 8 kHz, 7.8 kbit/s, converted to WAV.
(411.93 KiB) Downloaded 14 times
08KQ05.wav
Opus example: 8 kHz, 14.3 kbit/s, converted to WAV.
(383.81 KiB) Downloaded 11 times
08KQ10.wav
Opus example: 8 kHz, 26.7 kbit/s, converted to WAV.
(408.18 KiB) Downloaded 12 times
16KQ00.wav
Opus example: 16 kHz, 14.6 kbit/s, converted to WAV.
(426.93 KiB) Downloaded 11 times
16KQ05.wav
Opus example: 16 kHz, 26.4 kbit/s, converted to WAV.
(395.06 KiB) Downloaded 12 times
16KQ10.wav
Opus example: 16 kHz, 49.1 kbit/s, converted to WAV.
(413.81 KiB) Downloaded 12 times
oggopus.zip
Windows converter that converts VLSI Raw Opus to standard Ogg Opus. Tested and working under Linux / Wine.
(104.91 KiB) Downloaded 14 times
Good signatures never die. They just fade away.
Post Reply