okieng
Posts: 14
Joined: Thu Apr 18, 2013 4:06 pm

omxplayer bad audio quality

Wed May 22, 2013 1:04 pm

Hi,
I have live stream and mp4 video.
Live stream is H264 video/ MPEG Audio.
I am receiving stream with omxplayer w/o any problem.

mp4 video ise same video codec but different audio codec .( MPEG AAC mp4a )
When i tried play omxplayer audio has distortion. I barely hear audio. Poor audio quality.

Looks like mpeg aac audio codec is not working.
Do you have any idea how i can fix this problem.

Thanks
Oki

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5161
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: omxplayer bad audio quality

Wed May 22, 2013 1:18 pm

Is audio quality okay when played from a local file with a different codec?

Can you capture a sample file (e.g. 200MB) with the bad audio, and post it somewhere?

gkreidl
Posts: 5730
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: omxplayer bad audio quality

Wed May 22, 2013 1:56 pm

dom wrote:Is audio quality okay when played from a local file with a different codec?

Can you capture a sample file (e.g. 200MB) with the bad audio, and post it somewhere?
@dom:

may I remind you of the broken flac support (since version of 04/21)?
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

bartender
Posts: 42
Joined: Wed Sep 26, 2012 8:19 pm

Re: omxplayer bad audio quality

Sat Jun 08, 2013 8:39 am

mp4a isn't flac, is it?
I also have this annoying problem.

bartender
Posts: 42
Joined: Wed Sep 26, 2012 8:19 pm

Re: omxplayer bad audio quality

Sat Jun 08, 2013 8:51 am

I uploaded a sample: http://vault.xtsubasa.org/omx_sample.mp4 (65 M)

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5161
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: omxplayer bad audio quality

Sat Jun 08, 2013 10:41 pm

bartender wrote:I uploaded a sample: http://vault.xtsubasa.org/omx_sample.mp4 (65 M)
Sample plays fine for me.
I was testing with this version of omxplayer:
https://github.com/popcornmix/omxplayer/commits/master

Are you able to build from source?

bartender
Posts: 42
Joined: Wed Sep 26, 2012 8:19 pm

Re: omxplayer bad audio quality

Sun Jun 09, 2013 7:04 am

dom wrote:Are you able to build from source?
No. "make ffmpeg" throws this error:

Code: Select all

