Sound in bad quality in my MUX

382 views
Skip to first unread message

Fabien

unread,
Feb 5, 2018, 5:35:19 PM2/5/18
to mmbtools
Dear all,

I don't understand why my sound is in bad quality when it is encoded in my MUX with ODR-AudioEnc & ODR-DabMux.

I get an AAC+ audio stream (64Kbps 44KHz) with VLC and I reencode with ODR-AudioEnc with this command:

odr-audioenc -v http://funradiobe.ice.infomaniak.ch/funradiobe-low.aac -C 200 -b 64 -c 2 -r 48000 -o tcp://10.30.10.124:79002 -D -L --audio-resampler=samplerate -L --src-converter-type=0

And my MUX config file : https://pastebin.com/W4xyqm98

Listen the sound of my program at the output of my DAB+ tuner VS. the sound at the VLC output with the original stream in the same bitrate (64Kbps) : https://soundcloud.com/fabienfs/aac-64kbps-in-dab-vs-original (or http://fa.bien.be/problem-dab-aac.wav)

Why the sound in DAB+ is in bad quality ?
I have a bitrate of 64Kbps on the original audio stream and on the DAB+ stream

I missed something? An option to add in ODR-AudioEnc?

Thanks for your help :-)

Best Regards,
Fabien

Hans van Eijsden

unread,
Feb 5, 2018, 7:41:28 PM2/5/18
to mmbtools
Every time you re-encode lossy material (like MP3 or AAC) to another lossy format, you will loose a lot of the quality. We call this effect "cascading". Please make sure to use a good lossless input stream, like WAV or FLAC. Or, in case of emergency, a 320kbps MP3 or 256kbps AAC stream.

- Hans


Op maandag 5 februari 2018 23:35:19 UTC+1 schreef Fabien:

Fabien

unread,
Feb 6, 2018, 2:30:28 PM2/6/18
to mmbtools
Hello Hans,

Thanks for your answer.

