FS#41414 - [vlc] VLC uses the ugly resampler audio instead of libsamplerate

Attached to Project: Arch Linux
Opened by patrick (potomac) - Thursday, 31 July 2014, 18:48 GMT
Last edited by Doug Newgard (Scimmia) - Friday, 01 August 2014, 03:10 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

I notice a bug in vlc 2.1.5 that affects the audio quality, by default VLC will select the best audio resampler, which is libsamplerate ( an archlinux package exists ), if he doesn't find libsamplerate then VLC should use the "speex" algorithm for resampling,

but for an unknown reason VLC doesn't find libsamplerate and he chooses the "ugly resampler" which gives bad audio quality,

maybe it's a missing switch for the compilation, the vlc archlinux package may be incorrect,

I check the vlc log with this command :

vlc --extraintf=http:logger --verbose=2 --file-logging --logfile=/home/potomac/documents/bugs/vlc-log.txt

and I notice that vlc is unable to find libsamplerate ( SRC : "secret rabbit code" ), if I set to "automatic" the option for the resampler audio in VLC ( advanced option ) I can read this in vlc log :

main debug: looking for audio resampler module matching "any": 3 candidates
main debug: using audio resampler module "ugly_resampler"
main debug: End of audio preroll

if I set to "SRC secret rabbit code -libsamplerate" I find this in vlc log :

main debug: looking for audio resampler module matching "samplerate": 3 candidates
main debug: using audio resampler module "ugly_resampler"
main debug: End of audio preroll

and if I set to "Speex" for the resampler audio I get this :

main debug: looking for audio resampler module matching "speex_resampler": 3 candidates
main debug: using audio resampler module "speex_resampler"
main debug: End of audio preroll

so it seems there is a huge problem with vlc 2.1.5, the program is unable to find libsamplerate ( but the archlinux package libsamplerate is installed ),

I tried to create my own vlc package ( I use the switch --enable-samplerate in order to be sure that vlc will find libsamplerate ) but it's the same problem, the "ugly resampler" is used and only the "speex" resampler method gives good results,

I created a bug report in vlc's bugzilla but the vlc developpers don't want to fix the problem, they think it's a build problem form archlinux, or a problem with an external dependency

https://trac.videolan.org/vlc/ticket/11844#comment:2


Additional info:
* package version(s) vlc 2.1.5-1, libsamplerate 0.1.8-3, ffmpeg 1:2.3.1-1
* config and/or log files etc.


Steps to reproduce:

- open vlc 2.1.5-1
- check in "audio-> advanced option" that the default audio resampler is set to "automatic" ( or "SRC libsamplerate" )
- in the vlc log you will notice that the "ugly resampler" ( a bad audio algorithm ) is used instead of libsamplerate, this problem gives a bad sound quality, especially on jazz tracks ( or tracks who use acoustic instruments like piano ), a slight distortion will be easily heard
This task depends upon

Closed by  Doug Newgard (Scimmia)
Friday, 01 August 2014, 03:10 GMT
Reason for closing:  Duplicate
Additional comments about closing:   FS#39676 
Comment by patrick (potomac) - Thursday, 31 July 2014, 19:46 GMT
it could be a side effect of the bug "vlc-cache-gen" :

https://bugs.archlinux.org/task/39676

because I noticed the bug since I reinstall vlc ( I created a new package in order to solve the bug  FS#41369  ),

I must use the workaround in order to install vlc :

LD_PRELOAD=/usr/lib/libgobject-2.0.so.0 pacman -S vlc

but this workaround seems to create another bug, vlc-cache-gen doesn't seem to do a good job, that may explain why vlc didn't find the audio resampler libsamplerate ?
Comment by patrick (potomac) - Thursday, 31 July 2014, 20:55 GMT
in fact I found the solution,

my mistake was to split the workaround in 2 lines :

export LD_PRELOAD=/usr/lib/libgobject-2.0.so.0
pacman -S vlc

this method will trigger a bug in vlc-cache-gen, the plugin.dat file will be generated in a wrong way,

the solution is to type in one line without exporting LD_PRELOAD :

LD_PRELOAD=/usr/lib/libgobject-2.0.so.0 pacman -S vlc

another solution :

LD_PRELOAD=/usr/lib/libgobject-2.0.so.0 /usr/lib/vlc/vlc-cache-gen -f /usr/lib/vlc/plugins

now all is ok
Comment by patrick (potomac) - Thursday, 31 July 2014, 21:47 GMT
deleting manualy the file /usr/lib/vlc/plugins/plugins.dat and then regnerate it with vlc-cache-gen is more secure,

because sometimes vlc-cache-gen doesn't recreate this file if it already exists

Loading...