• Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
RetroPie forum home
  • Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login

Streaming internet radio when browsing for games and on screensaver?

Scheduled Pinned Locked Moved Ideas and Development
internetradiostreamingmp3
47 Posts 7 Posters 8.4k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M
    mitu Global Moderator @NowArrivingHere
    last edited by 5 Oct 2017, 04:29

    @nowarrivinghere This means the netcat commands you run in the 2nd window reads the pause command but it doesn't send it right away and awaits further input.
    I'll do some testing with the version in Stretch to see if it behaves differently than the one in the Jessie release, but glad you got it working with the alternate start/stop command.

    1 Reply Last reply Reply Quote 0
    • M
      mitu Global Moderator
      last edited by 5 Oct 2017, 06:31

      Ok, found out the difference - tested on a Stretch system. The netcat command doesn't return and still waits for input from the tty. To force it to close the input, using -N seems to do the trick.
      @NowArrivingHere you can try changing the on-start/on-end commands to

      echo -n pause | nc -UN /tmp/radio.sock
      

      Unfortunately the -N option doesn't exist in the Jessie version of netcat-openbsd, I'll see if we can ditch netcat completely and use something else.

      1 Reply Last reply Reply Quote 0
      • M
        mitu Global Moderator
        last edited by 5 Oct 2017, 16:09

        OK, I've found a way to ditch netcat - by replacing it with socat. I have updated the instructions steps with the new commands (steps 2 and 3, plus the pre-requisites).
        This should work on both Jessie and Stretch - and possibly other systems.

        N 1 Reply Last reply 6 Oct 2017, 18:35 Reply Quote 0
        • N
          NowArrivingHere @mitu
          last edited by 6 Oct 2017, 18:35

          @mitu
          Thanks mate. It is pausing and playing properly now.

          1 Reply Last reply Reply Quote 0
          • M
            mtib
            last edited by 4 May 2019, 06:12

            Pi Model or other hardware: 3B
            Power Supply used: Original Raspi
            RetroPie Version Used : 4.4.12
            Built From: Retropie Website
            USB Devices connected: Keyboard
            Controller used: PS4

            Hi there! I ran the script and it is working fantastic! Thankyou. However I was wondering if is there a way to control/adjust the volume while in ES. If not, if is there a way to pre-configure the volume level in the script. Great work!

            M 1 Reply Last reply 4 May 2019, 06:40 Reply Quote 0
            • M
              mitu Global Moderator @mtib
              last edited by 4 May 2019, 06:40

              @mtib Emulationstation has an audio volume knob which allows you to change the volume - doesn't it work for the background music ?
              Alternatively you can add the --gain parameter to the mpg123 to set the volume (0-100):

              # to set the volume to 40%
              mpg123 --gain 40 [..other parameters following..]
              
              C M 2 Replies Last reply 4 May 2019, 06:56 Reply Quote 0
              • C
                cyperghost @mitu
                last edited by cyperghost 5 Apr 2019, 07:57 4 May 2019, 06:56

                @mitu @mtib You can try out mpg123 -f parameter.... The gain is a deprecated function. But I've to admit never used the gain function ;)

                mpg123 -f #####
                
                32768 - Volume 100%
                29484 - Volume 90% 
                26208 - Volume 80% 
                22932 - Volume 70% 
                19656 - Volume 60%
                16380 - Volume 50%
                13104 - Volume 40%
                9828 - Volume 30%
                6552 - Volume 20%
                3276 - Volume 10%
                
                1 Reply Last reply Reply Quote 0
                • C
                  cyperghost
                  last edited by 4 May 2019, 07:00

                  To mention .... in mpg321 the --gain option is documentated ;)

                  1 Reply Last reply Reply Quote 0
                  • M
                    mtib @mitu
                    last edited by 4 May 2019, 07:35

                    Thanks!

                    @mtib Emulationstation has an audio volume knob which allows you to change the volume - doesn't it work for the background music ?

                    Right, but then will affect the UI fx level as well.

                    @mitu @mtib You can try out mpg123 -f parameter....

                    Ok I am missing something, when I type this command in Putty, I get:

                    # pi@retropie:~ $ mpg123 -f 32768
                    
                    You made some mistake in program usage... let me briefly remind you:
                    
                    
                    
                    High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
                    
                            version 1.23.8; written and copyright by Michael Hipp and others
                    
                            free software (LGPL) without any warranty but with best wishes
                    
                    
                    
                    usage: mpg123 [option(s)] [file(s) | URL(s) | -]
                    
                    supported options [defaults in brackets]:
                    
                       -v    increase verbosity level       -q    quiet (don't print title)
                    
                       -t    testmode (no output)           -s    write to stdout
                    
                       -w f  write output as WAV file
                    
                       -k n  skip first n frames [0]        -n n  decode only n frames [all]
                    
                       -c    check range violations         -y    DISABLE resync on errors
                    
                       -b n  output buffer: n Kbytes [0]    -f n  change scalefactor [32768]
                    
                       -r n  set/force samplerate [auto]
                    
                       -o m  select output module           -a d  set audio device
                    
                       -2    downsample 1:2 (22 kHz)        -4    downsample 1:4 (11 kHz)
                    
                       -d n  play every n'th frame only     -h n  play every frame n times
                    
                       -0    decode channel 0 (left) only   -1    decode channel 1 (right) only
                    
                       -m    mix both channels (mono)       -p p  use HTTP proxy p [$HTTP_PROXY]
                    
                       -@ f  read filenames/URLs from f     -T get realtime priority
                    
                       -z    shuffle play (with wildcards)  -Z    random play
                    
                       -u a  HTTP authentication string     -E f  Equalizer, data from file
                    
                       -C    enable control keys            --no-gapless  not skip junk/padding in mp3s
                    
                       -?    this help                      --version  print name + version
                    
                    See the manpage mpg123(1) or call mpg123 with --longhelp for more parameters and information.
                    
                    M 1 Reply Last reply 4 May 2019, 07:40 Reply Quote 0
                    • M
                      mitu Global Moderator @mtib
                      last edited by 4 May 2019, 07:40

                      @mtib said:

                      Ok I am missing something, when I type this command in Putty, I get:

                      You need to append the rest of the parameters - the filename/playlist for mpg321. You should add the -f <volume> to the initial command used in the script.

                      1 Reply Last reply Reply Quote 0
                      • M
                        mtib
                        last edited by mtib 5 Apr 2019, 08:50 4 May 2019, 07:49

                        I really appreciate the help, but sorry, noob here. Should I type this?

                        # mpg321 /home/pi/radio/list.txt -f <32768>
                        M 1 Reply Last reply 4 May 2019, 08:52 Reply Quote 0
                        • M
                          mitu Global Moderator @mtib
                          last edited by 4 May 2019, 08:52

                          @mtib Can you post the autostart.sh file that you modified to add the music script ?

                          M 1 Reply Last reply 4 May 2019, 09:36 Reply Quote 0
                          • M
                            mtib @mitu
                            last edited by 4 May 2019, 09:36

                            @mitu said in Streaming internet radio when browsing for games and on screensaver?:

                            @mtib Can you post the autostart.sh file that you modified to add the music script ?

                            Sure.

                            while pgrep omxplayer >/dev/null; do sleep 1; done
                            (sleep 10; [[ -f /home/pi/radio/list.txt ]] &&  vlc -I oldrc --rc-fake-tty --rc-unix /tmp/radio.sock -Zq --no-video /home/pi/radio/list.txt >/dev/null 2>&1) &
                            emulationstation --no-splash #auto
                            
                            1 Reply Last reply Reply Quote 0
                            • M
                              mitu Global Moderator
                              last edited by mitu 5 Apr 2019, 11:27 4 May 2019, 10:20

                              So it seems vlc has no direct usable CLI option to pass the volume, however it's possible to use gain to alter the sound output. The parameter works by multiplying the current volume % with the value. Assuming a 100% volume, then

                              • --gain=1 would make the volume be 100%
                              • --gain=2 would amplify the volume to 200%
                              • --gain=0.3 would make the volume at 30%, etc.

                              So modify the command line that starts vlc in your file, and instead of

                              (sleep 10; [[ -f /home/pi/radio/list.txt ]] &&  vlc -I oldrc --rc-fake-tty --rc-unix /tmp/radio.sock -Zq --no-video /home/pi/radio/list.txt >/dev/null 2>&1) &
                              

                              add a --gain=<X> parameter with the <X> to your liking (the line below has --gain=1):

                              (sleep 10; [[ -f /home/pi/radio/list.txt ]] &&  vlc --gain=1 -I oldrc --rc-fake-tty --rc-unix /tmp/radio.sock -Zq --no-video /home/pi/radio/list.txt >/dev/null 2>&1) &
                              
                              1 Reply Last reply Reply Quote 0
                              • M
                                mtib
                                last edited by 4 May 2019, 13:26

                                @mitu Thankyou so much!!! It works.

                                1 Reply Last reply Reply Quote 0
                                • M
                                  mtib
                                  last edited by 23 May 2019, 16:42

                                  Hi, it´s me again :)

                                  I disabled the initial text in Emulation Station with this command:

                                  emulationstation --no-splash #auto
                                  

                                  So this way:

                                  emulationstation --no-splash #auto
                                  
                                  while pgrep omxplayer >/dev/null; do sleep 1; done
                                  (sleep 10; [[ -f /home/pi/radio/list.txt ]] &&  vlc --gain=0.5 -I oldrc --rc-fake-tty --rc-unix /tmp/radio.sock -Zq --no-video /home/pi/radio/list.txt >/dev/null 2>&1) &
                                  

                                  I have no initial text and also no radio

                                  But when I put on the last line:

                                  while pgrep omxplayer >/dev/null; do sleep 1; done
                                  (sleep 10; [[ -f /home/pi/radio/list.txt ]] &&  vlc --gain=0.5 -I oldrc --rc-fake-tty --rc-unix /tmp/radio.sock -Zq --no-video /home/pi/radio/list.txt >/dev/null 2>&1) &
                                  
                                  emulationstation --no-splash #auto
                                  
                                  

                                  I have radio but the initial text persists. Is there a solution for this?

                                  M 1 Reply Last reply 23 May 2019, 18:28 Reply Quote 0
                                  • M
                                    mitu Global Moderator @mtib
                                    last edited by 23 May 2019, 18:28

                                    @mtib said in Streaming internet radio when browsing for games and on screensaver?:

                                    Is there a solution for this?

                                    The parameter is correct (--no-splash) and the emulationstation command should always be last. If you run the command from the command line (after exiting Emulationstation), does the splash show up ?

                                    M 1 Reply Last reply 23 May 2019, 19:37 Reply Quote 0
                                    • M
                                      mtib @mitu
                                      last edited by 23 May 2019, 19:37

                                      @mitu said in [Streaming internet radio when browsing for games and on screensaver?]

                                      If you run the command from the command line (after exiting Emulationstation), does the splash show up ?

                                      It doesn`t.

                                      M 1 Reply Last reply 23 May 2019, 19:45 Reply Quote 0
                                      • M
                                        mitu Global Moderator @mtib
                                        last edited by 23 May 2019, 19:45

                                        @mtib So the command is correct, are you sure you're typing it right in the file ?

                                        M 1 Reply Last reply 25 May 2019, 16:27 Reply Quote 0
                                        • M
                                          mtib @mitu
                                          last edited by 25 May 2019, 16:27

                                          @mitu said in Streaming internet radio when browsing for games and on screensaver?:

                                          @mtib So the command is correct, are you sure you're typing it right in the file ?

                                          I just copied and pasted, it is the same command. Anyhow the radio script is disabling it. When I change the order it works nomarly.

                                          1 Reply Last reply Reply Quote 0
                                          • First post
                                            Last post

                                          Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                          Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.

                                            This community forum collects and processes your personal information.
                                            consent.not_received