Hello!
I have read your message thread, and have a comment of my own.
The Ogg Vorbis decoder in VS1063 is exactly that: it requires for the Vorbis data to be Ogg capsulated. So, to get proper playback, what you would need to do is what you actually suggest yourself:
lucap87 wrote: ↑Tue 2019-03-19 9:33
As an alternative, I was considering to reconstruct in my microcontroller the Ogg encapsulation, do you think may be a good idea?
This would make the file playable by VS1063, so I definitely think it would be a good idea.
I don't know how easy or hard it is to recreate proper Ogg encapsulation. Perhaps the most tricky part that comes to my mind is if you have the 64-bit sample counter information in RTP (I don't know what RTP does or does not contain) that must be consistent between Ogg frames for the decoder to work properly. If that information is not available, it must be calculated by yourself from header information (there are two audio block lengths in each Ogg Vorbis file, typically but not necessarily 256 and 2048 samples), then go through each Vorbis audio block and calculating how many samples is generated by each one. If block lengths are 256 and 2048 samples, a short block creates 128 new samples if after a short block, and a long block creates 1024 samples after a long block. A block where the mode changes, creates (128+1024)/2 = 576 samples. If all of this sounds confusing, just ask. Or, you might want to check on a little program I have written in Standard ANSI C to analyze Ogg Vorbis / Opus files. I have attached it to the end of this message. Run it e.g. like this:
oggcrc -h
oggcrc -v -v -v myfile.ogg
As an example, I ran it for your file original.ogg, and the start of the printout goes like this:
Code: Select all
% oggcrc -v -v original.ogg
Opened "/users/leopold/t/original.ogg"
Frame 0 @ 0, 3a B, 1 pg, _F_, fCrc fb96d97f, calc fb96d97f OK
serialNo 3cc8855f
page 0 length 1e bytes
Ogg type: Vorbis
Header frame type 1: IDENTIFICATION
Vorbis version: 0, Audio channels: 2, Samplerate: 44100
Bitrate max: -1, Bitrate nominal 128000, Bitrate min -1
Block sizes 256 2048, Framing bit OK
Serial Number 3cc8855f
timeCode 00000000:00000000 = 0:00.00
Frame 1 @ 3a, 10e0 B, 11 pg, ___, fCrc c44ba6fd, calc c44ba6fd OK
serialNo 3cc8855f
page 0 length c4 bytes
page 1 length ff bytes
page 2 length ff bytes
page 3 length ff bytes
page 4 length ff bytes
page 5 length ff bytes
page 6 length ff bytes
page 7 length ff bytes
page 8 length ff bytes
page 9 length ff bytes
page a length ff bytes
page b length ff bytes
page c length ff bytes
page d length ff bytes
page e length ff bytes
page f length ff bytes
page 10 length ff bytes
Ogg type: Vorbis
Header frame type 3: COMMENT
Vendor: "Xiph.Org libVorbis I 20020717"
Comment 1/a: "ENCODER=Ogg Drop b3: www.nouturn.com"
Comment 2/a: "TITLE="
Comment 3/a: "ARTIST="
Comment 4/a: "ALBUM="
Comment 5/a: "TRACKNUMBER="
Comment 6/a: "TRACKTOTAL="
Comment 7/a: "DATE="
Comment 8/a: "DESCRIPTION="
Comment 9/a: "GENRE="
Comment a/a: "COPYRIGHT="
Ogg type: Vorbis
Header frame type 5: SETUP
timeCode 00000000:00000000 = 0:00.00
Frame 2 @ 111a, 58 B, 1 pg, C__, fCrc 91f3f955, calc 91f3f955 OK
serialNo 3cc8855f
page 0 length 3c bytes
timeCode 00000000:00000000 = 0:00.00
Frame 3 @ 1172, 111b B, 1a pg, ___, fCrc 60fd91c6, calc 60fd91c6 OK
serialNo 3cc8855f
page 0 length 37 bytes, tot 38 bytes, 0 samples, inf kbit/s
page 1 length ff bytes
page 2 length 4f bytes, tot 150 bytes, 240 samples, 205.8 kbit/s
page 3 length ff bytes
page 4 length 50 bytes, tot 151 bytes, 400 samples, 116.1 kbit/s
page 5 length ff bytes
page 6 length 4b bytes, tot 14c bytes, 400 samples, 114.4 kbit/s
page 7 length 3c bytes, tot 3d bytes, 240 samples, 37.4 kbit/s
page 8 length 3a bytes, tot 3b bytes, 80 samples, 162.6 kbit/s
page 9 length 48 bytes, tot 49 bytes, 80 samples, 201.2 kbit/s
page a length 4c bytes, tot 4d bytes, 80 samples, 212.2 kbit/s
page b length ff bytes
page c length 62 bytes, tot 163 bytes, 240 samples, 217.4 kbit/s
page d length ff bytes
page e length 8c bytes, tot 18d bytes, 400 samples, 136.8 kbit/s
page f length ff bytes
page 10 length 9a bytes, tot 19b bytes, 400 samples, 141.6 kbit/s
page 11 length ff bytes
page 12 length 9d bytes, tot 19e bytes, 400 samples, 142.6 kbit/s
page 13 length ff bytes
page 14 length 93 bytes, tot 194 bytes, 400 samples, 139.2 kbit/s
page 15 length ff bytes
page 16 length 83 bytes, tot 184 bytes, 400 samples, 133.7 kbit/s
page 17 length ff bytes
page 18 length 8b bytes, tot 18c bytes, 400 samples, 136.4 kbit/s
page 19 length ff bytes
timeCode 00000000:00002840 = 0:00.23, bitRate 149.9 kbit/s
Frame 4 @ 228d, 105b B, 19 pg, C__, fCrc f0faa02d, calc f0faa02d OK
serialNo 3cc8855f
page 0 length 88 bytes, tot 189 bytes, 400 samples, 135.4 kbit/s
page 1 length ff bytes
page 2 length 77 bytes, tot 178 bytes, 400 samples, 129.5 kbit/s
page 3 length ff bytes
page 4 length 65 bytes, tot 166 bytes, 400 samples, 123.3 kbit/s
page 5 length ff bytes
page 6 length 60 bytes, tot 161 bytes, 400 samples, 121.6 kbit/s
page 7 length ff bytes
page 8 length 6b bytes, tot 16c bytes, 400 samples, 125.4 kbit/s
page 9 length ff bytes
page a length 5c bytes, tot 15d bytes, 400 samples, 120.2 kbit/s
page b length ff bytes
page c length 69 bytes, tot 16a bytes, 400 samples, 124.7 kbit/s
page d length ff bytes
page e length 62 bytes, tot 163 bytes, 400 samples, 122.3 kbit/s
page f length ff bytes
page 10 length 4b bytes, tot 14c bytes, 400 samples, 114.4 kbit/s
page 11 length ff bytes
page 12 length 55 bytes, tot 156 bytes, 400 samples, 117.8 kbit/s
page 13 length ff bytes
page 14 length 4c bytes, tot 14d bytes, 400 samples, 114.7 kbit/s
page 15 length ff bytes
page 16 length 77 bytes, tot 178 bytes, 400 samples, 129.5 kbit/s
page 17 length 3c bytes, tot 3d bytes, 240 samples, 37.4 kbit/s
page 18 length 3d bytes, tot 3e bytes, 80 samples, 170.9 kbit/s
timeCode 00000000:00005b00 = 0:00.52, bitRate 113.7 kbit/s
Frame 5 @ 32e8, 1039 B, 1b pg, ___, fCrc 5cb2adcd, calc 5cb2adcd OK
serialNo 3cc8855f
.... etc etc etc ....
While it
may be technically possible to create a patch package for VS1063 that would be able to play Vorbis directly from an RTP stream, that goes pretty deep into the decoder, and it might take a long time to implement, if possible at all.
Kind regards,
- Henrik
Good signatures never die. They just fade away.