libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.28k stars 1.83k forks source link

No audio on Raspberry Pi #4977

Closed padremayi closed 7 years ago

padremayi commented 7 years ago

Hi to all, I searched on the net in order to find something on this problem but I didn't find any response to this.

I compiled RetroArch from source code for Raspberry Pi in chroot environment on Ubuntu x64 machine.

All the cores are working fine except for the audio: I can't hear anything.

I launch the core with:

./retroarch -L core_name.so /path_to_rom

Any suggestion?

This is the log during launch:

RetroArch [INFO] :: This is RetroArch version 1.5.0 (Git 385539c)
RetroArch [INFO] :: Redirecting save file to "/home/pi/RetroPie/roms/snes/Super Mario Kart (Europe) (Rev 0A).srm".
RetroArch [INFO] :: === Build =======================================
Capabilities: NEON VFPv3 VFPv4 
Built: May 23 2017
RetroArch [INFO] :: Version: 1.5.0
RetroArch [INFO] :: Git: 385539c
RetroArch [INFO] :: =================================================
RetroArch [INFO] :: Loading default config.
RetroArch [INFO] :: Looking for config in: "/home/pi/.config/retroarch/retroarch.cfg".
RetroArch [INFO] :: Loading dynamic libretro core from: "/home/pi/retro_machine/snes9x2002_libretro.so"
RetroArch [INFO] :: [overrides] no core-specific overrides found at /home/pi/.config/retroarch/config/Snes9x 2002/Snes9x 2002.cfg.
RetroArch [INFO] :: [overrides] no game-specific overrides found at /home/pi/.config/retroarch/config/Snes9x 2002/Super Mario Kart (Europe) (Rev 0A).cfg.
RetroArch [INFO] :: Shaders: preset directory: /home/pi/.config/retroarch/shaders/presets
RetroArch [INFO] :: Shaders: no game-specific preset found at /home/pi/.config/retroarch/shaders/presets/Snes9x 2002/Super Mario Kart (Europe) (Rev 0A).cgp.
RetroArch [INFO] :: Shaders: no game-specific preset found at /home/pi/.config/retroarch/shaders/presets/Snes9x 2002/Super Mario Kart (Europe) (Rev 0A).glslp.
RetroArch [INFO] :: Shaders: no core-specific preset found at /home/pi/.config/retroarch/shaders/presets/Snes9x 2002/Snes9x 2002.cgp.
RetroArch [INFO] :: Shaders: no core-specific preset found at /home/pi/.config/retroarch/shaders/presets/Snes9x 2002/Snes9x 2002.glslp.
RetroArch [INFO] :: Remaps: remap directory: /home/pi/.config/retroarch/config/remaps
RetroArch [INFO] :: Remaps: no game-specific remap found at /home/pi/.config/retroarch/config/remaps/Snes9x 2002/Super Mario Kart (Europe) (Rev 0A).rmp.
RetroArch [INFO] :: Remaps: no core-specific remap found at /home/pi/.config/retroarch/config/remaps/Snes9x 2002/Snes9x 2002.rmp.
RetroArch [INFO] :: Redirecting save file to "/home/pi/RetroPie/roms/snes/Super Mario Kart (Europe) (Rev 0A).srm".
RetroArch [INFO] :: Environ GET_OVERSCAN: 0
RetroArch [INFO] :: Loading content file: /home/pi/RetroPie/roms/snes/Super Mario Kart (Europe) (Rev 0A).sfc.
RetroArch [INFO] :: Did not find a valid content patch.
RetroArch [INFO] :: CRC32: 0x56410e5e .
RetroArch [INFO] :: Environ SET_PIXEL_FORMAT: RGB565.
No ROM file header found.
"SUPER MARIO KART" [checksum ok] HiROM, 4Mbits, Type: ROM+RAM+BAT+DSP1, Mode: 21, TV: PAL, S-RAM: 2Kb, ROMId:  Company:   
RetroArch [INFO] :: CHEEVOS system RAM: 0x1d8bf40 131072
RetroArch [INFO] :: CHEEVOS save RAM:   0x1dabf48 2048
RetroArch [INFO] :: CHEEVOS video RAM:  0x1dcbf50 65536
RetroArch [INFO] :: CHEEVOS RTC:        (nil) 0
RetroArch [INFO] :: Skipping SRAM load..
RetroArch [INFO] :: Version of libretro API: 1
RetroArch [INFO] :: Compiled against API: 1
RetroArch [INFO] :: [Audio]: Set audio input rate to: 32040.50 Hz.
RetroArch [INFO] :: [Video]: Timings deviate too much. Will not adjust. (Display = 59.94 Hz, Game = 50.01 Hz)
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/2xsal.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/2xScaleHQ.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/barrel-distortion.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/barrel-distortion_lanczos4.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/barrel-distortion_phosphor.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/barrel-distortion_snes.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/Brighter-with_Contrast.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/bsnes_gamma_ramp.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/crt-pi-curvature-vertical.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/crt-pi-curvature.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/crt-pi-vertical.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/crt-pi.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/gameboy-screen-grid.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/gameboy.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/gameboy2.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/hq2x&lcd3x.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/hq2x.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/hq2x2.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/hq2x_lcd3x.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/hq2x_phosphor.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/hq2xwaterpaint.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/hq2xwaterpaintscanline.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/hq4x.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/hq4x_lcd3x.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/nds.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/nedi.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/phosphor.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/snes.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/snes2.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/snes_hq2x.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/snes_hq2xwaterpaint.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/snes_hq2xwaterpainthicontrast.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/snes_hq2xwaterpaintscanline.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/snes_lcd3x.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/snes_phosphor.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/snes_scanline.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/snes_waterpaint.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/stock.glsl"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/super-2xsai.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/super-eagle.glslp"
RetroArch [INFO] :: Found shader "/home/pi/.config/retroarch/shaders/xbr-lv1-noblend.glslp"
RetroArch [INFO] :: [Video]: Video @ 897x672
RetroArch [INFO] :: [EGL] Falling back to eglGetDisplay
RetroArch [INFO] :: [EGL]: EGL version: 1.4
RetroArch [INFO] :: [EGL]: Current context: 0x1.
RetroArch [INFO] :: [GL]: Found GL context: videocore
RetroArch [INFO] :: [GL]: Detecting screen resolution 1920x1080.
RetroArch [INFO] :: [EGL]: eglSwapInterval(1)
RetroArch [INFO] :: [EGL]: eglSwapInterval(1)
RetroArch [INFO] :: [GL]: Vendor: Broadcom, Renderer: VideoCore IV HW.
RetroArch [INFO] :: [GL]: Version: OpenGL ES 2.0.
RetroArch [INFO] :: [GL]: Using resolution 1920x1080
RetroArch [INFO] :: [GL]: Default shader backend found: glsl.
RetroArch [INFO] :: [Shader driver]: Using GLSL shader backend.
RetroArch [WARN] :: [GL]: Stock GLSL shaders will be used.
RetroArch [INFO] :: [GLSL]: Found GLSL vertex shader.
RetroArch [INFO] :: Shader log: Compiled
RetroArch [INFO] :: [GLSL]: Found GLSL fragment shader.
RetroArch [INFO] :: Shader log: Compiled
RetroArch [INFO] :: [GLSL]: Linking GLSL program.
RetroArch [INFO] :: [GLSL]: Found GLSL vertex shader.
RetroArch [INFO] :: Shader log: Compiled
RetroArch [INFO] :: [GLSL]: Found GLSL fragment shader.
RetroArch [INFO] :: Shader log: Compiled
RetroArch [INFO] :: [GLSL]: Linking GLSL program.
RetroArch [INFO] :: [GLSL]: Found GLSL vertex shader.
RetroArch [INFO] :: Shader log: Compiled
RetroArch [INFO] :: [GLSL]: Found GLSL fragment shader.
RetroArch [INFO] :: Shader log: Compiled
RetroArch [INFO] :: [GLSL]: Linking GLSL program.
RetroArch [INFO] :: [GLSL]: Found GLSL vertex shader.
RetroArch [INFO] :: Shader log: Compiled
RetroArch [INFO] :: [GLSL]: Found GLSL fragment shader.
RetroArch [INFO] :: Shader log: Compiled
RetroArch [INFO] :: [GLSL]: Linking GLSL program.
RetroArch [INFO] :: [GLSL]: Found GLSL vertex shader.
RetroArch [INFO] :: Shader log: Compiled
RetroArch [INFO] :: [GLSL]: Found GLSL fragment shader.
RetroArch [INFO] :: Shader log: Compiled
RetroArch [INFO] :: [GLSL]: Linking GLSL program.
RetroArch [INFO] :: [GLSL]: Found GLSL vertex shader.
RetroArch [INFO] :: Shader log: Compiled
RetroArch [INFO] :: [GLSL]: Found GLSL fragment shader.
RetroArch [INFO] :: Shader log: Compiled
RetroArch [INFO] :: [GLSL]: Linking GLSL program.
RetroArch [INFO] :: [GLSL]: Found GLSL vertex shader.
RetroArch [INFO] :: Shader log: Compiled
RetroArch [INFO] :: [GLSL]: Found GLSL fragment shader.
RetroArch [INFO] :: Shader log: Compiled
RetroArch [INFO] :: [GLSL]: Linking GLSL program.
RetroArch [INFO] :: [GLSL]: Found GLSL vertex shader.
RetroArch [INFO] :: Shader log: Compiled
RetroArch [INFO] :: [GLSL]: Found GLSL fragment shader.
RetroArch [INFO] :: Shader log: Compiled
RetroArch [INFO] :: [GLSL]: Linking GLSL program.
RetroArch [INFO] :: [GL]: Using 4 textures.
RetroArch [INFO] :: [GL]: Loaded 1 program(s).
RetroArch [INFO] :: Querying EGL extension: KHR_image => exists
RetroArch [INFO] :: [Font]: Using font rendering backend: freetype.
RetroArch [INFO] :: [Video]: Graphics driver did not initialize an input driver. Attempting to pick a suitable driver.
RetroArch [INFO] :: [udev] Adding device /dev/input/event0 as type ID_INPUT_KEYBOARD.
RetroArch [INFO] :: [Joypad]: Found joypad driver: "udev".
RetroArch [ERROR] :: Failed to initialize audio driver. Will continue without audio.
RetroArch [INFO] :: [Menu]: Found menu display driver: "menu_display_gl".
RetroArch [ERROR] :: Failed to create rendering backend: freetype.
Failed to open /home/pi/.config/retroarch/assets/xmb/monochrome/font.ttf: No such file or directory
RetroArch [ERROR] :: Failed to create rendering backend: stb.
RetroArch [INFO] :: [Font]: Using font rendering backend: bitmap.
RetroArch [ERROR] :: Failed to create rendering backend: freetype.
Failed to open /home/pi/.config/retroarch/assets/xmb/monochrome/font.ttf: No such file or directory
RetroArch [ERROR] :: Failed to create rendering backend: stb.
RetroArch [INFO] :: [Font]: Using font rendering backend: bitmap.
RetroArch [INFO] :: Loading history file: [/home/pi/.config/retroarch/content_history.lpl].
RetroArch [INFO] :: Loading history file: [/home/pi/.config/retroarch/content_image_history.lpl].
RetroArch [INFO] :: [GL]: VSync => on
RetroArch [INFO] :: [EGL]: eglSwapInterval(1)
RetroArch [ERROR] :: failed_to_start_audio_driver
RetroArch [ERROR] :: failed_to_start_audio_driver
RetroArch [ERROR] :: failed_to_start_audio_driver
RetroArch [INFO] :: Saved new config to "/home/pi/.config/retroarch/retroarch.cfg".
RetroArch [INFO] :: Saving RAM type #0 to "/home/pi/RetroPie/roms/snes/Super Mario Kart (Europe) (Rev 0A).srm".
RetroArch [INFO] :: Saved successfully to "/home/pi/RetroPie/roms/snes/Super Mario Kart (Europe) (Rev 0A).srm".
RetroArch [INFO] :: [Video]: Does not have enough samples for monitor refresh rate estimation. Requires to run for at least 4096 frames.
RetroArch [INFO] :: Removing temporary content file: /home/pi/RetroPie/roms/snes/Super Mario Kart (Europe) (Rev 0A).sfc.
RetroArch [INFO] :: [Video]: Does not have enough samples for monitor refresh rate estimation. Requires to run for at least 4096 frames.

