Raspberry Pi & omxplayer: have a nice day

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....
Post Reply
User avatar
^rooker
Site Admin
Posts: 1483
Joined: Fri Aug 29, 2003 8:39 pm

Raspberry Pi & omxplayer: have a nice day

Post by ^rooker »

[PROBLEM]
My new Raspberry Pi is running like a charm - and I love it! (got it connected to an old CRT TV screen, and the image feels so C64-like...)

Unfortunately, when trying to playback an audio file (e.g. MP3), omxplayer outputs the container/codec information and then exits, wishing me a nice day.

I'm starting omxplayer with "-o local" to use the analog 3.5mm audio jack (instead of HDMI) as output:

Code: Select all

$ omxplayer -o local song.mp3
returns:
file : song.mp3 result 0 format mp3 audio streams 1 video streams 0 chapters 0 subtitles 0

have a nice day ;)
There's a logfile dumped right in the folder where I started omxplayer. The file's called "omxplayer.log", and in my case contains the following messages:
00:00:00 T:0 DEBUG: DllBcm: Using omx system library
00:00:00 T:0 DEBUG: DllOMX: Using omx system library
00:00:00 T:0 DEBUG: DllAvFormat: Using libavformat system library
00:00:00 T:0 DEBUG: DllAvUtilBase: Using libavutil system library
00:00:00 T:0 DEBUG: DllAvCodec: Using libavcodec system library
00:00:00 T:0 DEBUG: DllAvFormat: Using libavformat system library
00:00:00 T:0 DEBUG: DllOMX: Using omx system library
00:00:00 T:0 ERROR: COMXCoreComponent::Initialize - could not get component handle for OMX.broadcom.clock omx_err(0x80001000)
I haven't resolved this issue yet, but I've found related posts in the Raspberry Pi forums (1)(2), which both mention a misconfigured memory split (how much RAM the GPU gets) causing the problem.

I did reduce my GPU memory to 16 MB, because I'm using my Raspberry as a headless server. However, increasing the memory split to 64 MB, omxplayer got a little further, and wrote the following to the omxplayer.log file:
00:00:00 T:0 DEBUG: DllBcm: Using omx system library
00:00:00 T:0 DEBUG: DllOMX: Using omx system library
00:00:00 T:0 DEBUG: DllAvFormat: Using libavformat system library
00:00:00 T:0 DEBUG: DllAvUtilBase: Using libavutil system library
00:00:00 T:0 DEBUG: DllAvCodec: Using libavcodec system library
00:00:00 T:0 DEBUG: DllAvFormat: Using libavformat system library
00:00:00 T:0 DEBUG: DllOMX: Using omx system library
00:00:00 T:0 DEBUG: COMXCoreComponent::Initialize OMX.broadcom.clock input port 80 output port 81
00:00:00 T:0 DEBUG: DllAvUtilBase: Using libavutil system library
00:00:00 T:0 DEBUG: DllAvCodec: Using libavcodec system library
00:00:00 T:0 DEBUG: DllAvFormat: Using libavformat system library
00:00:00 T:0 DEBUG: DllAvUtilBase: Using libavutil system library
00:00:00 T:0 DEBUG: DllAvCodec: Using libavcodec system library
00:00:00 T:0 INFO: COMXAudioCodecOMX::GetChannelMap - FFmpeg reported 2 channels, but the layout contains 0 ignoring
00:00:00 T:0 DEBUG: DllOMX: Using omx system library
00:00:00 T:0 DEBUG: Previous line repeats 2 times.
00:00:00 T:0 DEBUG: COMXAudio::HWDecode CODEC_ID_MP2 / CODEC_ID_MP3
00:00:00 T:0 DEBUG: COMXAudio::CanHWDecode OMX_AUDIO_CodingMP3
00:00:00 T:0 DEBUG: DllAvUtilBase: Using libavutil system library
00:00:00 T:0 INFO: CPCMRemap: I channel map: FL,FR
00:00:00 T:0 DEBUG: pcm->nPortIndex : 0
00:00:00 T:0 DEBUG: pcm->eNumData : 0
00:00:00 T:0 DEBUG: pcm->eEndian : 1
00:00:00 T:0 DEBUG: pcm->bInterleaved : 1
00:00:00 T:0 DEBUG: pcm->nBitPerSample : 16
00:00:00 T:0 DEBUG: pcm->ePCMMode : 0
00:00:00 T:0 DEBUG: pcm->nChannels : 2
00:00:00 T:0 DEBUG: pcm->nSamplingRate : 44100
00:00:00 T:0 DEBUG: OMX_AUDIO_ChannelLF
00:00:00 T:0 DEBUG: OMX_AUDIO_ChannelRF
00:00:00 T:0 DEBUG: pcm->nPortIndex : 0
00:00:00 T:0 DEBUG: pcm->eNumData : 0
00:00:00 T:0 DEBUG: pcm->eEndian : 1
00:00:00 T:0 DEBUG: pcm->bInterleaved : 1
00:00:00 T:0 DEBUG: pcm->nBitPerSample : 16
00:00:00 T:0 DEBUG: pcm->ePCMMode : 0
00:00:00 T:0 DEBUG: pcm->nChannels : 2
00:00:00 T:0 DEBUG: pcm->nSamplingRate : 44100
00:00:00 T:0 DEBUG: OMX_AUDIO_ChannelLF
00:00:00 T:0 DEBUG: OMX_AUDIO_ChannelRF
00:00:00 T:0 DEBUG: DllOMX: Using omx system library
00:00:00 T:0 DEBUG: COMXCoreComponent::Initialize OMX.broadcom.audio_render input port 100 output port 100
00:00:00 T:0 DEBUG: DllOMX: Using omx system library
00:00:00 T:0 DEBUG: COMXCoreComponent::Initialize OMX.broadcom.audio_decode input port 120 output port 121
00:00:00 T:0 DEBUG: DllOMX: Using omx system library
00:00:00 T:0 DEBUG: COMXCoreComponent::Initialize OMX.broadcom.audio_mixer input port 232 output port 231
00:00:00 T:0 DEBUG: COMXCoreComponent::AllocInputBuffers component(OMX.broadcom.audio_decode) - port(120), nBufferCountMin(4), nBufferCountActual(57), nBufferSize(6144), nBufferAlignmen(16)
00:00:00 T:0 ERROR: COMXCoreComponent::DecoderEventHandler OMX.broadcom.audio_decode - OMX_EventError detected, nData1(0x80001019), port 1
00:00:00 T:0 ERROR: COMXCoreComponent::AllocInputBuffers component(OMX.broadcom.audio_decode) - OMX_UseBuffer failed with omx_err(0x80001018)
00:00:00 T:0 ERROR: COMXAudio::Initialize - Error alloc buffers 0x80001018
00:00:00 T:0 ERROR: COMXCoreComponent::WaitForCommand OMX.broadcom.audio_decode wait timeout event.eEvent 0x00000000 event.command 0x00000002 event.nData2 120
[SOLUTION]
The first error in the log was actually caused by reducing the GPU ram to 16 MB. Increasing it to 64 MB solved it.
The second (looooong) log output was actually, because I've ran omxplayer with "-w" (=hardware audio decoding) that time.

Removing the "-w", and calling omxplayer like mentioned at the beginning of this post, solved the problem: Audio output working fine! :)
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply