RetroPIE / RetrOSMC ALSA Sound Issue - Sound Card not found

Hello guys,
I’ve been at this problem for a few nights now, so any help would be worthy of a bronze statue in your likeness.

I’m running RetrOSMC, which is a RetroPie installation built into OSMC ([HowTo] RetroPie and OSMC: Retrosmc - Retrogaming on OSMC).
I’m using a Raspi 2, everything is up to date. Sound works fine in OSMC, but I get no sound in RetroOSMC. I’ve re-flashed / re-installed a couple of times, same results.
I’ve tried setting options in /boot/config.txt such as hdmi_drive=2, but I’m confident that this isn’t the problem. When I run any emulators, it runs without sound and I get stuff like this in the log:

PPU.RenderSub = 0 PPU.FullClipping = 1 Settings.Transparency = 1 Settings.SpeedhackGameID = 7 PPU.SFXSpeedupHack = 0 coldata_update_screen = 0 ALSA lib confmisc.c:768:(parse_card) cannot find card '0' ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:4720:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM default

I’ve tried using sdl instead of alsa, same result.
When I run cat /proc/asound/cards , I get:

cat /proc/asound/cards

It looks like alsa isn’t recognizing my sound hardware?
I generated a log of my alsa settings:


    !!################################
    !!ALSA Information Script v 0.4.64
    !!################################

    !!Script ran on: Sat Dec  5 18:11:08 UTC 2015


    !!Linux Distribution
    !!------------------

    ID_LIKE=debian


    !!DMI Information
    !!---------------

    Manufacturer:     
    Product Name:     
    Product Version:   
    Firmware Version: 


    !!Kernel Information
    !!------------------

    Kernel release:    4.3.0-10-osmc
    Operating System:  GNU/Linux
    Architecture:      armv7l
    Processor:         unknown
    SMP Enabled:       Yes


    !!ALSA Version
    !!------------

    Driver version:     k4.3.0-10-osmc
    Library version:    1.0.28
    Utilities version:  1.0.28


    !!Loaded ALSA modules
    !!-------------------



    !!Sound Servers on this system
    !!----------------------------

    No sound servers found.


    !!Soundcards recognised by ALSA
    !!-----------------------------

    --- no soundcards ---


    !!Modprobe options (Sound related)
    !!--------------------------------

    snd_pcsp: index=-2
    snd_usb_audio: index=-2
    snd_atiixp_modem: index=-2
    snd_intel8x0m: index=-2
    snd_via82xx_modem: index=-2


    !!ALSA Device nodes
    !!-----------------

    crw-rw---- 1 root audio 116,  1 Dec  5 12:40 /dev/snd/seq
    crw-rw---- 1 root audio 116, 33 Dec  5 12:40 /dev/snd/timer


    !!Aplay/Arecord output
    !!--------------------

    APLAY

    aplay: device_list:268: no soundcards found...

    ARECORD

    arecord: device_list:268: no soundcards found...

    !!Amixer output
    !!-------------


    !!Alsactl output
    !!--------------

    --startcollapse--
    --endcollapse--


    !!All Loaded Modules
    !!------------------

    Module
    snd_bcm2835
    snd_pcm
    snd_timer
    snd
    8021q
    garp
    stp
    llc
    bnep
    sg
    uinput
    uas
    btusb
    btrtl
    btbcm
    btintel
    bluetooth
    evdev
    joydev
    rfkill
    lirc_rpi
    bcm2835_thermal
    lirc_dev
    rc_core
    bcm2835_gpiomem
    bcm2835_wdt
    uio_pdrv_genirq
    uio
    fuse
    ipv6


    !!ALSA/HDA dmesg
    !!--------------

That’s all the information that I know how to collect, but I’ll share any logs or configs that might be relevant. I’d greatly appreciate any help that you guys can offer.

dtparam=audio=on to config.txt and it should work

Dude YEAH!
Thanks, that worked. Toast, you rock and I am so damn happy right now man.

I’ve had the exact same problem starting a couple of weeks back, I don’t know if it was an update or something, but audio stopped working overnight in RetroPie. I tried adding dtparam=audio=on to both config.txt (/boot and /opt/retropie/boot) but it doesn’t work. I uninstalled / reinstalled RetroPie, still doesnt work. Any clues ?

runcommand.log:

ALSA lib confmisc.c:768:(parse_card) cannot find card ‘0’
ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4720:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM default

I did a fresh install two days ago, sound works here with dtparam=audio=on in config.txt

Fixed! I used OSMC’s pi config editor to add the line via their Kodi addon and it worked. Thanx!