FS#33915 - [vlc] 2.0.5-3 doesn't play audio from .wmv correctly

Attached to Project: Arch Linux
Opened by George Angelopoulos (l4than-d3vers) - Monday, 18 February 2013, 10:10 GMT
Last edited by Gaetan Bisson (vesath) - Tuesday, 02 April 2013, 02:52 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Giovanni Scafora (giovanni)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 41
Private No

Details

Description:
When playing a .wmv on vlc-2.0.5-3 the video shows correctly but the audio is almost completely covered by noise. I'm not sure this is a vlc bug and if it is, it's probably upstream. Vlc plays other file types just fine and the same .wmv files that don't play correctly on vlc play correctly on mplayer.


Downgrade workaround:
this happens with the following packages installed:
vlc-2.0.5-3
ffmpeg-1:1.1.2-2
x264-20130206-1
Downgrading the above packages restores the functionality.

VLC reports the audio codec as:
Windows Media Audio 2 (WMA2)
This task depends upon

Closed by  Gaetan Bisson (vesath)
Tuesday, 02 April 2013, 02:52 GMT
Reason for closing:  Upstream
Additional comments about closing:  https://trac.videolan.org/vlc/ticket/826 0 or other
Comment by Christian (ubuntubang) - Friday, 22 February 2013, 08:49 GMT
it seems to be related to https://bugs.archlinux.org/task/33833
Comment by Paolo (paolo) - Friday, 01 March 2013, 14:22 GMT
Bug persists on vlc-2.0.5-4
Comment by arch user (archuser474747) - Friday, 01 March 2013, 15:47 GMT
confirming 2.0.5-4 still problematic.

Left channel is just white noise, the right channel contains a distorted version of the audio, out of sync by a second or two.

On some videos the following error pops up once. On others the error pops up each second, ocasionally pausing for anywhere between 1 second and several minutes (perhaps dynamic bitrate?).

[wmav2 @ 0x7fdcc8c4c420] output buffer size is too small for the current frame (192000 < 196608)

the final number changes each time, with all the others staying the same, i.e:

[wmav2 @ 0x7fdcc8c4c420] output buffer size is too small for the current frame (192000 < [different number])

The [different number] is always larger than 192000. Values seen: 196608, 212992, 229376, 245760. These numbers are the same across different videos.

Searching for these values it seems they're all multiples of 16384. Namely 12 (196608), 13 (212992), 14 (229376) and 15 (245760).

16384 seems to be a magic number with wma? https://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/35bdbf3a-24a4-49cf-ad83-c7c4882c2782

Might be barking up the wrong tree, but hope it helps.
Comment by Andrea Amorosi (AndreaA) - Saturday, 02 March 2013, 10:55 GMT
I can confirm the same issue.
Moreover it is impossible to downgrade due to the lack of qt package.
Comment by Florian Wickert (float) - Saturday, 02 March 2013, 14:29 GMT
Same here on vlc 2.0.5-4. Downgrading works but is a bit complicated since qt moved to qt4.

Output:
[wmv3 @ 0x7f06d4c0c340] warning: first frame is no keyframe
[wmav2 @ 0x7f06d4c4e2e0] output buffer size is too small for the current frame (192000 < 245760)
[wmav2 @ 0x7f06d4c4e2e0] output buffer size is too small for the current frame (192000 < 196608)
Comment by Christian (ubuntubang) - Saturday, 02 March 2013, 14:44 GMT
which ffmpeg version does work?
ffmpeg-1-1.1.3-1 -> noise
ffmpeg-1-1.1.2-3 -> noise
ffmpeg-1-1.1.2-2 -> noise
ffmpeg-1-1.0.1-1 -> vlc error message: [0xb6d07fc8] main decoder error: corrupt module: /usr/lib/vlc/plugins/codec/libavcodec_plugin.so
[0xb6d07fc8] main decoder error: no suitable decoder module for fourcc `WMA2'. VLC probably does not support this sound or video format.
[0xb6d07fc8] main decoder error: corrupt module: /usr/lib/vlc/plugins/codec/libavcodec_plugin.so
[0xb6d07fc8] main decoder error: no suitable decoder module for fourcc `VC-1'. VLC probably does not support this sound or video format.
Comment by Ionut Biru (wonder) - Saturday, 02 March 2013, 15:00 GMT
does it work with ffplay ?
Comment by Florian Wickert (float) - Saturday, 02 March 2013, 15:21 GMT
With ffplay everything works fine here!
Comment by Christian (ubuntubang) - Saturday, 02 March 2013, 15:38 GMT
yes, ffplay plays *.wmv files without problems (tested all ffmpeg version mentioned above)
Comment by Paolo (paolo) - Saturday, 02 March 2013, 19:17 GMT
Right, just as mplayer, which also uses ffmpeg judging by its output:

Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 54.92.100 (internal)
AUDIO: 48000 Hz, 2 ch, floatle, 128.0 kbit/4.17% (ratio: 16002->384000)
Selected audio codec: [ffwmav2] afm: ffmpeg (DivX audio v2 (FFmpeg))
Comment by arch user (archuser474747) - Sunday, 03 March 2013, 04:55 GMT
confirming mplayer works fine using ffmpeg:

Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 2 ch, floatle, 96.0 kbit/3.40% (ratio: 12000->352800)
Selected audio codec: [ffwmav2] afm: ffmpeg (DivX audio v2 (FFmpeg))
Comment by Alexander Kaltsas (firewalker) - Friday, 08 March 2013, 10:55 GMT
I tried to git bisect ffmpeg. I wasn't able to successfully build every revision but my guess is

