odr-audioenc with streams encoded at 44100 is very poor

748 views
Skip to first unread message

Peter Whisker

unread,
Feb 11, 2017, 6:04:25 PM2/11/17
to mmbtools
Hi

I have tested encoding an incoming stream using mpg123->sox->odr-audioenc rather than natively and it sounds massively better when the incomng stream is a 44.1k one. It makes little difference to a 32k incoming stream.

I think that the rate resampling leaves a lot of mushy artifacts on odr-audioenc with a 44.1k incoming feed.

# This sounds great
mpg123 -q -s http://localhost:8000/lyric | sox -t raw -r 44.1k -b 16 -e signed -c 2 - -r 48k -t raw - rate -v 48k | \
 odr-audioenc -i - -f raw -C 200 -r 48000 -b 160 -a -D -p 58 -P /tmp/padlyric.fifo -o tcp://localhost:9000 &

#This sounds horrible
odr-audioenc -v http://127.0.0.1:8000/lyric -C 200  -b 160 -a    -D -p 58 -P /tmp/padlyric.fifo      -o tcp://localhost:9000 2>/dev/null &

Peter

Matthias Brändli

unread,
Feb 12, 2017, 2:17:57 PM2/12/17
to crc-mm...@googlegroups.com
Hello,

VLC is doing the resampling, not ODR-AudioEnc. For some reason, it
sometimes uses the ugly_resampler instead of the better libsamplerate
based one.

When you run ODR-AudioEnc with -VV, do you see it choosing the
ugly_resampler?

mpb
> --
> 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.

Federico Allegretti

unread,
Feb 15, 2017, 5:34:39 AM2/15/17
to mmbtools
i suppose that vlc could be "forced" to use a particular feature by switches in command line, Or maybe recompiled to match the needings.

Matthias Brändli

unread,
Feb 15, 2017, 7:17:28 AM2/15/17
to crc-mm...@googlegroups.com
I believe it's a question of installing the right packets, because on my
debian systems it works properly.

mpb

888...@gmail.com

unread,
Feb 15, 2017, 8:17:06 AM2/15/17
to mmbtools, matthias...@mpb.li
So which packages are needed? because I tried all possible resampling libraries and still same sound.
Best solution is add some good resampler to odr-encoder and use VLC native sample rate.

Peter Whisker

unread,
Feb 19, 2017, 8:39:23 AM2/19/17
to mmbtools, matthias...@mpb.li
Yes, it's choosing the "ugly" resampler:

[00007f17a4000ed8] araw encoder debug: samplerate:48000Hz channels:2 bits/sample:16
[00007f17a4000ed8] core encoder debug: using encoder module "araw"
[00007f17b0001fc8] core stream out debug: input 'f32l' 44100 Hz Stereo frame=1 samples/8 bytes
[00007f17b0001fc8] core stream out debug: conversion: 'f32l'->'s16l' 44100 Hz->44100 Hz Stereo->Stereo
[00007f17a400e0a8] core audio converter debug: looking for audio converter module matching "any": 12 candidates
[00007f17a400e0a8] audio_format audio converter debug: f32l->s16l, bits per sample: 32->16
[00007f17a400e0a8] core audio converter debug: using audio converter module "audio_format"
[00007f17b0001fc8] core stream out debug: conversion pipeline complete
[00007f17a4014dc8] core audio resampler debug: looking for audio resampler module matching "any": 3 candidates
[00007f17a4014dc8] core audio resampler debug: using audio resampler module "ugly_resampler"
[00007f17a4000ed8] core encoder debug: removing module "araw"
[00007f17a4014dc8] core audio resampler debug: removing module "ugly_resampler"
[00007f17a400e0a8] core audio converter debug: removing module "audio_format"
[00005560c14ee6f8] core input debug: Decoder wait done in 4 ms

Peter Whisker

unread,
Feb 19, 2017, 11:31:54 AM2/19/17
to mmbtools, matthias...@mpb.li
Even when I specify -L --audio-resampler=samplerate it goes back to using the ugly_resampler. Even though it says "removing module "ugly_resampler"" below it ends up using it. I read that this might me a problem with the integer mixer but it sounds horrible. Has anyone managed to force it to use libsamplerate?

Matthias Brändli

unread,
Feb 19, 2017, 12:39:10 PM2/19/17
to crc-mm...@googlegroups.com
Hi Peter,

your remark about the "integer mixer" might be the key. I stumbled upon
that thread https://forum.videolan.org/viewtopic.php?t=128349 which
mentions exactly this. Maybe we can tell VLC to first resample, then
convert to signed 16-bit samples. In the ODR-AudioEnc sources, I have
first acodec=s16l and then samplerate=<the chosen sample rate>. I've
swapped them now.