arm-unknown-linux-gnueabi-gcc is unable to create an executable file.
C compiler test failed.

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
[email protected] mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solving the problem.
make[1]: *** [configure] Error 1
make[1]: Leaving directory `/home/rondo/omxplayer'
make: *** [ffmpeg] Error 2
Running "make" throws:

Code: Select all

make: /opt/xbmc-bcm/buildroot/output/host/usr//bin/arm-unknown-linux-gnueabi-g++: Command not found
make: *** [linux/XMemUtils.o] Error 127
Also, 2 more questions:
1. How do we build Arch package from it?
2. This is a forked omxplayer, why was it forked?


dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5161
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: omxplayer bad audio quality

Sun Jun 09, 2013 11:15 am

bartender wrote:2. This is a forked omxplayer, why was it forked?
Because the original author is no longer working on it, and although I have write access to his repo, it feels easier making substantial changes in my own area.

bartender
Posts: 42
Joined: Wed Sep 26, 2012 8:19 pm

Re: omxplayer bad audio quality

Sun Jun 09, 2013 1:00 pm

This one won't do, it's exactly what I built originally (and sound was bad).

drirr
Posts: 54
Joined: Sun Sep 09, 2012 8:06 am

Re: omxplayer bad audio quality

Mon Jun 10, 2013 4:51 pm

bartender wrote:
This one won't do, it's exactly what I built originally (and sound was bad).
Just edit the PKGBUILD to point at the other repository and run makepkg.
Raspberry Pi (rev 000f, 512MB RAM) with heatsinks and a modmypi case running Arch Linux ARM (armv6h) hooked up to a 750GB 2.5" USB-harddrive

bartender
Posts: 42
Joined: Wed Sep 26, 2012 8:19 pm

Re: omxplayer bad audio quality

Mon Jun 10, 2013 6:09 pm

drirr wrote:Just edit the PKGBUILD to point at the other repository and run makepkg.
Changed PKGBUILD, built it, now I have a core dump after running omxplayer with the sample above.

h8h
Posts: 3
Joined: Thu Jul 11, 2013 2:38 pm

Re: omxplayer bad audio quality

Thu Jul 11, 2013 3:19 pm

I can compile it and it works (even audio) :), its a dirty way, but if you know a better way, tell me ... ;)

Code: Select all

git clone https://github.com/popcornmix/omxplayer.git
cd omxplayer
Deps (same as omxplayer):
  • fbset
    ffmpeg
    ffmpeg-compat
    freetype2
    pcre
    rtmpdump
In File Makefile:
Add to CFLAGS: -lfreetype
Add to LDFLAGS: -L/opt/vc/lib
Add to INCLUDES: -I/opt/vc/lib -I/usr/include/freetype2

Remove cp -a ffmpeg_compiled/usr/local/lib/*.so* $(DIST)/usr/lib/omxplayer/ in Target 'dist' ~ Line 69

In File Makefile.include:
Set USE_BUILDROOT=0 (Line 1)
Remove Variable CC and CXX (Line ~ 27 / 28)

In File gen_version.sh delete all \n characters, because they failed :) and every new echo makes automatically a new line.

At least the quick and dirty step:
Thanks to http://kittyhawkrpi.blogspot.de/2012/10 ... linux.html btw.

Code: Select all

ln -s /opt/vc/include/interface/vcos/pthreads/vcos_futex_mutex.h /opt/vc/include/interface/vcos/
ln -s /opt/vc/include/interface/vcos/pthreads/vcos_platform.h /opt/vc/include/interface/vcos/
ln -s /opt/vc/include/interface/vcos/pthreads/vcos_platform_types.h /opt/vc/include/interface/vcos/
ln -s /opt/vc/include/interface/vmcs_host/linux/vchost_config.h /opt/vc/include/interface/vmcs_host/
ok lets go :)

Code: Select all

make
make dist
# Create new fonts path
# If you're too lazy to change the omxplayer script, create the font path

Code: Select all

mkdir -p /usr/share/fonts/truetype/freefont
cp fonts/* /usr/share/fonts/truetype/freefont
Copy over omxplayer-dist/* to the Pi /

If you can even compile it, with this hack, please tell me and i create a package on aur.

Antario
Posts: 19
Joined: Sat Jan 14, 2012 12:02 am

Re: omxplayer bad audio quality

Thu Jul 18, 2013 8:53 pm

Hi! I have been able to compile it, though I needed to add -I/opt/vc/include to the INCLUDES in the Makefile, but unfortunately the audio still doesn't work properly for me. :(

Edit: I can't even compile the b0143ac0 revision (huceke) now, which I could in the past. Now it quits with an error saying that gcc was unable to create an executable file.

Edit2: I compiled from https://github.com/popcornmix/omxplayer again, but omxplayer crashes after starting, even if no argument is passed. (Blank screen, I guess it is something with the framebuffer.)

h8h
Posts: 3
Joined: Thu Jul 11, 2013 2:38 pm

Re: omxplayer bad audio quality

Fri Jul 19, 2013 5:08 pm

Have you tried to start omxplayer with -g (--genlog generate log file)? Generates it any logs?

Which pi distro did you use?

Antario
Posts: 19
Joined: Sat Jan 14, 2012 12:02 am

Re: omxplayer bad audio quality

Sat Jul 20, 2013 1:36 pm

Hi h8h!
Unfortunately it didn't generate a log file. I use ArchLinux with the latest firmware, kernel version 3.6.11-13 and gcc version 4.7.2.

h8h
Posts: 3
Joined: Thu Jul 11, 2013 2:38 pm

Re: omxplayer bad audio quality

Sun Jul 21, 2013 8:21 am

Ok ... thats bad :?

Could you please try to rebuild the omxplayer.bin with

Code: Select all

make omxplayer.bin
Then use the omxplayer script in the same directory (./omxplayer) and try to start omxplayer. Which video source did you use hdmi or rca?

brunorro
Posts: 2
Joined: Thu Sep 13, 2012 9:10 am

Re: omxplayer bad audio quality

Sun Jul 21, 2013 9:33 am

Hi !

I hope my contribution won't be useless. A week ago I was able to compile omxplayer the way you said here, but there were some details. Unfortunately my history didn't show me all what I did, but, let me remember...

By the way, I also had one more dependency. Right now I can't remember if it was only boost or both boost and boost-libs, but right now I have both of them installed:

Code: Select all

boost
boost-libs
Also, I slightly changed INCLUDES Makefile line in order to add /opt/vc/include directory, it looks like this:

Code: Select all

INCLUDES+=-I/opt/vc/lib -I/opt/vc/include -I/usr/include/freetype2 -I./ -Ilinux -Iffmpeg_compiled/usr/local/include/
It worked. I know it's probably a stupid thing to say because everybody here changed before, but ... it worked :P

Antario
Posts: 19
Joined: Sat Jan 14, 2012 12:02 am

Re: omxplayer bad audio quality

Thu Jul 25, 2013 2:16 pm

Hi everyone!

I compiled it again. This time when I run omxplayer as the regular user, it displays an error for a split second (a path, I think something with "vc" and a Permission denied at the end) and it crashes with a black, blank screen.
If I run it with sudo, it doesn't crash, but curiously changes back the terminal font to default after exit (I have a custom font set up). It works like this, though, plays video without audio distortion. :)

I compiled it differently this time, I edited the prepare-native-raspbian.sh script by deleting everything after this echo inside the script:

Code: Select all

echo "
install: dist
      cp omxplayer-dist/* / -r" >> Makefile
I could do this, since the last few commands were mostly ones concerning the unneded rpi-config script and a pushd command to patch gcc and g++ with gcc version 4.7.2 which is unneeded in Arch.
Afterwards I ran it with:

Code: Select all

$ ./prepare-native-raspbian.sh
Then $ make. If $ ./omxplayer works, you can $ make dist and copy the contents of omxplayer-dist over / (root permissions needed this time, of course).

Any idea about what's wrong with the permissions? Why can't I run omxplayer without superuser permissions?
Another curious question, but it doesn't really matter: why don't I had to compile it with $ make ffmpeg, like the huceke fork?

Cheers! :D

Antario
Posts: 19
Joined: Sat Jan 14, 2012 12:02 am

Re: omxplayer bad audio quality

Sat Jul 27, 2013 10:56 am

Hi again!

Okay, another update.
I managed to compile by editing the prepare-native-raspbian.sh script, like I said before. I found out that the permission problem lied inside the /usr/bin/omxplayer script. The echoes piped to vtconsole were the problem, so I removed those from omxplayer. I guess they were to blank the console while playing, but omxplayer now has an option, namely -blank which does exactly the same, and does it well, too.
Two problems remain, however. Subtitles doesn't show for some curious reason. (The fonts are there, everything seems perfectly fine, the .srt is in UTF-8 format, etc ... ; I didn't try with embedded, though.) The other problem is with the audio. It goes out of sync and gets a little distorted if seeked. (Even with an initial jump-to-time with the -l option.) It sounds like gargling, lol.

Any ideas?
Also, I can share the modified prepare-native-raspbian.sh (I should name it prepare-native-archlinuxarm.sh I guess) and the modified /usr/bin/omxplayer, too. Let me know if you need them. ;) (I would have shared it now anyways if I had time, but I'm in a haste.)

Cheers!

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5161
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: omxplayer bad audio quality

Sat Jul 27, 2013 2:43 pm

Antario wrote:The fonts are there, everything seems perfectly fine, the .srt is in UTF-8 format, etc ... ; I didn't try with embedded, though.)
What gpu_mem have you got? HD + subs may need more than 64M.

mcwarman
Posts: 1
Joined: Mon Jul 15, 2013 12:31 pm

Re: omxplayer bad audio quality

Tue Jul 30, 2013 8:19 pm

Firstly i would just like to say a massive thank you to all the contributors on this thread. Using a combination of all your various inputs i managed to 'make' the omxplayer from popcornmix git (Build date: 29/07/2013 22:00 CEST, Git version: 6838dfd)

I just thought i would share my experience after updating the MakeFile with changes highlighted by h8h and Antario. I ran into two errors regarding missing files during the make after looking at the LDFLAGS line i could see it was relating to them specifically:

Code: Select all

$(SDKSTAGE)/usr/lib/arm-linux-gnueabihf/libfreetype.so $(SDKSTAGE)/lib/arm-linux-gnueabihf/libz.so.1.2.7
I compared the MakeFile from the AUR package and noticed the omission of the above and the addition of the following:

Code: Select all

-lfreetype -lz
After a quick update to the script to sort out fonts and comment out vtconsole vtcon1 bind, the horrible audio quality has now disappeared. Thanks to all.
mcwarman

Antario
Posts: 19
Joined: Sat Jan 14, 2012 12:02 am

Re: omxplayer bad audio quality

Wed Jul 31, 2013 6:18 am

dom wrote:What gpu_mem have you got? HD + subs may need more than 64M.
As far as I know the RAM is dynamically allocated since a certain firmware version. Am I wrong?
Edit: OK. I checked. Dynamic RAM isn't configured for me (I didn't spend time with it, I didn't know I had to set it up), but previously I set up a 128-128 split in config.txt, so it should be fine (it was fine with the huceke version, before 2 previous firmware and kernel updates).
mcwarman wrote:Using a combination of all your various inputs i managed to 'make' the omxplayer from popcornmix git (Build date: 29/07/2013 22:00 CEST, Git version: 6838dfd)
I'm happy it worked! ;)

hojuruku
Posts: 6
Joined: Fri Mar 20, 2015 11:26 am

Re: omxplayer bad audio quality

Fri Mar 20, 2015 11:49 am

I saw this problem too and worked out what was going on.

Omxplayer needs it's own ffmpeg libs, because linux distros these days are usually bundled with a fork of ffmpeg (libav).

I attempted to build from the popcornmix github version but had some linking issues with g++4-9 from linaro under Ubuntu.
However I did manage to build neon optomized ffmpeg libs that the popcornmix omxplayer fork checks out with subversion after tweaking Makefile.ffmpeg/include.

If you are using the libav fork of the ffmpeg libs then your audio will be off. run ldd on /usr/bin/omxplayer.bin and confirm it's using the right libraries - put in /usr/lib/omxplayer.

Tweak the shell script - /usr/bin/omxplayer (LD_LIBRARY_PATH=/usr/lib/omxplayer") that comes with deb packaged nightly build version of the player and this issue will be resolved. I'm using my own Pi 2 optomized ffmpeg libs and the omxplayer from here:
http://omxplayer.sconde.net/
Also run omxplayer with LD_LIBRARY_PATH=... first on the command line. If I don't do that my audio is a mess.

I hope this helped you all find the cause of the problem. The audio isn't always decoded by the GPU - hence omxplayer is dependent on having the right library - the same library it was built against.

I've got the same issue with mate-desktop-environment needing mesa opengl-libs and breaking all the games ;_). Time to roll out gentoo and build a sabayon linux build for the Pi2 / Pi1.

pickfire
Posts: 43
Joined: Fri Dec 19, 2014 3:27 pm

Re: omxplayer bad audio quality

Sun Apr 05, 2015 6:02 am

I can't use the subtitles on omxplayer.

Return to “Arch”