http://ffmpeg.org/pipermail/ffmpeg-cvslog/2012-October/055714.html
Comment by slack3r (slack3r) - Tuesday, 12 March 2013, 10:59 GMT
Same problem here!

ffplay works fine, mplayer too.


Regards
Comment by Papadopoulos, Mihail (scarecrow) - Tuesday, 19 March 2013, 18:40 GMT
I don't have this problem here, because 2.0.5-4 segfaults right away... :P
strace dump attached.
This happens only with the QT UI, ncurses starts OK, but there's a problem with wmv/asf files.
On another box I run a custom vlc built from git and it works fine with the current ffmpeg version- no issues at all.
   debug.zip (22.8 KiB)
Comment by Christian (ubuntubang) - Thursday, 21 March 2013, 13:01 GMT
i installed "vlc-nighty" vlc-2.1.0-20130107-0014 from the aur and there is no problem with wmv files
https://aur.archlinux.org/packages/vlc-nightly
Comment by George Angelopoulos (l4than-d3vers) - Thursday, 21 March 2013, 13:29 GMT
Interesting. I installed vlc-2.1.0-20130107-0014 and while there's an improvement in the sound (less noise) it still doesn't sound right.
Comment by Joseph Freeman (jfree143dev) - Thursday, 21 March 2013, 13:49 GMT
I just tried the nightly vlc and it definitely sounds better than the regular VLC (2.0.5-4), but it seems that the audio is out of sync and glitchy.

Here's the stream I tested:
http://www.arirang.co.kr/Player/Live_Radio.asx

Previously it sounded like the attachment in the following comment:
https://bugs.archlinux.org/task/33833#comment107355

I attached some audio of how it sounds now.
   mms-bad.ogg (468.3 KiB)
Comment by Christian (ubuntubang) - Thursday, 21 March 2013, 13:58 GMT
yeah I confirm with Joseph. The really nasty noise is gone but there is still something wrong with the sound.
I tested the windows media file from here: http://archive.org/details/Windows7WildlifeSampleVideo
Comment by Ionut Biru (wonder) - Thursday, 21 March 2013, 14:53 GMT
if master somehow works, please find out the commits that fixes this issue.
i'm not using vlc and i don't even know why i was assigned to this ticket.
Comment by Christian (ubuntubang) - Thursday, 21 March 2013, 15:45 GMT
then please resolve the responsibility for this ticket internally if you do not feel responsible yourself

this is a major issue for a major application which is know for about a month
Comment by Ionut Biru (wonder) - Thursday, 21 March 2013, 15:56 GMT
@Giovanni please do not assign this ticket to me anymore. it's a bug in vlc and not ffmpeg.
Comment by John (graysky) - Saturday, 23 March 2013, 10:53 GMT
Upstream claims the problem is not in vlc: https://trac.videolan.org/vlc/ticket/8260

"Changed 3 weeks ago by courmisch

Status changed from new to closed
Resolution set to notvlc
ELL_PART... works fine here with both VLC versions 2.0.5 and 2.1.0. Must be a problem with your system's libav or FFmpeg."
Comment by arch user (archuser474747) - Saturday, 23 March 2013, 14:56 GMT
Just installed libav 9.2-1 from the aur (pacman threw up a conflict with ffmpeg, which I removed) and the problem still persists.

Comment by Alexander Kaltsas (firewalker) - Saturday, 23 March 2013, 17:32 GMT
I succesfully bisected ffmpeg (n1.0.6 to n1.1). The results.

7ebfe5b44a55d7f2c510e6aaeaf767319c786b60 is the first bad commit
commit 7ebfe5b44a55d7f2c510e6aaeaf767319c786b60
Author: Justin Ruggles <justin.ruggles@gmail.com>
Date: Tue Aug 28 23:12:49 2012 -0400

wmadec: use float planar sample format output

:040000 040000 c828c1e7f0a8aa91eec2d01e37fb0e31f2592ca1 898f523b2f831eacdb3ec569178497cba474c309 M libavcodec