Can you please compile the following two commits and check if that makes
a difference?

With the fix: b4bdcf1
Old behaviour: d856517


If that makes no difference, could you please verify that the package
libsamplerate0 is installed on your machine? I guess it is, because vlc
depends on vlc-nox, which depends on libsamplerate0. But it's better to
check.

Other things that could be helpful:

sudo dpkg-reconfigure vlc

(Maybe this refreshes the VLC cache, I've seen some bugreports about
that, e.g. https://bugs.archlinux.org/task/41414), and

vlc --reset-config
(As the same user that will run the ODR tools later, not as root)

Cheers,
mpb
> module "*ugly_resampler*"
> > <mailto:crc-mmbtools...@googlegroups.com>.
> > For more options, visit https://groups.google.com/d/optout
> <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>.

Gerard Lokhoff

unread,
Feb 19, 2017, 7:02:49 PM2/19/17
to mmbtools

Hi !

I've just started to experiment with the mmbtools, so wasn't even aware that ODR-AudioEnc could itself use the VLClib to perform the sample rate conversion... I therefore am running a separate VLC player to just transcode from a 44.1 kHz stream to 384 kbps MPEG 1 layer II 48 kHz stream, which is then taken to ODR-AudioEnc for coding to either 96 kbps AAC or 192 kbps MPEG 1 layer II. As a temporary solution this might work for some ?

As to processor cycles: am running 2 such instances of VLC player, 3 times ODR-AudioEnc and ODR-DabMux on a Raspberry Pi 3 Model B with max 25 % load.

I might run into the same problem with the 'ugly resampler' in VLC player I suppose, Is there a way to force VLC player itself to use the better one ?

Matthias Brändli

unread,
Feb 20, 2017, 1:02:48 PM2/20/17
to crc-mm...@googlegroups.com
Hello Gerard,

have you tried the latest "next" version that includes the bugfix commit
b4bdcf1 that I mentioned in a previous email? Is that version still
using the ugly_resampler?

mpb

888...@gmail.com

unread,
Feb 20, 2017, 2:23:44 PM2/20/17
to mmbtools, matthias...@mpb.li
Hi,

I didn't check which resampler is after update but I hear same ugly sound..

Regards

Gerard Lokhoff

unread,
Feb 20, 2017, 4:41:46 PM2/20/17
to mmbtools, matthias...@mpb.li
Hi Matthias !

I'm pretty new to the ODR tools, so don't know yet how to check what you ask.
Please note : I was using VLC separately first to do the resampling from 44.1 to 48 kHz, and the ODR-AudioEnc to encode to AAC (using 384 kbps MPEG 1 Layer II as intermediate format). Since I learned this can be done directly in ODR-AudioEnc using the VLC library I now changed over to that solution.

Here's the invocation of ODR-AudioEnc I'm now using and the screen output

$ odr-audioenc -v http://server-66.stream-server.nl:8852 -C 200 -b 96 -r 48000 -c 2 -o tcp://localhost:9000 -D -VV -L --audio-resampler=samplerate -L --src-converter-type=0
Welcome to ODR-AudioEnc v2.0.1, compiled at Feb 12 2017, 06:51:20
  http://opendigitalradio.org

Using 12 subchannels. AAC type: AAC-LC. channels=2, sample_rate=48000
AAC bitrate set to: 96000
DAB+ Encoding: framelen=960 (3840B)
Initialising VLC...
You are using VLC with size_t size callbacks
Initialising VLC with options:
  
  --network-caching=200
  --sout
  #transcode{acodec=s16l,samplerate=48000}:smem{audio-postrender-callback=121456,audio-prerender-callback=109740,audio-data=2122922540}
  --audio-resampler=samplerate
  --src-converter-type=0
[0088fe08] pulse audio output error: PulseAudio server connection failure: Connection refused
[00890130] pulse audio output error: PulseAudio server connection failure: Connection refused
Start VLC thread
Starting encoding
[73102e30] http access: Raw-audio server found, mp3 demuxer selected
U[70c07898] mpgatofixed32 audio converter error: libmad error: bad main_data_begin pointer

Seems to run OK, but it is hard to judge whether or not I hear the typical encoding artefacts anymore. Then the source I'm using is using music that isn't encoded very well - we need to improve that before we can go on air...

Hope this helps... ;o)

Gerard

888...@gmail.com

unread,
Feb 21, 2017, 6:29:58 AM2/21/17
to mmbtools, matthias...@mpb.li
Hi,

