Error on retroarch exit

I’m running kodibuntu with: kodi v14.2 (default confluence skin) Rom Collection Browser v2.1.2 Retroarch/libretro (libretro stable ppa)

After lots of tweaking, I’ve got my games working fine. They start, go full screen, have sound, and I can control them. But upon exit, kodi has a problem. There is no sound and the keyboard doesn’t work inside kodi. I can still use the mouse inside kodi, and also use the keyboard to switch tty. (CTRL+ALT+F2) Once in another tty, the keyboard works fine.

kodi log excerpt:

00:40:18 T:140027473606400  NOTICE: RCB_INFO: Begin launchEmu
00:40:18 T:140027473606400  NOTICE: RCB_INFO: launching game with id: 38
00:40:18 T:140027473606400  NOTICE: RCB_INFO: Begin launcher.launchEmu
00:40:18 T:140027473606400  NOTICE: RCB_INFO: Begin saveViewState
00:40:18 T:140027473606400  NOTICE: RCB_INFO: Begin saveViewMode
00:40:18 T:140027473606400  NOTICE: RCB_INFO: End saveViewMode
00:40:18 T:140027473606400  NOTICE: RCB_INFO: Begin helper.saveViewState
00:40:18 T:140027473606400  NOTICE: RCB_INFO: End helper.saveViewState
00:40:18 T:140027473606400  NOTICE: RCB_INFO: End saveViewState
00:40:18 T:140027473606400  NOTICE: RCB_INFO: files for current game: [(u'/home/adgriff2/roms/N64/SUPERip',)]
00:40:18 T:140027473606400  NOTICE: RCB_INFO: launcher.buildCmd
00:40:18 T:140027473606400  NOTICE: RCB_INFO: emuCommandLine: /usr/bin/retroarch
00:40:18 T:140027473606400  NOTICE: RCB_INFO: preCmdLine:
00:40:18 T:140027473606400  NOTICE: RCB_INFO: postCmdLine:
00:40:18 T:140027473606400  NOTICE: RCB_INFO: Getting Multiple Disc Parameter
00:40:18 T:140027473606400  NOTICE: RCB_INFO: emuParams: -L /usr/lib/libretro/mupen64plus_libretro.so "
00:40:18 T:140027473606400  NOTICE: RCB_INFO: rom: /home/adgriff2/roms/N64/SUPER_MARIO_64_(U)_[!] (2).z
00:40:18 T:140027473606400  NOTICE: RCB_INFO: Trying to delete temporary rom files
00:40:18 T:140027473606400  NOTICE: RCB_INFO: Treating file as a compressed archive
00:40:18 T:140027473606400  NOTICE: RCB_INFO: Archive only has one file inside; picking that one
00:40:18 T:140027473606400  NOTICE: RCB_INFO: Putting extracted file in /home/adgriff2/.kodi/userdata/arom.collection.browser/tmp/extracted/SUPER_MARIO_64_(U)_[!] (2).V64
00:40:18 T:140027473606400  NOTICE: roms compressed = ['/home/adgriff2/.kodi/userdata/addon_data/scriptrowser/tmp/extracted/SUPER_MARIO_64_(U)_[!] (2).V64']
00:40:18 T:140027473606400  NOTICE: RCB_INFO: No precmd created.
00:40:18 T:140027473606400  NOTICE: RCB_INFO: No postcmd created.
00:40:18 T:140027473606400  NOTICE: RCB_INFO: cmd: "/usr/bin/retroarch" -L  /usr/lib/libretro/mupen64plugriff2/.kodi/userdata/addon_data/script.games.rom.collection.browser/tmp/extracted/SUPER_MARIO_64_(U)_[
00:40:18 T:140027473606400  NOTICE: RCB_INFO: precmd:
00:40:18 T:140027473606400  NOTICE: RCB_INFO: postcmd:
00:40:18 T:140027473606400  NOTICE: RCB_INFO: launchEmu on non-xbox
00:40:18 T:140027473606400  NOTICE: RCB_INFO: screenMode: 1920x1080@ 60.00 - Full Screen
00:40:18 T:140027473606400  NOTICE: RCB_INFO: Toggle to Windowed mode
00:40:18 T:140027473606400  NOTICE: RCB_INFO: launch emu
00:40:18 T:140027473606400  NOTICE: RCB_INFO: onAction: 7
00:40:24 T:140027473606400  NOTICE: RCB_INFO: launch emu done
00:40:25 T:140028743964416   ERROR: PulseAudio: Failed to connect context
00:40:25 T:140028743964416  NOTICE: PulseAudio might not be running. Context was not created.
00:40:25 T:140028743964416  NOTICE: Found 1 Lists of Devices
00:40:25 T:140028743964416  NOTICE: Enumerated ALSA devices:
00:40:25 T:140028743964416  NOTICE:     Device 1
00:40:25 T:140028743964416  NOTICE:         m_deviceName      : @
00:40:25 T:140028743964416  NOTICE:         m_displayName     : Default (HDA Intel HDMI HDMI 0)
00:40:25 T:140028743964416  NOTICE:         m_displayNameExtra:
00:40:25 T:140028743964416  NOTICE:         m_deviceType      : AE_DEVTYPE_PCM
00:40:25 T:140028743964416  NOTICE:         m_channels        : FL,FR
00:40:25 T:140028743964416  NOTICE:         m_sampleRates     : 32000,44100,48000
00:40:25 T:140028743964416  NOTICE:         m_dataFormats     : AE_FMT_S32NE,AE_FMT_S16NE,AE_FMT_S16LE
00:40:25 T:140028743964416  NOTICE:     Device 2
00:40:25 T:140028743964416  NOTICE:         m_deviceName      : hdmi:CARD=HDMI,DEV=0
00:40:25 T:140028743964416  NOTICE:         m_displayName     : HDA Intel
00:40:25 T:140028743964416  NOTICE:         m_displayNameExtra: DEL DELL ST2310 on HDMI #0
00:40:25 T:140028743964416  NOTICE:         m_deviceType      : AE_DEVTYPE_HDMI
00:40:25 T:140028743964416  NOTICE:         m_channels        : FL,FR
00:40:25 T:140028743964416  NOTICE:         m_sampleRates     : 32000,44100,48000
00:40:25 T:140028743964416  NOTICE:         m_dataFormats     : AE_FMT_LPCM,AE_FMT_S32NE,AE_FMT_S16NE,AD,AE_FMT_TRUEHD,AE_FMT_EAC3,AE_FMT_DTS,AE_FMT_AC3,AE_FMT_AAC
00:40:25 T:140028743964416  NOTICE:     Device 3
00:40:25 T:140028743964416  NOTICE:         m_deviceName      : hdmi:CARD=HDMI,DEV=1
00:40:25 T:140028743964416  NOTICE:         m_displayName     : HDA Intel
00:40:25 T:140028743964416  NOTICE:         m_displayNameExtra: HDMI #1
00:40:25 T:140028743964416  NOTICE:         m_deviceType      : AE_DEVTYPE_HDMI
00:40:25 T:140028743964416  NOTICE:         m_channels        : FL,FR,BL,BR,FC,LFE,SL,SR
00:40:25 T:140028743964416  NOTICE:         m_sampleRates     : 32000,44100,48000,88200,96000,176400,19
00:40:25 T:140028743964416  NOTICE:         m_dataFormats     : AE_FMT_S32NE,AE_FMT_S16NE,AE_FMT_S16LE,D,AE_FMT_TRUEHD,AE_FMT_EAC3,AE_FMT_DTS,AE_FMT_AC3,AE_FMT_AAC
00:40:25 T:140028743964416  NOTICE:     Device 4
00:40:25 T:140028743964416  NOTICE:         m_deviceName      : hdmi:CARD=HDMI,DEV=2
00:40:25 T:140028743964416  NOTICE:         m_displayName     : HDA Intel
00:40:25 T:140028743964416  NOTICE:         m_displayNameExtra: HDMI #2
00:40:25 T:140028743964416  NOTICE:         m_deviceType      : AE_DEVTYPE_HDMI
00:40:25 T:140028743964416  NOTICE:         m_channels        : FL,FR,BL,BR,FC,LFE,SL,SR
00:40:25 T:140028743964416  NOTICE:         m_sampleRates     : 32000,44100,48000,88200,96000,176400,19
00:40:25 T:140028743964416  NOTICE:         m_dataFormats     : AE_FMT_S32NE,AE_FMT_S16NE,AE_FMT_S16LE,D,AE_FMT_TRUEHD,AE_FMT_EAC3,AE_FMT_DTS,AE_FMT_AC3,AE_FMT_AAC
00:40:25 T:140028743964416  NOTICE:     Device 5
00:40:25 T:140028743964416  NOTICE:         m_deviceName      : @:CARD=PCH,DEV=0
00:40:25 T:140028743964416  NOTICE:         m_displayName     : HDA Intel PCH
00:40:25 T:140028743964416  NOTICE:         m_displayNameExtra: ALC283 Analog
00:40:25 T:140028743964416  NOTICE:         m_deviceType      : AE_DEVTYPE_PCM
00:40:25 T:140028743964416  NOTICE:         m_channels        : FL,FR
00:40:25 T:140028743964416  NOTICE:         m_sampleRates     : 48000
00:40:25 T:140028743964416  NOTICE:         m_dataFormats     : AE_FMT_S32NE
00:40:25 T:140027473606400  NOTICE: RCB_INFO: Toggle to Full Screen mode
00:40:25 T:140027473606400  NOTICE: RCB_INFO: End launcher.launchEmu
00:40:25 T:140027473606400  NOTICE: RCB_INFO: End launchEmu

I start the game at 00:40:18. It has good sound using ALSA on hw:0,3. But then on exit at 00:40:24, it seems like it’s trying to return to kodi with a different pulseaudio sound config?? I also have no idea what this has to do with the keyboard problem.

and just for the heck of it, here’s aplay -l output:

**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: ALC283 Analog [ALC283 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

relevant entries in retroarch.cfg:

audio_driver = "alsa"
audio_device = "hw:0,3"

This happens if I use escape to exit retroarch or F1 to bring up the menu and then choose quit. Maybe a small note, but I’ve only experimented with the mupen64plus_libretro.so core so far.

Thanks in advance.

If no mistake, you having the problems I met before. After a tons of googling, I found the solutions to make all these work properly.

For the keyboard doesn’t work after exit the game, use another window manager like BlackBox to start retroarch. Once it exit, kodibuntu is able to re-focus and allow the keyboard input. here is the thread I found: http://forum.kodi.tv/showthread.php?tid=213257

Here is my custom script to launch retroarch from RCB or EmulationStation:

#!/bin/sh
pgrep kodi | xargs kill -SIGSTOP
sleep  0.2
blackbox &
/usr/bin/retroarch -f -L /usr/lib/libretro/$1_libretro.so "$2"
while [ $(pidof retroarch) ];do
sleep 1
done;
killall -9 retroarch
killall -9 blackbox
pgrep kodi | xargs kill -SIGCONT

For the no sound issue, that’s because of kodibuntu using audio for GUI sound, so you have to turn off “Keep Audio alive” and “Play GUI sound” in System Settings > Audio. I lost the link of this solution. Although this works well, but the GUI sound will not function anymore.

Sorry for my bad english, but I hope it can helps you to solve the problems. =)

THANK YOU CROSSRT!!!

This works great! FYI you only need to turn off “Keep audio alive”. “Play GUI sound” works fine for me.

I haven’t researched it yet, but it appears blackbox creates a full titlebar across the top. Know of a way to hide it?

[QUOTE=adgriff2;21179]THANK YOU CROSSRT!!!

This works great! FYI you only need to turn off “Keep audio alive”. “Play GUI sound” works fine for me.

I haven’t researched it yet, but it appears blackbox creates a full titlebar across the top. Know of a way to hide it?[/QUOTE]

You’re welcome. =) I have no idea how to hide blackbox titlebar. But I think I will try Openbox again with suggestions in that thread. If you found any better solution, share me as well. =P