VS1005 Ogg Vorbis encoder bandwidth

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

VS1005 Ogg Vorbis encoder bandwidth

Post by Henrik » Wed 2018-02-07 13:12

Hello!

I moved a question here from another thread...
I've recently upgrade the VSOS kernel to v3.53 and have found a relevant change in the way that maximum quality ogg vorbis (10 out ot 10) recorded at 48kHz are now stored: now I get a compressed file where an internal 20 KHz cutoff frequency seems to be applied to the recording; the same code gave me up to 24kHz signals (no internal cutoff frequency, antialiasing or whatever you called it) with previous VSOS versions.

Is there any new directive in the libencvorb dll to disable that internal filtering, or is there anyway to recover that feature?
This is somewhat surprising. I have recently recompiled all encoders, but I haven't intentionally made such a change. Also, looking at the source code, the 48 kHz quality 10 profile should not contain any filtering for frequencies below 24 kHz. Curious.

If I may ask, and if it's not too much trouble for you, may I ask for 4 files from you:
  1. An older version of the encvorb.dl3 with which you still get the full 24 kHz bandwidth.
  2. A newer version of encvorb.dl3 with limited bandwidth. (I'm pretty sure I know which file you mean, but just to make it absolutely sure we're on the same page.)
  3. A short recording with the old encoder - even one second is enough if it shows the full bandwidth.
  4. A similar short recording with the new encoder - preferably of similar material.
And, just out of interest: is there a particular reason you want or need to store frequencies outside of normal hearing range to the files?

Kind regards,
- Henrik
Good signatures never die. They just fade away.

User avatar
Henrik
VLSI Staff
Posts: 1110
Joined: Tue 2010-06-22 14:10

Re: VS1005 Ogg Vorbis endoer bandwidth

Post by Henrik » Wed 2018-02-07 13:27

Hello again!

Ah, you can ignore my previous post and requests. I've found the issue.

It appears that the previous version of the encoder had its own quality tables included in RAM memory, but this new version optimizes size by taking its quality tables from ROM memory. Unfortunately the ROM tables have the 20 kHz limition that bothers you.

Could you try the version attached to this message and see if it restores the operation you want? If it does, I'll make it the official version from now on.

Kind regards,
- Henrik
Attachments
encvorb.zip
Test release of a Vorbis encoder with restored bandwidth at 48 KHz quality 10.
(18.8 KiB) Downloaded 37 times
Good signatures never die. They just fade away.

cruedag
User
Posts: 11
Joined: Mon 2017-03-20 13:58

Re: VS1005 Ogg Vorbis endoer bandwidth

Post by cruedag » Wed 2018-02-07 20:34

Hi!

Well, it sounds very sensible. I've just tried the new dll and now get this failure:

IMEM: only 3306w free!
IMEM: only 3302w free!
E: Symbol _evBands08k_64 (CRC32 6b615478) not found.
E: Symbol _evBands08k_256 (CRC32 fd752614) not found.
E: Symbol _evMean08k_64 (CRC32 751deb04) not found.
E: Symbol _evMean08k_256 (CRC32 f155216e) not found.
E: Symbol _evBands16k_128 (CRC32 38ba212c) not found.
E: Symbol _evBands16k_512 (CRC32 62b91a35) not found.
E: Symbol _evMean16k_128 (CRC32 349a2656) not found.
E: Symbol _evMean16k_512 (CRC32 6e991d4f) not found.
E: Symbol _evBands32k_128 (CRC32 cab4c4ee) not found.
E: Symbol _evBands32k_tDq (CRC32 38080512) not found.
E: Symbol _evMean32k_128 (CRC32 c694c394) not found.
E: Symbol _evMean32k_1024 (CRC32 3df2d634) not found.
E: Symbol _evBands44k_128 (CRC32 7821ee3e) not found.
E: Symbol _evBands44k_1fa (CRC32 364c63c0) not found.
E: Symbol _evMean44k_128 (CRC32 7401e944) not found.
E: Symbol _evMean44k_1024 (CRC32 1c64b024) not found.
E: Symbol _evBands48k_256 (CRC32 c4e99be7) not found.
E: Symbol _evBands48k_PDv (CRC32 1d4d031b) not found.
E: Symbol _evMean48k_256 (CRC32 c8c99c9d) not found.
E: Symbol _evMean48k_1024 (CRC32 56c17631) not found.
20 fatal errors. Stop.
Terminal stopped.

I run it under VSOS 3.53.