http://paste.lisp.org/display/136254
Comment by Micheal (mb) - Wednesday, 27 March 2013, 21:21 GMT
All my porn plays with static :) What does comment by Alexander mean? Is there something I can try with ffmpeg to fix the static issue?
Comment by arch user (archuser474747) - Wednesday, 27 March 2013, 22:30 GMT
problem persists in vlc-2.0.5-5
Comment by Eric Liang (etlgfx) - Thursday, 28 March 2013, 03:20 GMT
confirmed same problem in vlc-2.0.5-5. I also tried the ffmpeg-1:1.2-1 package in testing right now, same result.
Comment by John (graysky) - Thursday, 28 March 2013, 22:59 GMT
I took the advice of one of the vlc developers and built the 2.0-git version (currently 2.0.6-pre) and am happy to report that the static has gone away... the problem now is a horrible echo effect instead :(

Link to the AUR PKGBUILD I spun-up: https://aur.archlinux.org/packages/vlc-stable-git
Link to discussion thread in the vlc forums: http://forum.videolan.org/viewtopic.php?f=13&t=109402

EDIT: It appears the building 2.1-git solves this problem for me. The PKGBUILD for vlc-git is jacked-up in the AUR. Here is a functional one: https://gist.github.com/graysky2/5072045

Can someone else please verify that this indeed solves the static problem?
Comment by Joseph Freeman (jfree143dev) - Friday, 29 March 2013, 12:59 GMT
@graysky
First I tried the vlc-git AUR build without your PKGBUILD changes. The stream I played had a little bit of static.

Next I tried the same build but with your changes and there was no static at all. BTW, in the PKGBUILD it should be 'install=vlc-git.install' not 'install=vlc.install'.

Here's the stream I tried (Korean):
mms://mbclive.andong.com/am_live
Comment by arch user (archuser474747) - Friday, 29 March 2013, 13:03 GMT
well done mate!

confirming the problem is fixed with graysky's github PKGBUILD link and the .install file in either his vlc-stable-git or the existing vlc-git AUR packages (which have the same contents).

wmv audio is fine, and I also played some avi, mpeg, mp4 and mp3 files for a sanity check. all fine.

while playing wmv these messages are now seen:
[wmv3 @ 0x7fcf04c62040] Bits overconsumption: 61312 > 61304
[wmv3 @ 0x7fcf04c62040] concealing 764 DC, 764 AC, 764 MV errors in I frame
[wmv3 @ 0x7fcf04c62040] Bits overconsumption: 3256 > 3248
[wmv3 @ 0x7fcf04c62040] concealing 1296 DC, 1296 AC, 1296 MV errors in I frame
[wmv3 @ 0x7fcf04c62040] Bits overconsumption: 32 > 24
[wmv3 @ 0x7fcf04c62040] concealing 1296 DC, 1296 AC, 1296 MV errors in I frame

instead of the old lines:
[wmav2 @ 0x7f06d4c4e2e0] output buffer size is too small for the current frame (192000 < 245760)
[wmav2 @ 0x7f06d4c4e2e0] output buffer size is too small for the current frame (192000 < 196608)

so good to have vlc working fully again!
Comment by John (graysky) - Friday, 29 March 2013, 18:33 GMT
OK, so using 2.1-git fixes this but what is causing the bug? 2.0.6 is not out yet (7 weeks behind schedule) so 2.1 is quite a ways off. Many users will not want to build the git package so the root cause should be identified and fixed.
Comment by Joseph Freeman (jfree143dev) - Saturday, 30 March 2013, 03:54 GMT
The following two commits in the Git master stream appear to be the fix for the audio problems. I'm not sure how to apply them to VLC 2.0.

This one is from Dec 30, 2012 and fixes the terrible static sound:
http://git.videolan.org/?p=vlc.git&a=commit&h=99ab06c7ffe189e81118f6122b1661c6c7af033c

This one is from the Jan 10, 2013 and fixes the glitchy sound:
http://git.videolan.org/?p=vlc.git&a=commit&h=160e651e28805cfe4d1f2d4295a58e5c4e1b7370

In order to compile VLC at these commit points I had to use the following cherry picked commits:
git cherry-pick 6b2595e68890e5db1b7334098b6f722e2f41a6d8 dc647fe5d1a089adc5e54d04d6df2c60f8d4da35 a92d777d0b430070ebc6aff422aec622323a59bf 062b886122287d8ad3ec93b3faa59808d2b1e9c7 0babd21eadc353496df7a03d76063a4124539d5c cde81e52f2d6e17383aced57fe6312eafa79cacf adda59578c429e26d41e645a54aede1296f3bb46 620da47221e5bf30cbffb1a591268e6b1a5edea8 d9e90b4d925a09506407a6c0300213d3f7149658
Comment by John (graysky) - Monday, 01 April 2013, 19:40 GMT
Upstream as repoened the bug report I opened. I think it's safe to conclude that this is not an Arch problem.

Link to forum post: http://forum.videolan.org/viewtopic.php?f=13&t=109402
Link to upstream bug report: https://trac.videolan.org/vlc/ticket/8260
Comment by John (graysky) - Monday, 01 April 2013, 19:50 GMT
Yes, I can confirm the fix against the 2.0-git. Is it worth patching 2.0.5 with the fix or just waiting for 2.0.6?
Comment by Joseph Freeman (jfree143dev) - Monday, 01 April 2013, 20:16 GMT
Just tried it here using the vlc-stable-git PKGBUILD and the sound is nice and crisp. Great job!

Loading...