Solved Mpeg 2 files fail to play with adsp enabled
#1
Problem - mpeg 2 video files (MakeMKV DVD rips, SD trailers from demo-world.eu, etc.) fail to play when adsp is enabled on a Raspberry Pi 2, but playback perfectly with adsp disabled. These are files with mpeg 2 video and ac3 audio in MKV, VOB or M2TS containers. OMX doesn't play the video stream, the audio steam is played with adsp. MMAL causes a crash. These video file playback perfectly on a Mac with kodi 16.1 and adsp.basic enabled. You can get a sample to test from here

Setup - Raspberry Pi 2 running LibreELEC 7.0.1, adsp enabled with adsp.basic filter. mpeg 2 licence not purchased.

Debug log -
OMX - http://sprunge.us/IJGe
MMAL - http://sprunge.us/HXRO
Reply
#2
What do you mean with fail? Does Kodi crash?

Can you please try it without active Audio DSP add-ons.
Latest news about AudioDSP and my libraries is available on Twitter.

Developers can follow me on Github.
Reply
#3
I think my post wasn't clear, so I'll clarify.
By fail, I mean that the files don't play like they should. The results vary depending on the Hardware Acceleration options I choose - OMX or MMAL. MMAL causes kodi to crash, OMX plays only the audio, without video.

As I said in the previous post, with adsp addons disabled, the videos playback perfectly on the pi. These are all 480p or 576p mpeg2 videos. These issues do not occur with h.264/mp4 files.

UPDATE - read next post
Reply
#4
I did some quick testing and I found something interesting -
It appears Kodi crashes when software decoding is used along with Audio DSP addons.

I forced the software decoder by disabling both MMAL and OMX. Playing any file (h.264, mpeg2, etc.) like this while Audio DSP is enabled causes a crash, while with Audio DSP disabled the files play perfectly.

Maybe Audio DSP is doing something wrong when software decoding is used?

btw, I love Audio DSP, I use adsp.basic to downmix 5.1 sources to Dolby ProLogic II, and when it works it is brilliant.
Reply
#5
A master build with ADSP enabled (but no options chosen) crashes for me with. With MMAL:
Code:
Program terminated with signal SIGSEGV, Segmentation fault.
#0  ActiveAE::CActiveAEDSPProcess::Process (this=0x746395b0, in=0x74639b18, in@entry=0x746824e0, out=0x1) at DSPAddons/ActiveAEDSPProcess.cpp:1423
1423    DSPAddons/ActiveAEDSPProcess.cpp: No such file or directory.
(gdb) bt
#0  ActiveAE::CActiveAEDSPProcess::Process (this=0x746395b0, in=0x74639b18, in@entry=0x746824e0, out=0x1) at DSPAddons/ActiveAEDSPProcess.cpp:1423
#1  0x008424b4 in ActiveAE::CActiveAEBufferPoolResample::ResampleBuffers (this=0x746458f8, timestamp=<optimized out>) at Engines/ActiveAE/ActiveAEBuffer.cpp:439
#2  0x00831c00 in ActiveAE::CActiveAE::RunStages (this=0x74600010, this@entry=0x4d272e0) at Engines/ActiveAE/ActiveAE.cpp:1856
#3  0x00833fa4 in ActiveAE::CActiveAE::StateMachine (this=this@entry=0x4d272e0, signal=signal@entry=22, port=port@entry=0x0, msg=<optimized out>) at Engines/ActiveAE/ActiveAE.cpp:923
#4  0x008343f8 in ActiveAE::CActiveAE::Process (this=0x4d272e0) at Engines/ActiveAE/ActiveAE.cpp:1044
#5  0x019fcf08 in CThread::Action (this=0x4d272e8) at Thread.cpp:221
#6  0x019fd1a4 in CThread::staticThread (data=0x4d272e8) at Thread.cpp:131
#7  0x76e4ce90 in start_thread (arg=0x74f6c410) at pthread_create.c:311

With software decode:
Code:
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x016a1cb0 in conv_AV_SAMPLE_FMT_FLT_to_AV_SAMPLE_FMT_FLT (po=0x326b71c9 <error: Cannot access memory at address 0x326b71c9>, pi=0x5e712cdc "N\374\231\067\277Tz7^", is=4, os=4,
    end=0x326b9749 <error: Cannot access memory at address 0x326b9749>) at libswresample/audioconvert.c:72
72    libswresample/audioconvert.c: No such file or directory.
(gdb) bt
#0  0x016a1cb0 in conv_AV_SAMPLE_FMT_FLT_to_AV_SAMPLE_FMT_FLT (po=0x326b71c9 <error: Cannot access memory at address 0x326b71c9>, pi=0x5e712cdc "N\374\231\067\277Tz7^", is=4, os=4,
    end=0x326b9749 <error: Cannot access memory at address 0x326b9749>) at libswresample/audioconvert.c:72
