adenin
Posts: 16
Joined: Fri Jul 06, 2012 7:01 am

internet radio with omxplayer & lirc

Sat Aug 11, 2012 9:56 pm

Hello,

I have successfully started lirc, and
using omxplayer I control switching between internet radio stations;

.lircrc is like this:

Code: Select all

begin
    prog = irexec
    button = 1
    config = /home/pi/pripKillOmx; omxplayer http://live.slovakradio.sk:8000/Slovensko_128.mp3 &
end
begin
    prog = irexec
    button = 2
    config =  /home/pi/pripKillOmx;omxplayer http://live.slovakradio.sk:8000/Litera_128.mp3 &
end
where
pripKillOmx is:

Code: Select all

a=$(ps ax|grep omxplayer.bin|grep -v grep|awk '{print $1}');  if [ -z "$a" ] ; then echo ". "; else kill -9 $a; fi

it is the first idea I had which works,
but starting omxplayer each time I switch rado station produces popping sound,
and I think it is not really the right way how to use it ...but I am not expert ...can anybody help?

thanks

jose1711_
Posts: 58
Joined: Sat Jul 21, 2012 10:03 am

Re: internet radio with omxplayer & lirc

Sat Aug 11, 2012 10:12 pm

heh, it's good to see here someone from my country :-) maybe not really a solution, but would muting the output just before killing the process help? also pkill -9 omxplayer.bin might be more readable than those awk's and grep's. jose

adenin
Posts: 16
Joined: Fri Jul 06, 2012 7:01 am

Re: internet radio with omxplayer & lirc

Sun Aug 12, 2012 12:43 pm

Hello,

thanks for that pkill,

muting looks as not easy task, because omxplayer does not use default alsa
driver;

for example when I start

Code: Select all

mpc play 1
mpc stop
Using

Code: Select all

dmesg|tail
I can find lines like these:

Code: Select all

[104714.659179] snd_bcm2835_playback_open:97 Alsa open (0)
[104741.609760] snd_bcm2835_playback_close:167 Alsa close
but omxplayer does not make such entries and therefore alsamixer can not control
volume when using omxplayer

Return to “Media centres”