I also attach you an spectrum view of a sample recorded with the encoder included in VSOS 3.53. You can see the codec sampling at 48Khz but having no signal at all above 20kHz; with your previous encoder you got plenty of signal up to Nyquist frequency. By the way, the same ocurred with all of my former tests encoding in mp3 with your Breakout board, but never faced it with your vorbis encoder.
And, just out of interest: is there a particular reason you want or need to store frequencies outside of normal hearing range to the files?
Well, I could say you some idiot history about any audiophile extra perception or so, hahaha, but that's not the case: my project doesn't record audible signals but ultrasonic ones, getting very good quality recording from your VS1005g in the 16-24kHz band.

PS: I also add an spectrum view recorded with the previous dll and also that dll, included with VSOS 3.40 package.

If you need some audio files I will prepare two of them with similar content to you tomorrow.

Thanks
Attachments
encvorb.dl3
(64.67 KiB) Downloaded 32 times
ogg spectrum old codec.png
ogg spectrum old codec.png (1.4 MiB) Viewed 919 times
ogg spectrum.png
ogg spectrum.png (1.29 MiB) Viewed 921 times

User avatar
Henrik
VLSI Staff
Posts: 1110
Joined: Tue 2010-06-22 14:10

Re: VS1005 Ogg Vorbis encoder bandwidth

Post by Henrik » Wed 2018-02-07 22:49

Hello!

No need to send the .ogg files anymore now that I know the reason for the issue.

I am not at work at the moment, and I don't understand why you are having the issues that you have. The new encoder should work under VSOS 3.53 - I tested it using 3.54 pre-release myself, and there shouldnt be any significant differences. This thing should happen with VSOS 3.45 or older, but not with 3.53. I'm really scratching my head here. But let me get back to you tomorrow.

One thing that might help me if you copy your console output right from the first "Hello" message up to the point where you run into the error.

Kind regards,
- Henrik
Good signatures never die. They just fade away.

User avatar
Henrik
VLSI Staff
Posts: 1110
Joined: Tue 2010-06-22 14:10

Re: VS1005 Ogg Vorbis encoder bandwidth

Post by Henrik » Thu 2018-02-08 11:34

All right,

I have now been able to both reproduce and solve your issue. You need to update to VSOS 3.54 that I have just released in its own thread here:
viewtopic.php?f=13&p=11760#p11760

After the update the new Ogg Vorbis encoder should not be complaining about missing symbols anymore. And it should give the full ultrasonic sound experience. :-)
Well, I could say you some idiot history about any audiophile extra perception or so, hahaha, but that's not the case: my project doesn't record audible signals but ultrasonic ones, getting very good quality recording from your VS1005g in the 16-24kHz band.
This is quite interesting. And this leads to a question: are you interested in only the 16-24 kHz band, or do you also need the information for 0-16 kHz? The reason I'm asking is that if you are only interested in 16-24 kHz, then there might be some tricks we could make to either make files smaller or, alternatevely, signal fidelity better.

Kind regards,
- Henrik
Good signatures never die. They just fade away.

cruedag
User
Posts: 11
Joined: Mon 2017-03-20 13:58

Re: VS1005 Ogg Vorbis encoder bandwidth

Post by cruedag » Thu 2018-02-08 13:05

Thanks a lot for your prompt response.

I've downloaded the new kernel but suspect that there is some issue with the version linked in your message because after upgrading the new kernel it still continues identifying itself like "3.53":

Code: Select all

Hello.
VSOS 3.53 build Feb 08 2018 11:39:19
VLSI Solution Oy 2012-2018 - www.vlsi.fi
I've tried upgrading your *.img directly or even building it again with the same result.

Trying our software with the encvorb.dl3 included in your package "3.54" lead to a similar result (20kHz limit) because it seems to be the same dl3. Using the new dl3 that you provided me leads to a new situation with no signal at all. I attach the ogg and the spectrum view.

It's not a HW or audio driver issue, using the previous encvorb.dl3 I get a good recording, but bandwith limited to 20kHz. The only modification made by us to your drivers is a modification to "sdpower" to make it use custom I/O lines to power/unpower SD card. You can also see a failure with the RTC power supply line, I expect that it doesn't produce any issue with encvorb.dl3.

Code: Select all

Hello.
VSOS 3.53 build Feb 08 2018 11:39:19
VLSI Solution Oy 2012-2018 - www.vlsi.fi

Starting the kernel..
Starting Devices... 
Internal Flash

Installed system devices:
S: SPI Flash c213, handled by FAT.
Load drivers, config 0...
Driver: sdpower... 
Driver: SDSDMONO... E: SD/SD Card

Driver: AUODAC... 
Driver: AUIADC...   Input 0x2200  Rate 48000
Driver: RUN... YBITCLR FC00,DFC00,D Y:0xfc00: 0xa000-13 -> 0x8000 
Driver: RUN... YBITCLR FC00,CFC00,C Y:0xfc00: 0x8000-12 -> 0x8000 
Driver: UARTIN... 
Driver: run... s:graba_tono.ap3