Only this options makes difference -L --audio-resampler=speex_resampler -L --speex-resampler-quality=10 but CPU load is really high, I think it shouldn't because speex is light even at maximum quality.

regards

Gerard Lokhoff

unread,
Feb 22, 2017, 1:30:47 AM2/22/17
to mmbtools, matthias...@mpb.li
I'm not sure this is related, but perhaps might give a clue:

I have noted that encoding at 96 kbps sounds far worse than at 64 kbps:

odr-audioenc -v http://server-66.stream-server.nl:8852 -C 200 -b 96 -r 48000 -c 2 -o tcp://localhost:59000 -D -L --audio-resampler=samplerate -L --src-converter-type=0

sounds worse than

odr-audioenc -v http://server-66.stream-server.nl:8852 -C 200 -b 64 -r 48000 -c 2 -o tcp://localhost:59000 -D -L --audio-resampler=samplerate -L --src-converter-type=0

There is a distinct high frequency 'ambient veil' that changes with the audio content in the 96 kbps version.

The source is a stream at 192 kbps mp3.

Is there a clear overview of the options for the various bitrates ? And information about the psychoacoustic models ?

Matthias Brändli

unread,
Feb 22, 2017, 2:38:00 AM2/22/17
to crc-mm...@googlegroups.com
Hello,

FDK-AAC can do AAC-LC, AAC-LC+SBR (HE-AAC) and AAC-LC+SBR+PS (HE-AACv2).
If not overridden on the command line, it will chose the mode according
to the bitrate. The selection logic is here:

https://github.com/Opendigitalradio/ODR-AudioEnc/blob/master/src/odr-audioenc.cpp#L227

At startup, the encoder will print out what mode it chose.

The difference you hear could come from the fact that at 96kbps SBR is
disabled, whereas at 64kbps it is active. In FDK-AAC, SBR is known to
hide some artefacts of the AAC-LC encoder.

mpb

Peter Whisker

unread,
Feb 23, 2017, 8:00:07 AM2/23/17
to mmbtools, matthias...@mpb.li
Hi

Yes, i discovered this too. However the speex resampler is not so bad with a quality setting of 8 or lower. I have it set to 8 for the 160kbps MP2 and 96kbps AAC-LC streams, 7 for 128kbps MP2 streams and 5 for 40kbps HE-AACv2 and the CPU load is tolerable as is the quality. I am testing with seven streams in the multiplex - 1x160k DAB and 1x 128k DAB, 1x 96k DAB+ and 4x40k DAB+.