#1  0x016a27f0 in swri_audio_convert (ctx=0x74533c60, out=out@entry=0x5e7c230c, in=in@entry=0x74500010, len=len@entry=2400) at libswresample/audioconvert.c:222
#2  0x016a0a48 in swr_convert_internal (in_count=2400, in=0x5e7c1eac, out_count=2400, out=0x5e7c230c, s=0x5e7bf330) at libswresample/swresample.c:571
#3  swr_convert (s=0x5e7bf330, out_arg=<optimized out>, out_count=<optimized out>, in_arg=<optimized out>, in_count=<optimized out>) at libswresample/swresample.c:789
#4  0x0085c46c in ActiveAE::CActiveAEDSPProcess::Process (this=0x68efd478, in=0x68efd9e0, in@entry=0x74547268, out=0x0) at DSPAddons/ActiveAEDSPProcess.cpp:1418
#5  0x008424b4 in ActiveAE::CActiveAEBufferPoolResample::ResampleBuffers (this=0x7453ca50, timestamp=<optimized out>) at Engines/ActiveAE/ActiveAEBuffer.cpp:439
#6  0x00831c00 in ActiveAE::CActiveAE::RunStages (this=0xffffffff, this@entry=0x39412e0) at Engines/ActiveAE/ActiveAE.cpp:1856
#7  0x00833fa4 in ActiveAE::CActiveAE::StateMachine (this=this@entry=0x39412e0, signal=signal@entry=22, port=port@entry=0x0, msg=<optimized out>) at Engines/ActiveAE/ActiveAE.cpp:923
#8  0x008343f8 in ActiveAE::CActiveAE::Process (this=0x39412e0) at Engines/ActiveAE/ActiveAE.cpp:1044
#9  0x019fcf08 in CThread::Action (this=0x39412e8) at Thread.cpp:221
#10 0x019fd1a4 in CThread::staticThread (data=0x39412e8) at Thread.cpp:131
#11 0x76ddbe90 in start_thread (arg=0x74efb410) at pthread_create.c:311

ADSP will never work with omxplayer acceleration - there is no Audio Engine in that case.
Reply
#6
@sireesh
Currently I don't know why it fails. Sorry I don't use an Raspberry Pi and I'm not able to develop or fix issues on this platform.
Latest news about AudioDSP and my libraries is available on Twitter.

Developers can follow me on Github.
Reply
#7
@wisler, thanks for your response.
Maybe you could forward this to one of the devs who work on the pi?
Reply
#8
I already did this, but I don't know if he has the time to fix it.
Latest news about AudioDSP and my libraries is available on Twitter.

Developers can follow me on Github.
Reply
#9
There is no evidence this is in any Pi specific code.
I don't know this code and wouldn't easily be able to debug it.
Reply
#10
I was able to run the same mpeg2 files with Kodi 16.1 on OS X, with adsp.basic active. They worked as expected. Hardware acceleration of mpeg2 is not possible on OS X. So it is probably a Raspberry Pi specific issue.
Reply
#11
Are you able to play video files without a crash of Kodi on your RPi when AudioDSP is enables?
My RPi2 crashes regardless which add-on I enable or disbale...
Latest news about AudioDSP and my libraries is available on Twitter.

Developers can follow me on Github.
Reply
#12
Hi sireesh,

I try to solve the issue, but currently video frames are dropped but Kodi doesn't crash.

If you want you can follow the conversion here.

But I don't know if we can backport this to Jarvis. You might have to use Krypton after this fix went in.
Latest news about AudioDSP and my libraries is available on Twitter.

Developers can follow me on Github.
Reply
#13
Hi siresh,

after a long journy I fixed most of the issues on RPi. It works now here and others started to integrate my commits into RPi testbuilds for OSMC and LibreELEC. If they did it well it should workBlush
Latest news about AudioDSP and my libraries is available on Twitter.

Developers can follow me on Github.
Reply
#14
(2016-06-21, 19:37)wisler Wrote: after a long journy I fixed most of the issues on RPi. It works now here and others started to integrate my commits into RPi testbuilds for OSMC and LibreELEC. If they did it well it should workBlush

Try this build (or a later one):
http://forum.kodi.tv/showthread.php?tid=...pid2361740
Reply
#15
Thanks,
Great to see this is fixed!
Reply

Logout Mark Read Team Forum Stats Members Help
Mpeg 2 files fail to play with adsp enabled0