PESYR ogg+wav Encoder esfpeq02
2018 PESYR I+D

Apagando reguladores innecesarios:
Fichero config.ini ABIERTO
Fichero config.ini CERRADO

E: RTC not found. Check RTC battery!

Opening E:encendido.mp3...
Starting the decoder...
Decoding audio...
Decoder returns 0, "ok"
Clean-up.


File: E:ogg_024.OGG
IMEM: only 3050w free!
IMEM: only 3046w free!
Recording 48000 Hz mono at quality 10
IMEM: only 2836w free!
Prepare encoder
Find buffersize
Output buffer size is 10240 bytes
 0:09s, 139.0 kbit/s -90 dB               
 0:10s, 139.0 kbit/s -90 dB               
 0:11s,  10.7 kbit/s -90 dB              
 0:12s,   8.5 kbit/s -90 dB             
 0:13s,   8.0 kbit/s -90 dB           
 0:14s,   6.2 kbit/s -90 dB            
 0:15s,   6.1 kbit/s -90 dB            
 0:16s,   6.0 kbit/s -90 dB              
 0:17s,   6.0 kbit/s -90 dB           
 0:18s,   5.3 kbit/s -90 dB        
 0:19s,   5.4 kbit/s -90 dB             

POWERB

Cerrando Fichero.Close ogg
IMEM: only 2594w free!

Clean-up.
Equipo Apagado.
Thanks a lot, Henrik.
Attachments
empty ogg spectrum.png
empty ogg spectrum.png (23.76 KiB) Viewed 898 times
OGG_024.OGG
(7.44 KiB) Downloaded 33 times

cruedag
User
Posts: 11
Joined: Mon 2017-03-20 13:58

Re: VS1005 Ogg Vorbis encoder bandwidth

Post by cruedag » Thu 2018-02-08 13:26

Now I have tried recompiling the encvorb.dl3 from the VSOS 3.54 "solutions" folder, and now it records again but with the 20kHz limit.

Do you prefer that I contact you via email with until it gets solved and then we publish it?

User avatar
Henrik
VLSI Staff
Posts: 1110
Joined: Tue 2010-06-22 14:10

Re: VS1005 Ogg Vorbis encoder bandwidth

Post by Henrik » Fri 2018-02-09 13:26

cruedag wrote:
Thu 2018-02-08 13:26
Now I have tried recompiling the encvorb.dl3 from the VSOS 3.54 "solutions" folder, and now it records again but with the 20kHz limit.
That would happen, because if you want to compile a version that uses the right ROM/RAM combination, you need to modify some VSIDE system .h files. But, then again, we'd run into your other issue (to which I shall return next).
Do you prefer that I contact you via email with until it gets solved and then we publish it?
I'm happy keep the discussion here. Perhaps it'll be helpful to someone else, too.

Kind regards,
- Henrik
Good signatures never die. They just fade away.

User avatar
Henrik
VLSI Staff
Posts: 1110
Joined: Tue 2010-06-22 14:10

Re: VS1005 Ogg Vorbis encoder bandwidth

Post by Henrik » Fri 2018-02-09 13:36

Hello!
cruedag wrote:
Thu 2018-02-08 13:05
I've downloaded the new kernel but suspect that there is some issue with the version linked in your message because after upgrading the new kernel it still continues identifying itself like "3.53":
That's right. Shame on me: I forgot to change the version number in kernel_abs.s from 353 to 354. Rest assured, though, that if you can run the new Vorbis encoder without error messages, you are actually running 3.54.

The fact you are only getting silence from the encoder is another matter entirely. I'll have to look deeper into that, and unfortunately I don't expect to get it working today. But, I'll try to figure the issue out by Monday.

Kind regards,
- Henrik
Good signatures never die. They just fade away.

User avatar
Henrik
VLSI Staff
Posts: 1110
Joined: Tue 2010-06-22 14:10

Re: VS1005 Ogg Vorbis encoder bandwidth

Post by Henrik » Mon 2018-02-12 9:20

Henrik wrote:
Fri 2018-02-09 13:36
The fact you are only getting silence from the encoder is another matter entirely. I'll have to look deeper into that, and unfortunately I don't expect to get it working today. But, I'll try to figure the issue out by Monday.
Ok, it's Monday now, and I have found and - I think - corrected the error. Could you please try the version of encvorb.dl3 attached to this message? It should both work and have the full 24 kHz bandwidth when used at quality 10.

If you find it working, it will made be part of the next official VSOS release.

Kind regards,
- Henrik
Attachments
encvorb.zip
Yet another version of the Ogg Vorbis encoder.
(18.1 KiB) Downloaded 38 times
Good signatures never die. They just fade away.

Post Reply