RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    No sound in games using sound card

    Scheduled Pinned Locked Moved Help and Support
    sound cardiqaudiodacalsa
    15 Posts 2 Posters 1.8k 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.
    • hhcaseyH
      hhcasey
      last edited by mitu

      1. Yes, the #dtparam was a typo.

      2. default gives me no sound in snaps or the game.

      3. speaker-test

      speaker-test 1.1.8
      
      Playback device is default
      Stream parameters are 48000HZ,S16_LE, 1 channels
      Using 16 octaves of pink noise
      Playback open error: -2,No such file or directory
      

      It generates no sounds.

      1. aplay -1
      pi@retropie:/boot $ aplay -l
      **** List of PLAYBACK Hardware Devices ****
      card 0: IQaudIODAC [IQaudIODAC], device 0: IQaudIO DAC HiFi pcm512x-hifi-0 [IQaudIO DAC HiFi pcm512x-hifi-0]
        Subdevices: 1/1
        Subdevice #0: subdevice #0
      
      1. aplay -L
      pi@retropie:/boot $ aplay -L
      null
          Discard all samples (playback) or generate zero samples (capture)
      default
      output
      sysdefault:CARD=IQaudIODAC
          IQaudIODAC, IQaudIO DAC HiFi pcm512x-hifi-0
          Default Audio Device
      dmix:CARD=IQaudIODAC,DEV=0
          IQaudIODAC, IQaudIO DAC HiFi pcm512x-hifi-0
          Direct sample mixing device
      dsnoop:CARD=IQaudIODAC,DEV=0
          IQaudIODAC, IQaudIO DAC HiFi pcm512x-hifi-0
          Direct sample snooping device
      hw:CARD=IQaudIODAC,DEV=0
          IQaudIODAC, IQaudIO DAC HiFi pcm512x-hifi-0
          Direct hardware device without any conversions
      plughw:CARD=IQaudIODAC,DEV=0
          IQaudIODAC, IQaudIO DAC HiFi pcm512x-hifi-0
          Hardware device with all software conversions
      
      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by

        Try creating a $HOME/.asoundrc file, with the following contents:

        
        pcm.!default {
                type hw
                card 0
        }
        
        ctl.!default {
                type hw
                card 0
        }
        
        

        This will make the sound card be default (not only sysdefault) and should help with games and EmulationStation. speaker-test should also work after this change. In EmulationStation change the Audio Card to default and the Audio Device to Digital.

        1 Reply Last reply Reply Quote 0
        • hhcaseyH
          hhcasey
          last edited by

          We're getting closer.

          Here's what was in the .asoundrc file:

          pcm.!default {
          type asym
          playback.pcm {
          type plug
          slave.pcm "output"
          }
          capture.pcm {
          type plug
          slave.pcm "input"
          }
          }
          pcm.output {
          type hw
          card 1
          }
          ctl.!default {
          type hw
          card 1
          }

          I saved this file as a backup and created a new file exactly as you recommended and changed the settings in Emulation Station.

          I get sound on both the snaps and the games but the sound is no better.

          The speaker-test gives me this:

          pi@retropie:~ $ speaker-test

          speaker-test 1.1.8

          Playback device is default
          Stream parameters are 48000Hz, S16_LE, 1 channels
          Using 16 octaves of pink noise
          Channels count (1) not available for playbacks: Invalid argument
          Setting of hwparams failed: Invalid argument

          and, I'm still getting the error:

          AudioManager Error - Unable to open SDL audio: ALSA: Couldn't open audio device: Device or resource busy

          The new aplay -l and aplay-L looks like this:

          pi@retropie:~ $ aplay -l
          **** List of PLAYBACK Hardware Devices ****
          card 0: IQaudIODAC [IQaudIODAC], device 0: IQaudIO DAC HiFi pcm512x-hifi-0 [IQaudIO DAC HiFi pcm512x-hifi-0]
          Subdevices: 1/1
          Subdevice #0: subdevice #0
          pi@retropie:~ $ aplay -L
          null
          Discard all samples (playback) or generate zero samples (capture)
          default
          sysdefault:CARD=IQaudIODAC
          IQaudIODAC, IQaudIO DAC HiFi pcm512x-hifi-0
          Default Audio Device
          dmix:CARD=IQaudIODAC,DEV=0
          IQaudIODAC, IQaudIO DAC HiFi pcm512x-hifi-0
          Direct sample mixing device
          dsnoop:CARD=IQaudIODAC,DEV=0
          IQaudIODAC, IQaudIO DAC HiFi pcm512x-hifi-0
          Direct sample snooping device
          hw:CARD=IQaudIODAC,DEV=0
          IQaudIODAC, IQaudIO DAC HiFi pcm512x-hifi-0
          Direct hardware device without any conversions
          plughw:CARD=IQaudIODAC,DEV=0
          IQaudIODAC, IQaudIO DAC HiFi pcm512x-hifi-0
          Hardware device with all software conversions
          pi@retropie:~ $

          1 Reply Last reply Reply Quote 0
          • mituM
            mitu Global Moderator
            last edited by mitu

            The previous .asoundrc looks more elaborate than what I posted, you can re-use it by changing the index of the default card to 0 :

            pcm.!default {
            type asym
            playback.pcm {
            type plug
            slave.pcm "output"
            }
            capture.pcm {
            type plug
            slave.pcm "input"
            }
            }
            pcm.output {
            type hw
            card 0
            }
            ctl.!default {
            type hw
            card 0
            }
            

            It may behave better. As for the error appearing in ES, my guess is that the mixer's name (Audio Device) is wrong. Run

            amixer scontents
            

            and look at the names of the controls. You can also run alsamixer and see what's the name of the mixer that's shown in the upper left corner.
            Make sure that you set Audio Device in EmulationStation to the same value. If you option list for Audio Device doesn't have it, then you can edit $HOME/.emulationstation/es_settings.cfg and add it manually - it should be used by EmulationStation and should get rid of the warnings in the log.

            1 Reply Last reply Reply Quote 0
            • hhcaseyH
              hhcasey
              last edited by

              I'm not sure how to add the name manually.
              The name from alsamixer is IQaudIODAC.

              Here's the es_settings.cfg file I have.

              <bool name="VideoAudio" value="true" />
              <bool name="VideoOmxPlayer" value="true" />
              <int name="MaxVRAM" value="600" />
              <int name="ScraperResizeHeight" value="0" />
              <int name="ScraperResizeWidth" value="400" />
              <int name="ScreenSaverSwapImageTimeout" value="10000" />
              <int name="ScreenSaverSwapVideoTimeout" value="30000" />
              <int name="ScreenSaverTime" value="900000" />
              <int name="SubtitleSize" value="55" />
              <int name="SystemSleepTime" value="0" />
              <string name="AudioCard" value="default" />
              <string name="AudioDevice" value="Digital" />
              <string name="CollectionSystemsAuto" value="favorites" />
              <string name="CollectionSystemsCustom" value="2 Player,Rotary Joystick Games,Spinner Games,Superheroes,Trackball Games" />
              <string name="GamelistViewStyle" value="automatic" />
              <string name="OMXAudioDev" value="alsa:hw:0,0" />
              <string name="PowerSaverMode" value="disabled" />
              <string name="SaveGamelistsMode" value="on exit" />
              <string name="Scraper" value="TheGamesDB" />
              <string name="ScreenSaverBehavior" value="slideshow" />
              <string name="ScreenSaverGameInfo" value="never" />
              <string name="SlideshowScreenSaverBackgroundAudioFile" value="/home/pi/.emulationstation/slideshow/audio/slideshow_bg.wav" />
              <string name="SlideshowScreenSaverImageDir" value="/home/pi/.emulationstation/slideshow/image" />
              <string name="SlideshowScreenSaverImageFilter" value=".png,.jpg" />
              <string name="StartupSystem" value="" />
              <string name="SubtitleAlignment" value="left" />
              <string name="SubtitleFont" value="/usr/share/fonts/truetype/freefont/FreeSans.ttf" />
              <string name="SubtitleItalicFont" value="/usr/share/fonts/truetype/freefont/FreeSansOblique.ttf" />
              <string name="ThemeSet" value="carbon" />
              <string name="TransitionStyle" value="fade" />
              <string name="UIMode" value="Full" />
              <string name="UIMode_passkey" value="uuddlrlrba" />

              1 Reply Last reply Reply Quote 0
              • mituM
                mitu Global Moderator
                last edited by mitu

                @hhcasey said in No sound in games using sound card:

                I'm not sure how to add the name manually.

                If you're at the command line, you can use the nano text editor to edit the file. Just type

                nano $HOME/.emulationstation/es_settings.cfg
                

                and modify the line where AudioDevice is set. Make sure EmulationStation is stopped. You can also edit the file by opening it over file shares from the network, it should be accessible at \\retropie\configs\all\emulationstation.

                The name from alsamixer is IQaudIODAC.

                Are you sure this isn't the name of the card ? For instance, the alsamixer output below show the card name is bcm2835 ALSA and the mixer name is PCM.

                1a6aa49a-bfbe-48ce-8a87-7b088d8fa9f2-image.png

                1 Reply Last reply Reply Quote 0
                • hhcaseyH
                  hhcasey
                  last edited by

                  Getting closer...

                  You're right about the the mixer name. It's "DSP Program".
                  I changed it in the cfg file and in EmulationStation sound settings.
                  I have sound in games but not in the snaps now.

                  I've also picked up a new error message:

                  VolumeControl::getVolume() - Failed to get volume range!
                  AudioManager Error - Unable to open SDL audio: ALSA: Couldn't open audio device: Device or resource busy

                  mituM 1 Reply Last reply Reply Quote 0
                  • mituM
                    mitu Global Moderator @hhcasey
                    last edited by mitu

                    @hhcasey Please run the command I mentioned earlier and post the output:

                    amixer scontents
                    
                    1 Reply Last reply Reply Quote 0
                    • hhcaseyH
                      hhcasey
                      last edited by mitu

                      pi@retropie:~ $ amixer scontents

                      Simple mixer control 'DSP Program',0
                        Capabilities: enum
                        Items: 'FIR interpolation with de-emphasis' 'Low latency IIR with de-emphasis'                 'High attenuation with de-emphasis' 'Fixed process flow' 'Ringing-less low late                ncy FIR'
                        Item0: 'FIR interpolation with de-emphasis'
                      Simple mixer control 'Analogue',0
                        Capabilities: pvolume
                        Playback channels: Front Left - Front Right
                        Limits: Playback 0 - 1
                        Mono:
                        Front Left: Playback 1 [100%] [0.00dB]
                        Front Right: Playback 1 [100%] [0.00dB]
                      Simple mixer control 'Analogue Playback Boost',0
                        Capabilities: volume
                        Playback channels: Front Left - Front Right
                        Capture channels: Front Left - Front Right
                        Limits: 0 - 1
                        Front Left: 0 [0%] [0.00dB]
                        Front Right: 0 [0%] [0.00dB]
                      Simple mixer control 'Auto Mute',0
                        Capabilities: pswitch
                        Playback channels: Front Left - Front Right
                        Mono:
                        Front Left: Playback [on]
                        Front Right: Playback [on]
                      Simple mixer control 'Auto Mute Mono',0
                        Capabilities: pswitch pswitch-joined
                        Playback channels: Mono
                        Mono: Playback [on]
                      Simple mixer control 'Auto Mute Time Left',0
                        Capabilities: enum
                        Items: '21ms' '106ms' '213ms' '533ms' '1.07s' '2.13s' '5.33s' '10.66s'
                        Item0: '21ms'
                      Simple mixer control 'Auto Mute Time Right',0
                        Capabilities: enum
                        Items: '21ms' '106ms' '213ms' '533ms' '1.07s' '2.13s' '5.33s' '10.66s'
                        Item0: '21ms'
                      Simple mixer control 'Clock Missing Period',0
                        Capabilities: enum
                        Items: '1s' '2s' '3s' '4s' '5s' '6s' '7s' '8s'
                        Item0: '1s'
                      Simple mixer control 'Deemphasis',0
                        Capabilities: pswitch pswitch-joined
                        Playback channels: Mono
                        Mono: Playback [on]
                      Simple mixer control 'Digital',0
                        Capabilities: pvolume pswitch
                        Playback channels: Front Left - Front Right
                        Limits: Playback 0 - 207
                        Mono:
                        Front Left: Playback 207 [100%] [0.00dB] [on]
                        Front Right: Playback 207 [100%] [0.00dB] [on]
                      Simple mixer control 'Max Overclock DAC',0
                        Capabilities: volume volume-joined
                        Playback channels: Mono
                        Capture channels: Mono
                        Limits: 0 - 40
                        Mono: 0 [0%]
                      Simple mixer control 'Max Overclock DSP',0
                        Capabilities: volume volume-joined
                        Playback channels: Mono
                        Capture channels: Mono
                        Limits: 0 - 40
                        Mono: 0 [0%]
                      Simple mixer control 'Max Overclock PLL',0
                        Capabilities: volume volume-joined
                        Playback channels: Mono
                        Capture channels: Mono
                        Limits: 0 - 20
                        Mono: 0 [0%]
                      Simple mixer control 'Volume Ramp Down Emergency Rate',0
                        Capabilities: enum
                        Items: '1 sample/update' '2 samples/update' '4 samples/update' 'Immediate'
                        Item0: '1 sample/update'
                      Simple mixer control 'Volume Ramp Down Emergency Step',0
                        Capabilities: enum
                        Items: '4dB/step' '2dB/step' '1dB/step' '0.5dB/step'
                        Item0: '4dB/step'
                      Simple mixer control 'Volume Ramp Down Rate',0
                        Capabilities: enum
                        Items: '1 sample/update' '2 samples/update' '4 samples/update' 'Immediate'
                        Item0: '1 sample/update'
                      Simple mixer control 'Volume Ramp Down Step',0
                        Capabilities: enum
                        Items: '4dB/step' '2dB/step' '1dB/step' '0.5dB/step'
                        Item0: '1dB/step'
                      Simple mixer control 'Volume Ramp Up Rate',0
                        Capabilities: enum
                        Items: '1 sample/update' '2 samples/update' '4 samples/update' 'Immediate'
                        Item0: '1 sample/update'
                      Simple mixer control 'Volume Ramp Up Step',0
                        Capabilities: enum
                        Items: '4dB/step' '2dB/step' '1dB/step' '0.5dB/step'
                        Item0: '1dB/step'
                      
                      1 Reply Last reply Reply Quote 0
                      • mituM
                        mitu Global Moderator
                        last edited by

                        Looking at what mixer controls are available, I'd say you need to use Analogue as the mixer name.
                        Exit EmulationStation and update es_settings.cfg and set AudioDevice:

                        ..
                        <string name="AudioDevice" value="Analogue" />
                        ..
                        

                        Then see if audio is working in EmulationStation.

                        1 Reply Last reply Reply Quote 0
                        • hhcaseyH
                          hhcasey
                          last edited by

                          That did it. I have sound in the snaps and in the games.
                          I'm still getting this error:

                          AudioManager Error - Unable to open SDL audio: ALSA: Couldn't open audio device: Device or resource busy

                          If everything is working though, I guess I'll ignore it.

                          I still have laggy sound in Golden Tee 2K and a couple of others.
                          I assume it's the 3B+ struggling.
                          Would overclocking it a help with the lagging?

                          mituM 1 Reply Last reply Reply Quote 0
                          • mituM
                            mitu Global Moderator @hhcasey
                            last edited by

                            @hhcasey said in No sound in games using sound card:

                            Would overclocking it a help with the lagging?

                            Not for Golden Tee.. Glad you fixed your sound, write down the config files somewhere just in case you need to re-install.

                            1 Reply Last reply Reply Quote 0
                            • hhcaseyH
                              hhcasey
                              last edited by

                              I'll backup the chip tomorrow and save the configuration to my desktop PC.

                              Thanks for the help.

                              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.