Im trying to watch twitch.tv streams with omxplayer and livestreamer. Running the Pi Foundation raspian. I got it working, there is just a little problem with the sound:

command I am using:

livestreamer twitch.tv/$PUTGAMECHANNELHERE best -np omxplayer

It does the job really well - except the fact that sound is not being send to hdmi!

I think that the problem is omxplayer! By default when i play a video with omxplayer there is no sound on hdmi. But after setting an alias (alias omxplayer='omxplayer --adev hdmi') it does work and i can hear sound via hdmi.

The Problem is that the alias doesnt seem to work when using omxplayer with livestreamer. Also i cannot set the -o hdmi parameter to the livestreamer start command (livestreamer twitch.tv/$PUTGAMECHANNELHERE best -np omxplayer -o hdmi doesnt work).

Any Solutions?


The alias does not work for 1 or 2 reasons. The 1st is that aliases are not expanded by default for non-interactive shells. The 2nd is that the alias may not even be defined for non-interactive shells, depending on where you defined the alias (stuff in "bashrc" files is never loaded for non-interactive shells).

If the alias is defined (eg, because it is in an applicable "profile" file), then you can set:

shopt -s expand_aliases

to use all defined aliases in non-interactive shells. Doing that in general is probably not desirable, so one idea is to put all this together in a script:

alias omxplayer='omxplayer -o hdmi'
shopt -s expand_aliases 
livestreamer twitch.tv/$PUTGAMECHANNELHERE best -np omxplayer

And execute that.


You might first try just quoting the argument to livestreamer:

-np "omxplayer -o hdmi"

To see if that works, which is probably a better solution than relying on an alias.

  • thx - quoting did the job! it works with: livestreamer twitch.tv/$PUTGAMECHANNELHERE best -np 'omxplayer -o hdmi'
    – jalu
    Mar 24 '13 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.