This is the output of the compiled features:

    Features:
    LibretroDB:
    LibretroDB support: yes
    Command:
    Command interface support: yes
    Network Command:
    Network Command interface support: yes
    SDL:
    SDL input/audio/video drivers: no
    SDL2:
    SDL2 input/audio/video drivers: yes
    X11:
    X11 input/video drivers: yes
    wayland:
    Wayland input/video drivers: yes
    Threads:
    Threading support: yes
    Vulkan:
    Vulkan video driver: no
    OpenGL:
    OpenGL video driver support: yes
    OpenGL ES:
    OpenGLES video driver support: yes
    XVideo:
    Video driver: yes
    UDEV:
    UDEV/EVDEV input driver support: yes
    EGL:
    Video context driver: yes
    KMS:
    Video context driver: yes
    OpenVG:
    Video context driver: yes
    CoreAudio:
    Audio driver: no
    ALSA:
    Audio driver: yes
    OSS:
    Audio driver: yes
    Jack:
    Audio driver: no
    RSound:
    Audio driver: no
    RoarAudio:
    Audio driver: no
    PulseAudio:
    Audio driver: yes
    DirectSound:
    Audio driver: no
    WASAPI:
    Audio driver: no
    XAudio2:
    Audio driver: no
    OpenAL:
    Audio driver: no
    OpenSL:
    Audio driver: no
    7zip:
    7zip extraction support: yes
    zlib:
    .zip extraction support: yes
    External:
    External filter and plugin support: yes
    Cg:
    Fragment/vertex shader driver: no
    GLSL:
    Fragment/vertex shader driver: yes
    HLSL:
    Fragment/vertex shader driver: yes
    libxml2:
    libxml2 XML parsing: yes
    SDL_image:
    SDL_image image loading: no
    rpng:
    PNG image loading/encoding: yes
    rjpeg:
    JPEG image loading: yes
    FBO:
    OpenGL render-to-texture (multi-pass shaders): yes
    Dynamic:
    Dynamic run-time loading of libretro library: yes
    FFmpeg:
    On-the-fly recording of gameplay with libavcodec: no
    FreeType:
    TTF font rendering driver: yes
    CoreText:
    TTF font rendering driver (for OSX and/or iOS): no
    Netplay:
    Peer-to-peer netplay: yes
    Python:
    Script support in shaders: no
    Libusb:
    Libusb support: no
    Cocoa:
    Cocoa UI companion support (for OSX and/or iOS): no
    Qt:
    Qt UI companion support: no
    AVFoundation:
    Camera driver: no
    Video4Linux2:
    Camera driver: no

This is the output of aplay: https://postimg.org/image/dhbxidb55/

hdmi_drive=2 is set but the problem is the failure on device initialization: RetroArch [ERROR] :: Failed to initialize audio driver. Will continue without audio

I tried with 1.5.0 and 1.3.6 code.

inactive123 commented 7 years ago

Which audio driver are you attempting to use?

padremayi commented 7 years ago

Hi, I tried all the available audio driver, ALSA, OSS, ALSATHREAD and PULSE but the audio doesn't work :-(

kivutar commented 7 years ago

Do you have dtparam=audio=on in your config.txt?

padremayi commented 7 years ago

Yes, I have that line in my config.txt but I just found the problem. In the retroarch.cfg I set

audio_driver = "ALSA" audio_device = "sysdefault:CARD=ALSA"

like the output of

aplay -L

and now it works ;-)

gouchi commented 7 years ago

You can switch audio device from the gui.