Read the statement by Michael Teeuw here.
MMM-MplayerRadio
-
I tried this link on the command line:
mplayer -cache 256 -playlist http://www.surfmusik.de/m3u/magicfm,14949.m3uMplayer complains that the station is to slow. It doesn’t even start playing in my case.
It looks like mplayer has some known problems with aac.But you are right. If i use xmms2 it works.
The problem is, that xmms2 uses a totally different interface.But also some good news. I released a new version 0.0.2 which adds two volume buttons.
-
Found a hack:
You can create an own m3u file which contains this url “http://stream.laut.fm/magicfm”. This one is working fine with mplayer{ title: "Test", url: "/home/pi/test.m3u", } -
@wishmaster270 thank you for new release and maybe you think in the future to release a version with xmms2. Thanks
-
@wishmaster270 ok i will try. Thanks
-
@wishmaster270 Sorry because I still insist but now the new release is not stable he start flickering, but just this module everything else works fine. Looks like he refreshed every 5 seconds. And sometimes when he flicker he stop playing.
-
@electros
Sorry for that.
I will check it tomorrow. It is curious because I did not change anything in the backend. -
@wishmaster270 ok thanks
-
@electros I just realised that the flickering means that the module tries to switch to the sender but the mplayer process runs into an error.
Does it work if you run the command directly in the shell? -
@wishmaster270 sorry but i don’t know about what command you talk. To play that test file in mplayer from the shell?
-
@electros
mplayer -cache 256 -playlist PLAYLISTFILEI will try to reduce the flickering but I don’t think this will stop the problem of your stations not being played.
I spent the last hour to read more about Xmms2. I don’t think that I can implement an easy way to switch between the two players. One of the main problems is that Xmms2 does not provide the current stream info of the station. -
@wishmaster270 yes i know that about xmms2 but my stations don’t provide that info anyway.
Thanks for your time, if is not pssible that it. Thank you -
Hi,
gave it a new try today. But i can`t get xmms2 to run on my pi. Looks like the xmms alsa plugin has some problems with my HifiBerry.
Also tried omxplayer but it has problems with internet streams. -
@wishmaster270 Thank you for you still trying
-
@wishmaster270 I installed xmms2 from " Synaptic Package Manager" and I must install all xmms2 related audio plugins before this to work. So maybe this is reason for no work.
In another way can you please show me how I can run a xxx.sh file local instead of a web link when I chose a radio station ? -
Hi,
my problem is that i messed up my audio configuration as i tried to configure pulseaudio to make it possible to play music either on my local HifiBerry speakers or on a bluetooth speaker.
Mplayer still works fine but i can`t get any sound from xmms2.
The other problem is that there are a lot of known problems of xmms2 but xmms2 is dead since 2017.
Thats why i tried omxplayer which is still maintained.Currently the module supports local playlist files but not calling any other player. You can change the binary that is called but it still sets the args as mplayer will need it.
-
@wishmaster270 Ok, I find a easy way to play a web radio with xmms2 player from a executable .sh file for that I ask you to tell me how I can run that file from your module. Now is not working my radios with mplayer.
-
It pushed a new development version to the repo.
You can change to it if you do the following commands:cd ~/MagicMirror/modules/MMM-MplayerRadio git checkout development git pullIn the new version you can add “customCommand” and “customCommandArgs” to either the whole module or to every station.
You then can use any script you like to play either all stations (by passing the url to it) or a special script for each station.Example:
{ module: "MMM-MplayerRadio", header: "Radio", position: "top_center", config: { customCommand: "/home/pi/doSomething.bash", customCommandArgs: ["one", "two", "###URL###"], stations: [ { title: "Antenne.de", url: "http://www.surfmusik.de/m3u/antenne-bayern,922.m3u", logo: "https://upload.wikimedia.org/wikipedia/commons/a/ac/Antenne-bayern-logo.png", customCommand: "/home/pi/doSomethingElse.bash", customCommandArgs: ["one", "###URL###", "three"], }, ], }, },In this example for all stations the script “/home/pi/doSomething.bash one two http://…” is called.
But “Antenne.de” uses the script “/home/pi/doSomethingElse.bash” with different args.The only condition the customCommand-Script needs to meet is that it stays active as long as the station is running and stops the playback if it gets killed.
-
@wishmaster270 Now if I put this in the config file:
{ module: "MMM-MplayerRadio", header: "Radio", position: "top_center", config: { customCommand: "", customCommandArgs: ["", "", ""], stations: [ { title: "KissFM", url: "", logo: "https://upload.wikimedia.org/wikipedia/ro/8/86/Logo_Kiss_FM.png", customCommand: "/home/pi/MagicMirror/modules/MMM-MplayerRadio/scripts/KissFM.sh", customCommandArgs: ["", "", ""], }, ], }, },and this in KissFM.sh
#!/bin/bash xmms2 stop xmms2 clear xmms2 add https://live.kissfm.ro/kissfm.aacp xmms2 playit’s working when i want to start radio but nothing happens when i touch the stop button just a short flickering of your module(I use a 10" touchescreen).
Thank you. -
Hi,
as i wrote in the documentation you need to make sure that your script runs as long as the station is active and needs to stop the playback if it gets a kill signal.
Maybe i will find a short tutorial about catching the kill signal. -
If you change your script to (playRadio.bash):
#!/bin/bash URL=$1 RUN=1 exit_script() { echo "Stopping playback" xmms2 stop xmms2 clear RUN=0 } trap exit_script SIGINT SIGTERM xmms2 stop xmms2 clear xmms2 add $URL xmms2 play while [ $RUN -gt 0 ]; do echo "Still running" sleep 1 doneand the config to
{ module: "MMM-MplayerRadio", header: "Radio", position: "top_center", config: { stations: [ { title: "KissFM", url: "https://live.kissfm.ro/kissfm.aacp", logo: "https://upload.wikimedia.org/wikipedia/ro/8/86/Logo_Kiss_FM.png", customCommand: "/home/pi/MagicMirror/modules/MMM-MplayerRadio/scripts/playRadio.bash", customCommandArgs: ["###URL###"], }, ], }, },You can then reuse the same script for different stations only by adding the url as first parameter in the config
Edit: Added url back to the config
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login