But there is another problem. I did the test with your FLAC stream and the quality in DAB+ is very very bad :-( https://soundcloud.com/fabienfs/dab-aac-96kbps-sound-vs-original-stream-flac

See below my encoder config:

odr-audioenc --vlc-uri=https://stream.and-stuff.nl:8443/live-riverside-flac -b 96 -r 48000 -o tcp://10.30.10.124:79003 --pad=58 --pad-fifo=/home/dab/DAB/dls/test.pad


Have you another idea of what could be the problem?

Thanks


888...@gmail.com

unread,
Feb 7, 2018, 2:21:40 AM2/7/18
to mmbtools
HI,

You have --pad=58 and -b 96 so netto audio bitrate is very low, try eg. without or lower value 16.

Regards

Peter Whisker

unread,
Feb 7, 2018, 2:47:39 AM2/7/18
to crc-mm...@googlegroups.com
Try lowering the pad size to 24. I have found that --ps isrequired for 64k and below. Try --sbr with the 96k. Also try converting the input stream to 48k in sox resampler first before feeding raw to odr-audioenc.

--
You received this message because you are subscribed to the Google Groups "mmbtools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to crc-mmbtools+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

888...@gmail.com

unread,
Feb 7, 2018, 2:56:46 AM2/7/18
to mmbtools
With my experience pad 16 is optimal even for dynamic images, I don't need "speed" for this.
I also use very optimized images with -R option, looks good and they have low size.

Peter Whisker

unread,
Feb 7, 2018, 2:58:12 AM2/7/18
to crc-mm...@googlegroups.com
Sorry I saw pad 58 and missed your post 🙂

On 7 Feb 2018 07:56, <888...@gmail.com> wrote:
With my experience pad 16 is optimal even for dynamic images, I don't need "speed" for this.
I also use very optimized images with -R option, looks good and they have low size.

--

Dennis Wynes

unread,
Feb 7, 2018, 4:34:46 AM2/7/18
to mmbtools
Sounds to me on a quick listen to the soundcloud sample that maybe the incoming flac stream is too "loud". T
As well as the other suggestions, try your setup but add -g -1 to vlc to reduce the gain.

odr-audioenc --vlc-uri=https://stream.and-stuff.nl:8443/live-riverside-flac -g -1 -b 96 -r 48000 -o tcp://10.30.10.124:79003 --pad=58 --pad-fifo=/home/dab/DAB/dls/test.pad

Peter Whisker

unread,
Feb 7, 2018, 4:52:17 AM2/7/18
to crc-mm...@googlegroups.com

The FLAC stream is also 44.1k and may be using the nasty resampler which adds lots of artifacts. Try adding this to the command:

 

-L --audio-resampler=samplerate -L --src-converter-type=0

 

 

odr-audioenc --vlc-uri=https://stream.and-stuff.nl:8443/live-riverside-flac -L --audio-resampler=samplerate -L --src-converter-type=0

--

You received this message because you are subscribed to the Google Groups "mmbtools" group.

To unsubscribe from this group and stop receiving emails from it, send an email to crc-mmbtools...@googlegroups.com.

Matthias Brändli

unread,
Feb 7, 2018, 5:26:03 AM2/7/18
to crc-mm...@googlegroups.com
Hello all,

I've added a few general remarks to the README, gathering the points you
are discussing. I hope this will be helpful:

https://github.com/Opendigitalradio/ODR-AudioEnc/commit/60140af509d33cd2179c56388b16746e9d67071a

Please tell if you have other useful hints to add!

mpb

On 07/02/18 10:52, Peter Whisker wrote:
> The FLAC stream is also 44.1k and may be using the nasty resampler which
> adds lots of artifacts. Try adding this to the command:
>
>  
>
> -L --audio-resampler=samplerate -L --src-converter-type=0
>
>  
>
>  
>
> odr-audioenc
> --vlc-uri=https://stream.and-stuff.nl:8443/live-riverside-flac
> <http://stream.and-stuff.nl:8443/live-riverside-flac> -L
> --audio-resampler=samplerate -L --src-converter-type=0
>
> -g -1 -b 96 -r 48000 -o tcp://10.30.10.124:79003 --pad=58
> --pad-fifo=/home/dab/DAB/dls/test.pad
>
>  
>
>  
>
> *From:*crc-mm...@googlegroups.com
> [mailto:crc-mm...@googlegroups.com] *On Behalf Of *Dennis Wynes
> *Sent:* 07 February 2018 09:35
> *To:* mmbtools <crc-mm...@googlegroups.com>
> *Subject:* Re: Sound in bad quality in my MUX
>
>  
>
> Sounds to me on a quick listen to the soundcloud sample that maybe the
> incoming flac stream is too "loud". T
> As well as the other suggestions, try your setup but add -g -1 to vlc to
> reduce the gain.
>
>  
>
> odr-audioenc
> --vlc-uri=https://stream.and-stuff.nl:8443/live-riverside-flac
> <http://stream.and-stuff.nl:8443/live-riverside-flac> -g -1 -b 96 -r
> 48000 -o tcp://10.30.10.124:79003 --pad=58
> --pad-fifo=/home/dab/DAB/dls/test.pad
>
>
>
> On Tuesday, 6 February 2018 19:30:28 UTC, Fabien wrote:
>
> Hello Hans,
>
>  
>
> Thanks for your answer.
>
>  
>
> But there is another problem. I did the test with your FLAC stream
> and the quality in DAB+ is very very bad :-(
> https://soundcloud.com/fabienfs/dab-aac-96kbps-sound-vs-original-stream-flac
>
>  
>
> See below my encoder config:
>
>  
>
> odr-audioenc
> --vlc-uri=https://stream.and-stuff.nl:8443/live-riverside-flac
> <http://stream.and-stuff.nl:8443/live-riverside-flac> -b 96 -r 48000
> -o tcp://10.30.10.124:79003 <http://10.30.10.124:79003> --pad=58
> --pad-fifo=/home/dab/DAB/dls/test.pad
>
>  
>
> My mux config: https://pastebin.com/zA5VXQAH
>
>  
>
> Have you another idea of what could be the problem?
>
>  
>
> Thanks
>
>  
>
>  
>
> --
> You received this message because you are subscribed to the Google
> Groups "mmbtools" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to crc-mmbtools...@googlegroups.com
> <mailto:crc-mmbtools...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google
> Groups "mmbtools" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to crc-mmbtools...@googlegroups.com
> <mailto:crc-mmbtools...@googlegroups.com>.

Fabien

unread,
Feb 7, 2018, 6:06:50 AM2/7/18
to mmbtools
Oh! With --sbr option, it's ok!


And the ODR-AudioEnc conf :
odr-audioenc --vlc-uri=https://stream.and-stuff.nl:8443/live-riverside-flac -L --audio-resampler=samplerate -L --src-converter-type=0 -g -1 -b 96 --sbr -r 48000 -o tcp://10.30.10.124:79002 --pad=58 --pad-fifo=/home/dab/DAB/dls/test.pad

However, when the original stream is AAC + 64Kbps at 44KHz, I've this problem : ODR-AudioEnc return this message : "packetizer_mpeg4audio demux packetizer : AAC channels: 2 samplerate: 22050"
Why the samplerate is so low? My conf :

odr-audioenc -v http://icecast.skyrock.net/s/klassiks_aac_96k -L --audio-resampler=samplerate -L --src-converter-type=0 -g -1 -b 64 --sbr --ps -r 48000 -o tcp://10.30.10.124:79001 -D -L --audio-resampler=samplerate -L --src-converter-type=0 --pad=58 --pad-fifo=/home/dab/DAB/dls/klassiks.pad

Thanks :-)

Peter Whisker

unread,
Feb 7, 2018, 6:15:30 AM2/7/18
to crc-mm...@googlegroups.com
AAC-LC at 96k should be ok but a PAD of 58 will mean a lot less than 96k so --sbr will force HE-AAC. (--ps forces HE-AACv2). Also if you have artifacts above ~10k it will remove them and replace with clean artificial high frequencies replicated from below. So its artificial but sounds better at the same bandwidth.

--
You received this message because you are subscribed to the Google Groups "mmbtools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to crc-mmbtools+unsubscribe@googlegroups.com.

Fabien

unread,
Feb 7, 2018, 6:26:55 AM2/7/18
to mmbtools
Ok, so if I want to keep an audio quality at 64Kbps (like the original stream) and have a --pad at 24: how to do? It's not possible?

Matthias Brändli

unread,
Feb 7, 2018, 6:29:19 AM2/7/18
to crc-mm...@googlegroups.com
Hi

On 07/02/18 12:06, Fabien wrote:
> ODR-AudioEnc return this message : "*packetizer_mpeg4audio demux
> packetizer : AAC channels: 2 samplerate: 22050*"

That message is from VLC, decoding your AAC source. And your AAC source
is probably 44100Hz with SBR, i.e. the AAC Core runs at 22050Hz and the
SBR reconstructs the other half.

It is not a problem, but as others said, don't use such a low bitrate
source! You cannot encode from a 64kbps AAC source to 64kbps and expect
good quality (encoder cascading).

mpb

888...@gmail.com

unread,
Feb 7, 2018, 6:32:27 AM2/7/18
to mmbtools
Higher pad length decreases effective audio bitrate, that's simple explanation how it works.

Dennis Wynes

unread,
Feb 7, 2018, 6:33:57 AM2/7/18
to mmbtools
Go back to basics to start. What does this sound like, the pad/dls doesn't look right off the top of my head.

odr-audioenc -v http://icecast.skyrock.net/s/klassiks_aac_96k -b 64 -o tcp://10.30.10.124:79001

s

Fabien

unread,
Feb 7, 2018, 6:39:04 AM2/7/18
to mmbtools
Ok I understand better.
So if I want to keep the audio quality to the maximum while having a slideshow/dls, I have to put this in a packet data service (in dedicated channel). Correct ?

888...@gmail.com

unread,
Feb 7, 2018, 6:52:12 AM2/7/18
to mmbtools
If your target is 96kbit effective data for audio You need to set it to 128kbit + some pad data.

Dennis Wynes

unread,
Feb 7, 2018, 6:57:07 AM2/7/18
to mmbtools
Not necessarily, you can do it with a fifo, for example:

odr-audioenc -v http://sc3.radiocaroline.net:8030 -b 96 -o tcp://127.0.0.1:9005 -p 58 -P /tmp/pade.fifo -w /home/dennis/odr/pize5.txt

odr-padenc -o /tmp/pade.fifo -t /home/dennis/odr/pize5.txt -d /home/dennis/odr/caroplus

888...@gmail.com

unread,
Feb 7, 2018, 6:59:40 AM2/7/18
to mmbtools
Maybe I'm wrong but -b parameter means brutto audio bitrate, netto audio bitrate is always lower and depends of pad lenght and some additional data.

888...@gmail.com

unread,
Feb 7, 2018, 7:12:35 AM2/7/18
to mmbtools
This is confusing because standard receiver shows only brutto bitrate but this not what you hear...

Peter Whisker

unread,
Feb 7, 2018, 7:25:48 AM2/7/18
to crc-mm...@googlegroups.com

I run a local easydabv2 card (very low power <10mW which just covers my house for my own listening and test purpose).

 

The stream is available for dablin on 18080/tcp if you want to listen at :

 

nc  2.31.172.191  18080 | dablin_gtk

 

It should be there at least for the next few days (hopefully my firewall is letting it through)

 

I have attached the supervisord config file which contains the commands (ffmpeg/sox input with resampling, volume control and lowpass piped by fifo raw onto odr-audioenc) and the mux.mux – I think that the audio quality is good and not dissimilar to the input streams. I have some services on DAB and DAB+ for comparison so using a local icecast2 server reduces broadband usage.

 

I send slides which are 6-8kB JPEGs – I use the “convert” command to timestamp a HQ slide and save at 6-8k size (for example see below)

 

#!/bin/bash

let Z=`date +%s`+30

T=`date --date="@$Z" +%H:%M`

convert -font helvetica-bold -pointsize 20 -gravity NorthWest -interlace none  -annotate +20+10 $T -fill black -quality 25% ~/Slides/uy-hq.jpg ~/uyslides/uy.jpg

 

Using sox/ffmpeg as a front end saves CPU and uses the amazing libsoxr resampler which is a lot better and more efficient than libsrc in VLC.

 

Hope this is of interest.

 

Peter

--

You received this message because you are subscribed to the Google Groups "mmbtools" group.

To unsubscribe from this group and stop receiving emails from it, send an email to crc-mmbtools...@googlegroups.com.

mux.conf
mux.mux

Dennis Wynes

unread,
Feb 7, 2018, 9:58:19 AM2/7/18
to mmbtools
Certainly an eclectic selection of stations Peter! ;-)
I'm interested in trying sox/ffmpeg as an update to VLC 3.0 in Debian Testing over the New Year screwed up odr-audioenc.

Peter Whisker

unread,
Feb 7, 2018, 11:00:04 AM2/7/18
to crc-mm...@googlegroups.com

You lose the auto-reconnect provided in odr-audioenc VLC but using supervisord largely overcomes this.

 

sox doesn’t handle AAC input streams otherwise it’s the best!

ffmpeg handles AAC input streams and is compiled with libsoxr – the audio filtering is “interesting” to get working properly.

 

I filter the resultant resampled streams with a sharp 16kHz lowpass before submitting to odr-audioenc. It has enough to do without dealing with high frequency artifacts.

 

Look at http://src.infinitewave.ca/ and compare sweep of “SoX 14.4 VHQ Linear Phase” against anything else including “Secret Rabbit Code 0.1.8 (Best)”. It is apparently completely clean!

 

Peter

Reply all
Reply to author
Forward
0 new messages