Recalbox Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • recalbox.com
    • Gitlab repository
    • Documentation
    • Discord

    no sound for splash videos - change omxplayer audio device to Alsa (Recalbox 6.0)

    Recalbox General
    sound splash videos omxplayer audio
    3
    15
    3462
    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.
    • ian57
      ian57 Staff last edited by

      @teufelskrapfen yes my bad, I forgot!!! we added some code to swith internal device and usb when present to put the USB audio as first device. So alsa:hw:0,0 is the right device when booted. Can you add --adev alsa:hw:1,0 to S02Splash and reboot
      If no sound, I think the video is played too early alsa is not ready yet. You'll need to move S02Splash to S13Splash for example... but the video will be played later

      "UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity." Dennis Ritchie

      teufelskrapfen 1 Reply Last reply Reply Quote 0
      • teufelskrapfen
        teufelskrapfen @ian57 last edited by

        @ian57 Thanks I tried --adev alsa:hw:1,0 and got no sound, but the video was playing.

        I moved S02Splash to S13Splash with --adve alsa:hw:0,0 and it kind of works:

        The video plays now with sound after some some delay, but back in emulationstation the menu music would not work anymore.

        I also tried S03Splash, S08Splash, … and so on but the outcome would not improve. Either the intro splash would not play or it would play but then there was no Emulationstation music.

        1 Reply Last reply Reply Quote 0
        • ian57
          ian57 Staff last edited by

          @teufelskrapfen after ES is started, can you go the sound config menu and select another audio device, exit, return in the sound config menu and select you usb device again.

          "UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity." Dennis Ritchie

          teufelskrapfen 1 Reply Last reply Reply Quote 0
          • teufelskrapfen
            teufelskrapfen @ian57 last edited by

            @ian57 yes that works... as soon as I select a different audio device, the music plays again.

            Also (without doing the above) when I start a game and return to Emulationstation, the music will play again as well.

            1 Reply Last reply Reply Quote 0
            • ian57
              ian57 Staff last edited by

              @teufelskrapfen ok, I think the problem comes from the delayed playing... the video is not finished when /etc/init.d/S26recalboxsystem is runned aand configure the sound for ES. As omxplayer uses the sound output, I think that the function rb_volume_configure ; rb_audio_configure do not finish succesfully... I think a workaround is to put audio configuration later for example in S99Custom

              "UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity." Dennis Ritchie

              teufelskrapfen 1 Reply Last reply Reply Quote 0
              • teufelskrapfen
                teufelskrapfen @ian57 last edited by

                @ian57 Thanks I made backups of the files, then tried to copy / move the functions to S99Custom but didn't get it to work. Do you have a suggestion what parts of the script need to be copied/moved or what parts need to be present in S99Custom?

                I restored my backups and also temporarily renamed S26recalboxsystem to S99recalboxsystem, but this also didnt work.

                I was thinking of a workaround: maybe I can add a line to S13Splash that after the video has finished, the the output will be toggled to i.e. HDMI and immediately back to USB Audio.

                1 Reply Last reply Reply Quote 0
                • ian57
                  ian57 Staff last edited by ian57

                  create the file /recalbox/share/system/custom.sh and put the following in it. try to run it through SSH before, to see if it works :

                  #!/bin/bash
                  
                  systemsetting="recalbox_settings"
                  config_script=/recalbox/scripts/recalbox-config.sh
                  
                  rb_volume_configure() {
                      settingsVolume="`$systemsetting -command load -key audio.volume`"
                      if [ "$settingsVolume" != "" ];then
                  	recallog "setting audio volume to $settingsVolume"
                          eval $config_script "volume" "$settingsVolume" 2>&1 | recallog
                      fi
                  }
                  
                  rb_audio_configure() {
                      recallog "Restoring ALSA mixers configuration"
                      alsactl -f /recalbox/share/system/configs/asound.state restore
                      settingsAudio="`$systemsetting -command load -key audio.device`"
                      if [[ "$settingsAudio" == "" ]];then
                          settingsAudio="auto"
                      fi
                      recallog "setting audio to $settingsAudio"
                      eval $config_script "audio" "$settingsAudio" 2>&1 | recallog
                  }
                  
                  ( rb_volume_configure ; rb_audio_configure ) &  # 1.0
                  

                  "UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity." Dennis Ritchie

                  teufelskrapfen 1 Reply Last reply Reply Quote 0
                  • teufelskrapfen
                    teufelskrapfen @ian57 last edited by

                    @ian57 Thanks and sorry for my late answer.

                    For the script to run I had to change

                    systemsetting="recalbox_settings"

                    to

                    systemsetting="python /usr/lib/python2.7/site-packages/configgen/settings/recalboxSettings.pyc"

                    I put S02Splash to S13Splash and added --adev alsa:hw:0,0

                    But I would only get sound from the splash intro but no music in Emulationstation.

                    ian57 1 Reply Last reply Reply Quote 0
                    • ian57
                      ian57 Staff @teufelskrapfen last edited by

                      @teufelskrapfen ok that's strange, did you test the S99custom alone to see if it is working. I made this thing in blind..; so perhaps I missed something.

                      "UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity." Dennis Ritchie

                      teufelskrapfen 1 Reply Last reply Reply Quote 0
                      • teufelskrapfen
                        teufelskrapfen @ian57 last edited by

                        @ian57 sorry havent got around testing it again but will try with S99custom this evening.

                        So I would:

                        • rename to S13Splash and add "--adev alsa:hw:0,0"
                        • copy/paste your text into S99custom
                        • do I need remove anything from S26recalboxsystem ?
                        1 Reply Last reply Reply Quote 0
                        • teufelskrapfen
                          teufelskrapfen last edited by teufelskrapfen

                          OK so I copy-pasted the text below into S99custom, but its the same behavior as before (splash screen has sound, emulationstation no sound). Do you know the command to trigger the output-device change? I.e. from USB Audio to HDMI … would like to try something

                          #!/bin/bash

                          test -e "/recalbox/share/system/custom.sh" && /recalbox/share/system/custom.sh $1

                          systemsetting="python /usr/lib/python2.7/site-packages/configgen/settings/recalboxSettings.pyc"
                          config_script=/recalbox/scripts/recalbox-config.sh

                          rb_volume_configure() {
                          settingsVolume="$systemsetting -command load -key audio.volume"
                          if [ "$settingsVolume" != "" ];then
                          recallog "setting audio volume to $settingsVolume"
                          eval $config_script "volume" "$settingsVolume" 2>&1 | recallog
                          fi
                          }

                          rb_audio_configure() {
                          recallog "Restoring ALSA mixers configuration"
                          alsactl -f /recalbox/share/system/configs/asound.state restore
                          settingsAudio="$systemsetting -command load -key audio.device"
                          if [[ "$settingsAudio" == "" ]];then
                          settingsAudio="auto"
                          fi
                          recallog "setting audio to $settingsAudio"
                          eval $config_script "audio" "$settingsAudio" 2>&1 | recallog
                          }

                          ( rb_volume_configure ; rb_audio_configure ) & # 1.0

                          1 Reply Last reply Reply Quote 0
                          • Midgardsnake
                            Midgardsnake @teufelskrapfen last edited by

                            @teufelskrapfen

                            Hi,

                            I had the same issue with my system and your post gave me an idea.
                            In the latsest version of recalbox (6.1), I did this:

                            • go to /etc/init.d
                            • enter command: mount -o remount,rw /
                            • open file splash03
                            • change line 88 as follows:

                            omx_opt="--adev both --no-keys --layer=10000 --aspect-mode=fill"
                            omx_opt="--adev local --no-keys --layer=10000 --aspect-mode=fill"

                            • save

                            Actually, "adev" must be followed by one these options: hdmi/local/both.

                            Hope it might help.

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

                            Want to support us ?

                            90
                            Online

                            99.6k
                            Users

                            28.1k
                            Topics

                            187.1k
                            Posts

                            Copyright © 2021 recalbox.com