At least it works. I have tried to use ffmpeg and mpg123/sox as front-ends with some success. Tested alternatives shown below:

    • mpg123 -q -s http://localhost:8000/lyric | sox -t raw -r 44.1k -b 16 -e signed -c 2 - -r 48k -t raw - rate -v 48k | odr-audioenc -i - -f raw -C 200 -r 48000 -b 160 -a -D -p 58 -P /tmp/padlyric.fifo -o tcp://localhost:9000 &
    • ffmpeg -i http://localhost:8000/lyric -reconnect_streamed 1 -reconnect_delay_max 2 -f s16le -acodec pcm_s16le -af aresample=resampler=soxr -precision 32 -ar 48000 - 2>/dev/null | odr-audioenc -i - -f raw -C 200 -r 48000 -b 160 -a -D -p 58 -P /tmp/padlyric.fifo -o tcp://localhost:9000 &
    • odr-audioenc -L --audio-resampler=speex_resampler -L --speex-resampler-quality=8 -v http://127.0.0.1:8000/lyric -r 48000 -C 200 -r 48000 -b 160 -a -D -p 58 -P /tmp/padlyric.fifo -o tcp://localhost:9000 &
    Peter

    Peter Whisker

    unread,
    Feb 23, 2017, 8:22:44 AM2/23/17
    to mmbtools, matthias...@mpb.li
    Matthias

    I downloaded the "next" version and compiled it however it still fails to select libsamplerate. It is installed.

    root@network2:/home/vboxusers# dpkg -l | grep samplerate
    ii  libsamplerate0:amd64                  0.1.8-8                              amd64        Audio sample rate conversion library
    ii  libsamplerate0-dev:amd64              0.1.8-8                              amd64        Development files for audio sample rate conversion

    "odr-audioenc -L --audio-resampler=samplerate -VV -v http://127.0.0.1:8000/lyric -r 48000 -C 200 -r 48000 -b 160 -a -D -p 58 -P /tmp/padlyric.fifo -o tcp://localhost:9000 &" trace below:

    [00007f569004e188] mpeg_audio decoder debug: MPGA channels:2 samplerate:44100 bitrate:160
    [00007f5690000ca8] core stream output debug: adding a new sout input (sout_input:0x7f5678000b90)
    [00007f5690001fc8] stream_out_transcode stream out debug: creating audio transcoding from fcc=`mpga' to fcc=`s16l'
    [00007f5678000d28] core generic debug: looking for decoder module matching "any": 41 candidates
    [00007f5678000d28] core generic debug: using decoder module "mpeg_audio"
    [00007f5678001188] core encoder debug: looking for encoder module matching "any": 20 candidates
    [00007f5678001188] araw encoder debug: samplerate:48000Hz channels:2 bits/sample:16
    [00007f5678001188] core encoder debug: using encoder module "araw"
    [00007f5690001fc8] core stream out debug: input 'mpga' 44100 Hz Stereo frame=1152 samples/1053 bytes
    [00007f5690001fc8] core stream out debug: conversion: 'mpga'->'s16l' 44100 Hz->44100 Hz Stereo->Stereo
    [00007f56780052a8] core audio converter debug: looking for audio converter module matching "any": 12 candidates
    [00007f56780052a8] core audio converter debug: no audio converter modules matched
    [00007f56780052a8] core audio converter debug: looking for audio converter module matching "any": 12 candidates
    [00007f56780052a8] mpgatofixed32 audio converter debug: mpga->f32l, bits per sample: 32
    [00007f56780052a8] core audio converter debug: using audio converter module "mpgatofixed32"
    [00007f5678011988] core audio converter debug: looking for audio converter module matching "any": 12 candidates
    [00007f5678011988] audio_format audio converter debug: f32l->s16l, bits per sample: 32->16
    [00007f5678011988] core audio converter debug: using audio converter module "audio_format"
    [00007f5690001fc8] core stream out debug: conversion pipeline complete
    [00007f5678011d88] core audio resampler debug: looking for audio resampler module matching "samplerate": 3 candidates
    [00007f5678011d88] core audio resampler debug: using audio resampler module "ugly_resampler"
    [00007f5678001188] core encoder debug: removing module "araw"
    [00007f5678011d88] core audio resampler debug: removing module "ugly_resampler"
    [00007f56780052a8] core audio converter debug: removing module "mpgatofixed32"
    [00007f5678011988] core audio converter debug: removing module "audio_format"
    [00005645bb84ee58] core input debug: Buffering 39%
    [00005645bb84ee58] core input debug: Buffering 52%
    [00005645bb84ee58] core input debug: Buffering 65%
    [00005645bb84ee58] core input debug: Buffering 78%
    [00005645bb84ee58] core input debug: Buffering 91%
    [00005645bb84ee58] core input debug: Stream buffering done (208 ms in 6 ms)
    [00005645bb84ee58] core input debug: Decoder wait done in 0 ms
    [00007f5678000d28] mpeg_audio generic debug: MPGA channels:2 samplerate:44100 bitrate:160
    [00007f5678001188] core encoder debug: looking for encoder module matching "any": 20 candidates
    [00007f5678001188] araw encoder debug: samplerate:48000Hz channels:2 bits/sample:16
    [00007f5678001188] core encoder debug: using encoder module "araw"
    [00007f5690001fc8] core stream out debug: input 'mpga' 44100 Hz Stereo frame=1152 samples/1053 bytes
    [00007f5690001fc8] core stream out debug: conversion: 'mpga'->'s16l' 44100 Hz->44100 Hz Stereo->Stereo
    [00007f567800c588] core audio converter debug: looking for audio converter module matching "any": 12 candidates
    [00007f567800c588] core audio converter debug: no audio converter modules matched
    [00007f567800c588] core audio converter debug: looking for audio converter module matching "any": 12 candidates
    [00007f567800c588] mpgatofixed32 audio converter debug: mpga->f32l, bits per sample: 32
    [00007f567800c588] core audio converter debug: using audio converter module "mpgatofixed32"
    [00007f5678012268] core audio converter debug: looking for audio converter module matching "any": 12 candidates
    [00007f5678012268] audio_format audio converter debug: f32l->s16l, bits per sample: 32->16
    [00007f5678012268] core audio converter debug: using audio converter module "audio_format"
    [00007f5690001fc8] core stream out debug: conversion pipeline complete
    [00007f5678012668] core audio resampler debug: looking for audio resampler module matching "samplerate": 3 candidates
    [00007f5678012668] core audio resampler debug: using audio resampler module "ugly_resampler"
    >         > <mailto:crc-mmbtools+unsub...@googlegroups.com>.
    >         > For more options, visit https://groups.google.com/d/optout
    >         <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

    Peter Whisker

    unread,
    Feb 23, 2017, 8:33:45 AM2/23/17
    to mmbtools, matthias...@mpb.li
    Matthias

    I don't think that this build picked up your latest commit and I can't find it in the https://github.com/Opendigitalradio/ODR-AudioEnc repo. Where can I get it from please?

    Thanks
    Peter

    Peter Whisker

    unread,
    Feb 23, 2017, 8:42:19 AM2/23/17
    to mmbtools, matthias...@mpb.li
    The latest commit showing in "next" is:

    Latest commit d856517 13 days ago @mpbraendli mpbraendli libtoolame-dab: print to stderr instead of stdout

    Matthias Brändli

    unread,
    Feb 23, 2017, 8:45:53 AM2/23/17
    to mmbtools
    Oh sorry sorry I forgot to push that commit!

    :-(

    It's done now.

    https://github.com/Opendigitalradio/ODR-AudioEnc/commit/b4bdcf1f77c28e1dfdd0ebdcd774b0dd7cdd0bff

    mpb

    On 23. 02. 17 14:42, Peter Whisker wrote:
    > The latest commit showing in "next" is:
    >
    > Latest commit d856517
    > <https://github.com/Opendigitalradio/ODR-AudioEnc/commit/d856517d7ed8ebd1af302602b777979d89785e0c>
    > 13 days ago @mpbraendli mpbraendli <https://github.com/mpbraendli>
    > libtoolame-dab: print to stderr instead of stdout
    > <https://github.com/Opendigitalradio/ODR-AudioEnc/commit/d856517d7ed8ebd1af302602b777979d89785e0c>

    Peter Whisker

    unread,
    Feb 23, 2017, 8:59:29 AM2/23/17
    to mmbtools, matthias...@mpb.li
    Hi

    Ok, grabbed and compiled 89715ea

    Still the same sadly:

    [00007f92b004e188] mpeg_audio decoder debug: MPGA channels:2 samplerate:44100 bitrate:160
    [0000563b3ae116e8] core input debug: Buffering 39%
    [0000563b3ae116e8] core input debug: Buffering 52%
    [00007f92b0000c78] core stream output debug: adding a new sout input (sout_input:0x7f9294000b90)
    [0000563b3ae116e8] core input debug: Buffering 65%
    [00007f92b0001fc8] stream_out_transcode stream out debug: creating audio transcoding from fcc=`mpga' to fcc=`s16l'
    [0000563b3ae116e8] core input debug: Buffering 78%
    [00007f9294000d28] core generic debug: looking for decoder module matching "any": 41 candidates
    [0000563b3ae116e8] core input debug: Buffering 91%
    [0000563b3ae116e8] core input debug: Stream buffering done (208 ms in 0 ms)
    [00007f9294000d28] core generic debug: using decoder module "mpeg_audio"
    [00007f9294001188] core encoder debug: looking for encoder module matching "any": 20 candidates
    [00007f9294001188] araw encoder debug: samplerate:48000Hz channels:2 bits/sample:16
    [00007f9294001188] core encoder debug: using encoder module "araw"
    [00007f92b0001fc8] core stream out debug: input 'mpga' 44100 Hz Stereo frame=1152 samples/1053 bytes
    [00007f92b0001fc8] core stream out debug: conversion: 'mpga'->'s16l' 44100 Hz->44100 Hz Stereo->Stereo
    [00007f92940052a8] core audio converter debug: looking for audio converter module matching "any": 12 candidates
    [00007f92940052a8] core audio converter debug: no audio converter modules matched
    [00007f92940052a8] core audio converter debug: looking for audio converter module matching "any": 12 candidates
    [00007f92940052a8] mpgatofixed32 audio converter debug: mpga->f32l, bits per sample: 32
    [00007f92940052a8] core audio converter debug: using audio converter module "mpgatofixed32"
    [00007f9294011988] core audio converter debug: looking for audio converter module matching "any": 12 candidates
    [00007f9294011988] audio_format audio converter debug: f32l->s16l, bits per sample: 32->16
    [00007f9294011988] core audio converter debug: using audio converter module "audio_format"
    [00007f92b0001fc8] core stream out debug: conversion pipeline complete
    [00007f9294011d88] core audio resampler debug: looking for audio resampler module matching "samplerate": 3 candidates
    [00007f9294011d88] core audio resampler debug: using audio resampler module "ugly_resampler"
    [00007f9294001188] core encoder debug: removing module "araw"
    [00007f9294011d88] core audio resampler debug: removing module "ugly_resampler"
    [00007f92940052a8] core audio converter debug: removing module "mpgatofixed32"
    [00007f9294011988] core audio converter debug: removing module "audio_format"
    [0000563b3ae116e8] core input debug: Decoder wait done in 2 ms
    [00007f9294000d28] mpeg_audio generic debug: MPGA channels:2 samplerate:44100 bitrate:160
    [00007f9294001188] core encoder debug: looking for encoder module matching "any": 20 candidates
    [00007f9294001188] araw encoder debug: samplerate:48000Hz channels:2 bits/sample:16
    [00007f9294001188] core encoder debug: using encoder module "araw"
    [00007f92b0001fc8] core stream out debug: input 'mpga' 44100 Hz Stereo frame=1152 samples/1053 bytes
    [00007f92b0001fc8] core stream out debug: conversion: 'mpga'->'s16l' 44100 Hz->44100 Hz Stereo->Stereo
    [00007f929400c588] core audio converter debug: looking for audio converter module matching "any": 12 candidates
    [00007f929400c588] core audio converter debug: no audio converter modules matched
    [00007f929400c588] core audio converter debug: looking for audio converter module matching "any": 12 candidates
    [00007f929400c588] mpgatofixed32 audio converter debug: mpga->f32l, bits per sample: 32
    [00007f929400c588] core audio converter debug: using audio converter module "mpgatofixed32"
    [00007f9294012268] core audio converter debug: looking for audio converter module matching "any": 12 candidates
    [00007f9294012268] audio_format audio converter debug: f32l->s16l, bits per sample: 32->16
    [00007f9294012268] core audio converter debug: using audio converter module "audio_format"
    [00007f92b0001fc8] core stream out debug: conversion pipeline complete
    [00007f9294012668] core audio resampler debug: looking for audio resampler module matching "samplerate": 3 candidates
    [00007f9294012668] core audio resampler debug: using audio resampler module "ugly_resampler"

    Matthias Brändli

    unread,
    Feb 23, 2017, 9:02:28 AM2/23/17
    to crc-mm...@googlegroups.com
    Ok, the next thing we can try is asking VLC to give us floats and
    convert to signed 16-bit in odr-audioenc.

    I'm still unhappy about the fact that we don't understand *why* it works
    on some systems and why it doesn't on others, but maybe we can get
    around that issue with this trick.

    mpb

    On 23. 02. 17 14:59, Peter Whisker wrote:
    > Hi
    >
    > Ok, grabbed and compiled 89715ea
    > <https://github.com/Opendigitalradio/ODR-AudioEnc/commit/89715eaa5e02c852e26caaa1854902335cbba794>
    > <https://github.com/Opendigitalradio/ODR-AudioEnc/commit/d856517d7ed8ebd1af302602b777979d89785e0c>>
    >
    >
    > --
    > 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>.

    Peter Whisker

    unread,
    Feb 23, 2017, 9:08:11 AM2/23/17
    to mmbtools, matthias...@mpb.li
    I am using debian stretch and these are the installed versions I have if its any help:

    root@network2:/home/vboxusers# dpkg -l | grep vlc
    ii  libvlc-bin:amd64                      2.2.4-13                             amd64        tools for VLC's base library
    ii  libvlc-dev:amd64                      2.2.4-13                             amd64        development files for libvlc
    ii  libvlc5:amd64                         2.2.4-13                             amd64        multimedia player and streamer library
    ii  libvlccore8:amd64                     2.2.4-13                             amd64        base library for VLC and its modules
    ii  vlc                                   2.2.4-13                             amd64        multimedia player and streamer
    ii  vlc-bin                               2.2.4-13                             amd64        binaries from VLC
    ii  vlc-data                              2.2.4-13                             all          Common data for VLC
    ii  vlc-l10n                              2.2.4-13                             all          Translations for VLC
    rc  vlc-nox                               2.2.4-9                              amd64        transitional dummy package
    ii  vlc-plugin-base:amd64                 2.2.4-13                             amd64        multimedia player and streamer (base plugins)
    rc  vlc-plugin-notify                     2.2.4-3+b1                           amd64        LibNotify plugin for VLC
    ii  vlc-plugin-qt:amd64                   2.2.4-13                             amd64        multimedia player and streamer (Qt plugin)
    ii  vlc-plugin-skins2:amd64               2.2.4-13                             amd64        multimedia player and streamer (Skins2 plugin)
    ii  vlc-plugin-video-output:amd64         2.2.4-13                             amd64        multimedia player and streamer (video output plugins)
    ii  vlc-plugin-video-splitter:amd64       2.2.4-13                             amd64        multimedia player and streamer (video splitter plugins)
    ii  vlc-plugin-visualization:amd64        2.2.4-13                             amd64        multimedia player and streamer (visualization plugins)

    Matthias Brändli

    unread,
    Feb 24, 2017, 10:06:34 AM2/24/17
    to crc-mm...@googlegroups.com
    Hello,

    could you try again with latest next? It has to be commit c2863cf or later.

    I'm doing the float to signed 16-bit in ODR-AudioEnc now, and I see that
    on one of my systems it chooses libsamplerate instead of ugly_resampler.

    mpb
    > > an email to crc-mmbtools...@googlegroups.com <javascript:>
    > > <mailto:crc-mmbtools...@googlegroups.com <javascript:>>.
    > > For more options, visit https://groups.google.com/d/optout
    > <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>.

    Peter Whisker

    unread,
    Feb 24, 2017, 10:38:45 AM2/24/17
    to mmbtools, matthias...@mpb.li
    Looks hopeful - I still need to have a listen but it's now using libsamplerate :-) Thank you.

    [00007f4c1c04e188] mpeg_audio decoder debug: MPGA channels:2 samplerate:44100 bitrate:160
    [00007f4c1c000ca8] core stream output debug: adding a new sout input (sout_input:0x7f4c04000b90)
    [00007f4c1c001fc8] stream_out_transcode stream out debug: creating audio transcoding from fcc=`mpga' to fcc=`f32l'
    [000055b382be9008] core input debug: Buffering 39%
    [000055b382be9008] core input debug: Buffering 52%
    [00007f4c04000d28] core generic debug: looking for decoder module matching "any": 41 candidates
    [000055b382be9008] core input debug: Buffering 65%
    [000055b382be9008] core input debug: Buffering 78%
    [000055b382be9008] core input debug: Buffering 91%
    [000055b382be9008] core input debug: Stream buffering done (208 ms in 0 ms)
    [00007f4c04000d28] core generic debug: using decoder module "mpeg_audio"
    [00007f4c04001188] core encoder debug: looking for encoder module matching "any": 20 candidates
    [00007f4c04001188] araw encoder debug: samplerate:48000Hz channels:2 bits/sample:32
    [00007f4c04001188] core encoder debug: using encoder module "araw"
    [00007f4c1c001fc8] core stream out debug: input 'mpga' 44100 Hz Stereo frame=1152 samples/1053 bytes
    [00007f4c1c001fc8] core stream out debug: conversion: 'mpga'->'f32l' 44100 Hz->44100 Hz Stereo->Stereo
    [00007f4c040052a8] core audio converter debug: looking for audio converter module matching "any": 12 candidates
    [00007f4c040052a8] core audio converter debug: no audio converter modules matched
    [00007f4c040052a8] core audio converter debug: looking for audio converter module matching "any": 12 candidates
    [00007f4c040052a8] mpgatofixed32 audio converter debug: mpga->f32l, bits per sample: 32
    [00007f4c040052a8] core audio converter debug: using audio converter module "mpgatofixed32"
    [00007f4c1c001fc8] core stream out debug: conversion pipeline complete
    [00007f4c04011988] core audio resampler debug: looking for audio resampler module matching "samplerate": 3 candidates
    [00007f4c04011988] core audio resampler debug: using audio resampler module "samplerate"
    [00007f4c04001188] core encoder debug: removing module "araw"
    [00007f4c04011988] core audio resampler debug: removing module "samplerate"
    [00007f4c040052a8] core audio converter debug: removing module "mpgatofixed32"
    [000055b382be9008] core input debug: Decoder wait done in 29 ms
    [00007f4c04000d28] mpeg_audio generic debug: MPGA channels:2 samplerate:44100 bitrate:160
    [00007f4c04001188] core encoder debug: looking for encoder module matching "any": 20 candidates
    [00007f4c04001188] araw encoder debug: samplerate:48000Hz channels:2 bits/sample:32
    [00007f4c04001188] core encoder debug: using encoder module "araw"
    [00007f4c1c001fc8] core stream out debug: input 'mpga' 44100 Hz Stereo frame=1152 samples/1053 bytes
    [00007f4c1c001fc8] core stream out debug: conversion: 'mpga'->'f32l' 44100 Hz->44100 Hz Stereo->Stereo
    [00007f4c0400c588] core audio converter debug: looking for audio converter module matching "any": 12 candidates
    [00007f4c0400c588] core audio converter debug: no audio converter modules matched
    [00007f4c0400c588] core audio converter debug: looking for audio converter module matching "any": 12 candidates
    [00007f4c0400c588] mpgatofixed32 audio converter debug: mpga->f32l, bits per sample: 32
    [00007f4c0400c588] core audio converter debug: using audio converter module "mpgatofixed32"
    [00007f4c1c001fc8] core stream out debug: conversion pipeline complete
    [00007f4c04012268] core audio resampler debug: looking for audio resampler module matching "samplerate": 3 candidates
    [00007f4c04012268] core audio resampler debug: using audio resampler module "samplerate"
    U[00007f4c1c004808] http access debug: New Icy-Title=
    >     > <mailto:crc-mmbtools+unsub...@googlegroups.com <javascript:>>.
    >     > For more options, visit https://groups.google.com/d/optout
    >     <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

    Peter Whisker

    unread,
    Feb 24, 2017, 11:02:26 AM2/24/17
    to mmbtools, matthias...@mpb.li
    Hi Matthias

    Yes, it seems to be working very well and sounds good I think. I have enabled "sinc" mode (-L --audio-resampler=samplerate -L --src-converter-type=0) although this is fairly heavy on CPU as expected.

    Many thanks
    Peter

    Matthias Brändli

    unread,
    Feb 24, 2017, 11:06:38 AM2/24/17
    to Peter Whisker, mmbtools
    Excellent. What's the default mode, and how is the quality of that?

    Did you compare CPU usage old vs new, or sinc vs. default mode?

    Keep in mind that the float to signed int conversion is a naïve implementation that could also consume more CPU.
    --
    Matthias Brändli
    >>> > > <mailto:crc-mmbtools...@googlegroups.com
    >>> <javascript:>>.
    >>> > > For more options, visit https://groups.google.com/d/optout
    >>> > <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>.

    888...@gmail.com

    unread,
    Feb 25, 2017, 3:07:51 AM2/25/17
    to mmbtools, pe...@whisker.org.uk, matthias...@mpb.li
    I have something strange, how to get more verobose? -VV don't work, I see only:


    Initialising VLC...
    You are using VLC with size_t size callbacks
    Initialising VLC with options:
      --verbose=2
      --sout
      #transcode{acodec=fl32,samplerate=48000}:smem{audio-postrender-callback=4261776,audio-prerender-callback=4247904,audio-data=140729755713120}
      --audio-resampler=samplerate
      --src-converter-type=0

    Start VLC thread
    Starting encoding
    [00007fbe5c0046e8] http access: Raw-audio server found, mp3 demuxer selected

    Peter Whisker

    unread,
    Feb 25, 2017, 4:45:32 AM2/25/17
    to mmbtools, pe...@whisker.org.uk, matthias...@mpb.li
    Hi Matthias

    As far as I can see if I leave all the switches off it now defaults to samplerate rather than ugly :-). The CPU I am seeing is:

    src-converter-type
    sinc 0: 13-14%
    sinc 1: 7-9%
    sinc 2: 6% (is this the default?)

    6% is about the level of the old ugly resampler. The above also correspond to the speex resampler at levels from 5-9.

    The quality sounds good but I need to do more listening. My sources are not perfect (icecast streams at 128k MP3 or 64k HE-AAC so I'll set up a new source of music from .flac files and see how that behaves but that will take a few days.

    I'd be interested in what others think. I have an EasyDab v2 board (40mW tx) with telescopic whip set at 38cm for channel 7D which covers my house and works well.

    Peter
    >>> <javascript:>>.
    >>> >     > For more options, visit https://groups.google.com/d/optout
    >>> >     <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
    Message has been deleted

    Gerard Lokhoff

    unread,
    Apr 15, 2017, 7:22:24 AM4/15/17
    to mmbtools
    Wow, I am rebuilding the RaspDAB installation, and therefore got the new versions running the RaspDab.sh batch file.
    Then I tried to get on air again an had problems with the audio running slow and stuttering. It took some time before I realized this might be due to this issue.
    I used to have settings in the configuration

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

    but if I use this now I get the effect as mentioned. I need to set

    -L --src-converter-type=1

    to get audio running well.

    Looking at the CPU load: with the setting previously set to 0 I used to have 6 audio encoders, 6 PAD encoders and the mux generation running on a Raspberry Pi model 3 at about 30 % load, with most of that in the audio processing (about 5..6% each). I guess I cannot do that anymore, as the single encoder with the setting at 1 is running at about 9..16% now. I do hope the audio is better with that, though... ;o)
    Reply all
    Reply to author
    Forward
    0 new messages