pumpitupdev / pumptools

A collection of tools to run Pump It Up games.
The Unlicense
22 stars 7 forks source link

MK3 games crashes right after launch #28

Closed voidderef closed 3 years ago

voidderef commented 3 years ago

In GitLab by @ChristleVania on Mar 26, 2021, 20:30

Summary

I've installed all dependencies specified by the documentation, compiled pumptools using both make build and make build-docker (different builds), used the right hooks (mk3hook.so and mk3hook.con both renamed to hook.so and hook.conf). Lib files from lib-local.zip are in place.

Game crashes after launch (both fullscreen and windowed).

Expected behavior

Game window to reamain open.

Current behavior

The game crashes instantly right after being launched.

Detailed Description

After executing ./piueb run (as root) everything works just right, the game window appears just for a split second and suddenly it closes and I get this console message:

free(): double free detected in tcache 2
Aborted (core dumped)

Here is a full pastebin of pumptools.log

The last thing logged is:

[I][2021/3/26-12:6:47:566][mk3hook-fmodex][fmodex.c:37] fmodex version: 4.68.65
[I][2021/3/26-12:6:47:566][mk3hook-fmodex][fmodex.c:64] Output type: 11

I've also tried to run the game with ./piueb strace and here I got a little more of info. There are a lot of "no such file or directory" messages, and then we have this:

writev(2, [{iov_base="free(): double free detected in "..., iov_len=40}, {iov_base="\n", iov_len=1}], 2free(): double free detected in tcache 2
) = 41
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf73d9000
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
getpid()                                = 27452
gettid()                                = 27452
tgkill(27452, 27452, SIGABRT)           = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
--- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=27452, si_uid=0} ---
+++ killed by SIGABRT (core dumped) +++
./piueb: line 224: 27449 Aborted                 (core dumped) strace -E __GL_SYNC_TO_VBLANK=1 -E LD_LIBRARY_PATH="$LD_LIBRARY_PATH" -E LD_PRELOAD="$LD_PRELOAD" "$GAME_EXEC" "${GAME_DIR}/" "--options" "$HOOK_CONFIG_FILE" "${@:2}"

Here is a full pastebin of this output

The "double free detected" error is still there, but also the process got killed referencing the line 224 in piueb file. I checked the pumptools.log and the piueb file function in line 224. The $lib_mode is getting set to "local", and judging by all the log_info messages I assume the piueb crashes in line 314 (normal + local) and 340 (strace + local).

If I switch the lib-ld.zip files I get a different error:

[E][2021/3/26-13:1:2:789][patch-sigsegv][sigsegv.c:18] ===================
[E][2021/3/26-13:1:2:789][patch-sigsegv][sigsegv.c:19] !!!!! SIGSEGV !!!!!
[E][2021/3/26-13:1:2:789][patch-sigsegv][sigsegv.c:28] Backtrace (11 frames):
[E][2021/3/26-13:1:2:789][patch-sigsegv][sigsegv.c:31] /piutools/games/07-Extra/hook.so(+0xa588) [0xf7ee2588]
[E][2021/3/26-13:1:2:789][patch-sigsegv][sigsegv.c:31] /piutools/games/07-Extra/hook.so(+0x14c0e) [0xf7eecc0e]
[E][2021/3/26-13:1:2:789][patch-sigsegv][sigsegv.c:31] linux-gate.so.1(__kernel_rt_sigreturn+0) [0xf7f01590]
[E][2021/3/26-13:1:2:789][patch-sigsegv][sigsegv.c:31] /piutools/games/07-Extra/lib/libglfw.so.3(+0xec46) [0xf7ecdc46]
[E][2021/3/26-13:1:2:789][patch-sigsegv][sigsegv.c:31] /piutools/games/07-Extra/lib/libglfw.so.3(+0xc066) [0xf7ecb066]
[E][2021/3/26-13:1:2:789][patch-sigsegv][sigsegv.c:31] /piutools/games/07-Extra/lib/libglfw.so.3(glfwCreateWindow+0x21a) [0xf7ec60ea]
[E][2021/3/26-13:1:2:789][patch-sigsegv][sigsegv.c:31] /piutools/games/07-Extra/piu() [0x804ba3b]
[E][2021/3/26-13:1:2:789][patch-sigsegv][sigsegv.c:31] /piutools/games/07-Extra/piu() [0x811c652]
[E][2021/3/26-13:1:2:789][patch-sigsegv][sigsegv.c:31] /piutools/games/07-Extra/hook.so(trap_main+0xfc) [0xf7edf603]
[E][2021/3/26-13:1:2:789][patch-sigsegv][sigsegv.c:31] /piutools/games/07-Extra/lib/libc.so.6(__libc_start_main+0xf3) [0xf774d793]
[E][2021/3/26-13:1:2:789][patch-sigsegv][sigsegv.c:31] /piutools/games/07-Extra/piu() [0x804acf5]

Here is a full pastebin of pumptools.log

I'm new to Linux so I don't know what to do to fix this or if this information is useful. Maybe a dependency is missing or my hardware is not compatible.

UPDATE: I renamed the libfmodexL.so lib to libfmodex.so (kinda remember it activates some debug features) and I got a few new lines after [I][2021/3/26-12:6:47:566][mk3hook-fmodex][fmodex.c:64] Output type: 11:

FMOD: OutputALSA::registerLib        : Loading libasound.so
FMOD: OutputALSA::registerLib        : Getting symbols
FMOD: OutputALSA::registerLib        : Name hint symbols are available
FMOD: OutputALSA::registerLib        : Retrieved symbols

Since the game crashes right after this it might be aproblem with the audio chip?

UPDATE II: I managed to solve it. I was curious about the firs half of the ./piueb strace output, so I configured my terminal to show everything and found this line:

openat(AT_FDCWD, "/piutools/games/07-Extra/lib/libasound.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)

(See attachment 4 for full log)

So yeah, it was indeed a problem with dependencies AND the sound. I copied the libasound.so lib from lib-ld.zipand the game finally runs!

Screenshot_2021-03-26_19-59-00

I feel kinda dumb for not thinking of this before. This is the kind of situation why the documentation advices to put all the libraries (except GPU ones) if something is wrong.

Now the problem is that it has no sound, but I think this is due to my configuration, wrong sound device or drivers:

ALSA lib pcm_dmix.c:1099:(snd_pcm_dmix_open) unable to open slave
FMOD error! (60) Error initializing output device. 
FMOD error! (79) This command failed because System::init or System::setDriver was not called. 

And every time the game tries to play a sound, it output this:

FMOD error! (37) An invalid parameter was passed to this function.

Anyway I think is a different problem, so I will close the issue and write my conclutions down in the "possible solution" section.

Thanks for your help!

Steps to reproduce

1.Buid the binaries 2.Extract the game files (lib-local) 3.Extract and rename hooks (mk3) 4.Install all dependencies 5.Run game as root

Further things tested

Possible solution

SOLVED: It was a problem of missing libraries. Run ./piueb strace and look for missing lib***.so files and extract them from the lib-ld.zip. libasound.so fixes the crashing problem but there won't be any sound.

Context (Environment)

Pumptools version(s) affected

Game(s) and version(s) affected

Log output

See attachment.

1) pumptools-ld.log

2) pumptools-local.log

3) strace.log

4) pump_strace_full.log

Configuration files

See attachment.

Command line arguments

APIs used

OS version

Hardware specs

voidderef commented 3 years ago

In GitLab by @ChristleVania on Mar 27, 2021, 01:59

changed the description

voidderef commented 3 years ago

In GitLab by @ChristleVania on Mar 27, 2021, 03:22

changed the description

voidderef commented 3 years ago

In GitLab by @ChristleVania on Mar 27, 2021, 03:26

changed the description

voidderef commented 3 years ago

In GitLab by @icex2 on Mar 28, 2021, 22:11

Thanks for bringing this up and also posting your updates with any further steps that you have taken including solutions. I think this is still worth keeping open for a few more comments as I would be curious what we could improve here.

Seeing that you went down the rabbit whole of actually compiling pumptools and debugging the game with the available tooling, that sounds like it might be worth documenting.

Is there anything specific that you think would be valuable to add regarding any sound related issues?

My personal experience with audio stuff on Linux if you are not just using a higher level manager like pulseaudio is also mostly negative that something isn't configured the way some application expects it.

FMOD error! (37) An invalid parameter was passed to this function.

IIRC you get that also if your audio device is busy or not configured in a way that the game wants it to be. I haven't spent too much time on that and just switched to a different one for testing stuff on my desktop. On dedicated setups, just going with hw:0 or dmix usually did the job.

voidderef commented 3 years ago

In GitLab by @ChristleVania on Mar 29, 2021, 04:10

Hello @icex2! Thanks for your comments.

I resolved the audio issue too and now I have all the games working with audio from 1st to NX2. I'll gladly share my experience:

The "invalid parameter" error was indeed caused due to the game not being able to use the audio device. I ran ./piueb run again and found a list of all my sound drivers:

[I][2021/3/28-17:31:7:268][mk3hook-fmodex][fmodex.c:64] Output type: 11
[I][2021/3/28-17:31:7:377][mk3hook-fmodex][fmodex.c:74] Num available drivers 73
[I][2021/3/28-17:31:7:377][mk3hook-fmodex][fmodex.c:88] Driver 0: default
[I][2021/3/28-17:31:7:377][mk3hook-fmodex][fmodex.c:88] Driver 1: null
[I][2021/3/28-17:31:7:377][mk3hook-fmodex][fmodex.c:88] Driver 2: jack
[I][2021/3/28-17:31:7:377][mk3hook-fmodex][fmodex.c:88] Driver 3: hdmi:CARD=Generic,DEV=0
[I][2021/3/28-17:31:7:377][mk3hook-fmodex][fmodex.c:88] Driver 4: hdmi:CARD=Generic,DEV=1
[I][2021/3/28-17:31:7:377][mk3hook-fmodex][fmodex.c:88] Driver 5: hdmi:CARD=Generic,DEV=2
[I][2021/3/28-17:31:7:377][mk3hook-fmodex][fmodex.c:88] Driver 6: hdmi:CARD=Generic,DEV=3
[I][2021/3/28-17:31:7:377][mk3hook-fmodex][fmodex.c:88] Driver 7: dmix:CARD=Generic,DEV=3
[I][2021/3/28-17:31:7:377][mk3hook-fmodex][fmodex.c:88] Driver 8: dmix:CARD=Generic,DEV=7
[I][2021/3/28-17:31:7:377][mk3hook-fmodex][fmodex.c:88] Driver 9: dmix:CARD=Generic,DEV=8
[I][2021/3/28-17:31:7:377][mk3hook-fmodex][fmodex.c:88] Driver 10: dmix:CARD=Generic,DEV=9
[I][2021/3/28-17:31:7:377][mk3hook-fmodex][fmodex.c:88] Driver 11: dsnoop:CARD=Generic,DEV=3
[I][2021/3/28-17:31:7:377][mk3hook-fmodex][fmodex.c:88] Driver 12: dsnoop:CARD=Generic,DEV=7
[I][2021/3/28-17:31:7:378][mk3hook-fmodex][fmodex.c:88] Driver 13: dsnoop:CARD=Generic,DEV=8
[I][2021/3/28-17:31:7:378][mk3hook-fmodex][fmodex.c:88] Driver 14: dsnoop:CARD=Generic,DEV=9
[I][2021/3/28-17:31:7:378][mk3hook-fmodex][fmodex.c:88] Driver 15: hw:CARD=Generic,DEV=3
[I][2021/3/28-17:31:7:378][mk3hook-fmodex][fmodex.c:88] Driver 16: hw:CARD=Generic,DEV=7
[I][2021/3/28-17:31:7:378][mk3hook-fmodex][fmodex.c:88] Driver 17: hw:CARD=Generic,DEV=8
[I][2021/3/28-17:31:7:378][mk3hook-fmodex][fmodex.c:88] Driver 18: hw:CARD=Generic,DEV=9
[I][2021/3/28-17:31:7:378][mk3hook-fmodex][fmodex.c:88] Driver 19: plughw:CARD=Generic,DEV=3
[I][2021/3/28-17:31:7:378][mk3hook-fmodex][fmodex.c:88] Driver 20: plughw:CARD=Generic,DEV=7
[I][2021/3/28-17:31:7:378][mk3hook-fmodex][fmodex.c:88] Driver 21: plughw:CARD=Generic,DEV=8
[I][2021/3/28-17:31:7:378][mk3hook-fmodex][fmodex.c:88] Driver 22: plughw:CARD=Generic,DEV=9
[I][2021/3/28-17:31:7:378][mk3hook-fmodex][fmodex.c:88] Driver 23: usbstream:CARD=Generic
[I][2021/3/28-17:31:7:378][mk3hook-fmodex][fmodex.c:88] Driver 24: default:CARD=Webcam
[I][2021/3/28-17:31:7:378][mk3hook-fmodex][fmodex.c:88] Driver 25: sysdefault:CARD=Webcam
[I][2021/3/28-17:31:7:378][mk3hook-fmodex][fmodex.c:88] Driver 26: front:CARD=Webcam,DEV=0
[I][2021/3/28-17:31:7:378][mk3hook-fmodex][fmodex.c:88] Driver 27: surround21:CARD=Webcam,DEV=0
[I][2021/3/28-17:31:7:378][mk3hook-fmodex][fmodex.c:88] Driver 28: surround40:CARD=Webcam,DEV=0
[I][2021/3/28-17:31:7:378][mk3hook-fmodex][fmodex.c:88] Driver 29: surround41:CARD=Webcam,DEV=0
[I][2021/3/28-17:31:7:378][mk3hook-fmodex][fmodex.c:88] Driver 30: surround50:CARD=Webcam,DEV=0
[I][2021/3/28-17:31:7:378][mk3hook-fmodex][fmodex.c:88] Driver 31: surround51:CARD=Webcam,DEV=0
[I][2021/3/28-17:31:7:378][mk3hook-fmodex][fmodex.c:88] Driver 32: surround71:CARD=Webcam,DEV=0
[I][2021/3/28-17:31:7:378][mk3hook-fmodex][fmodex.c:88] Driver 33: iec958:CARD=Webcam,DEV=0
[I][2021/3/28-17:31:7:379][mk3hook-fmodex][fmodex.c:88] Driver 34: dmix:CARD=Webcam,DEV=0
[I][2021/3/28-17:31:7:379][mk3hook-fmodex][fmodex.c:88] Driver 35: dsnoop:CARD=Webcam,DEV=0
[I][2021/3/28-17:31:7:379][mk3hook-fmodex][fmodex.c:88] Driver 36: hw:CARD=Webcam,DEV=0
[I][2021/3/28-17:31:7:379][mk3hook-fmodex][fmodex.c:88] Driver 37: plughw:CARD=Webcam,DEV=0
[I][2021/3/28-17:31:7:379][mk3hook-fmodex][fmodex.c:88] Driver 38: usbstream:CARD=Webcam
[I][2021/3/28-17:31:7:379][mk3hook-fmodex][fmodex.c:88] Driver 39: default:CARD=Generic_1
[I][2021/3/28-17:31:7:379][mk3hook-fmodex][fmodex.c:88] Driver 40: sysdefault:CARD=Generic_1
[I][2021/3/28-17:31:7:379][mk3hook-fmodex][fmodex.c:88] Driver 41: front:CARD=Generic_1,DEV=0
[I][2021/3/28-17:31:7:379][mk3hook-fmodex][fmodex.c:88] Driver 42: surround21:CARD=Generic_1,DEV=0
[I][2021/3/28-17:31:7:379][mk3hook-fmodex][fmodex.c:88] Driver 43: surround40:CARD=Generic_1,DEV=0
[I][2021/3/28-17:31:7:379][mk3hook-fmodex][fmodex.c:88] Driver 44: surround41:CARD=Generic_1,DEV=0
[I][2021/3/28-17:31:7:379][mk3hook-fmodex][fmodex.c:88] Driver 45: surround50:CARD=Generic_1,DEV=0
[I][2021/3/28-17:31:7:379][mk3hook-fmodex][fmodex.c:88] Driver 46: surround51:CARD=Generic_1,DEV=0
[I][2021/3/28-17:31:7:379][mk3hook-fmodex][fmodex.c:88] Driver 47: surround71:CARD=Generic_1,DEV=0
[I][2021/3/28-17:31:7:379][mk3hook-fmodex][fmodex.c:88] Driver 48: iec958:CARD=Generic_1,DEV=0
[I][2021/3/28-17:31:7:379][mk3hook-fmodex][fmodex.c:88] Driver 49: dmix:CARD=Generic_1,DEV=0
[I][2021/3/28-17:31:7:379][mk3hook-fmodex][fmodex.c:88] Driver 50: dmix:CARD=Generic_1,DEV=1
[I][2021/3/28-17:31:7:379][mk3hook-fmodex][fmodex.c:88] Driver 51: dmix:CARD=Generic_1,DEV=2
[I][2021/3/28-17:31:7:379][mk3hook-fmodex][fmodex.c:88] Driver 52: dsnoop:CARD=Generic_1,DEV=0
[I][2021/3/28-17:31:7:380][mk3hook-fmodex][fmodex.c:88] Driver 53: dsnoop:CARD=Generic_1,DEV=1
[I][2021/3/28-17:31:7:380][mk3hook-fmodex][fmodex.c:88] Driver 54: dsnoop:CARD=Generic_1,DEV=2
[I][2021/3/28-17:31:7:380][mk3hook-fmodex][fmodex.c:88] Driver 55: hw:CARD=Generic_1,DEV=0
[I][2021/3/28-17:31:7:380][mk3hook-fmodex][fmodex.c:88] Driver 56: hw:CARD=Generic_1,DEV=1
[I][2021/3/28-17:31:7:380][mk3hook-fmodex][fmodex.c:88] Driver 57: hw:CARD=Generic_1,DEV=2
[I][2021/3/28-17:31:7:380][mk3hook-fmodex][fmodex.c:88] Driver 58: plughw:CARD=Generic_1,DEV=0
[I][2021/3/28-17:31:7:380][mk3hook-fmodex][fmodex.c:88] Driver 59: plughw:CARD=Generic_1,DEV=1
[I][2021/3/28-17:31:7:380][mk3hook-fmodex][fmodex.c:88] Driver 60: plughw:CARD=Generic_1,DEV=2
[I][2021/3/28-17:31:7:380][mk3hook-fmodex][fmodex.c:88] Driver 61: usbstream:CARD=Generic_1
[I][2021/3/28-17:31:7:380][mk3hook-fmodex][fmodex.c:88] Driver 62: cards
[I][2021/3/28-17:31:7:380][mk3hook-fmodex][fmodex.c:88] Driver 63: rear
[I][2021/3/28-17:31:7:380][mk3hook-fmodex][fmodex.c:88] Driver 64: center_lfe
[I][2021/3/28-17:31:7:380][mk3hook-fmodex][fmodex.c:88] Driver 65: side
[I][2021/3/28-17:31:7:380][mk3hook-fmodex][fmodex.c:88] Driver 66: spdif
[I][2021/3/28-17:31:7:380][mk3hook-fmodex][fmodex.c:88] Driver 67: modem
[I][2021/3/28-17:31:7:380][mk3hook-fmodex][fmodex.c:88] Driver 68: phoneline
[I][2021/3/28-17:31:7:380][mk3hook-fmodex][fmodex.c:88] Driver 69: plug
[I][2021/3/28-17:31:7:380][mk3hook-fmodex][fmodex.c:88] Driver 70: shm
[I][2021/3/28-17:31:7:380][mk3hook-fmodex][fmodex.c:88] Driver 71: tee
[I][2021/3/28-17:31:7:380][mk3hook-fmodex][fmodex.c:88] Driver 72: file
[I][2021/3/28-17:31:7:380][mk3hook-fmodex][fmodex.c:96] Selecting default driver (0) because either the selected driver was not found or no driver was selected
[M][2021/3/28-17:31:7:431][patch-asound-fix][asound-fix.c:73] Trapping getgrnam_r for audio group of libasound
[M][2021/3/28-17:31:7:432][patch-asound-fix][asound-fix.c:133] Resulting group struct: audio x 29 pulse,
ALSA lib pcm_dmix.c:1099:(snd_pcm_dmix_open) unable to open slave

I executed the aplay -l command to list my playback devices and help me identify the right driver:

**** List of PLAYBACK Hardware Devices ****
card 0: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Generic [HD-Audio Generic], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Generic [HD-Audio Generic], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Generic [HD-Audio Generic], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: Generic_1 [HD-Audio Generic], device 0: ALC887-VD Analog [ALC887-VD Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 2: Generic_1 [HD-Audio Generic], device 1: ALC887-VD Digital [ALC887-VD Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

To change the audio device the game will try to use I modified the patch.sound.device= line in hook.conf. My computer has a rear 3.5mm jack, a front 3.5mm jack and a HDMI audio outputs. patch.sound.device=hw:CARD=Generic,DEV=3(card 0: Generic [HD-Audio Generic], device 3: HDMI) worked for my HDMI monitor, front:CARD=Generic_1,DEV=0 (card 2: Generic_1 [HD-Audio Generic], device 0: ALC887-VD Analog) worked for the font jack but I wasn't able to make it work for rear. I'm using HDMI output for the moment.

Here are a couple of screenshots of my audio mixer configuration:

1

2

NOTE: As @icex2 suggested I tried to set the value just to hw:0 and dmix but none of both worked for me.

NOTE II: If you set patch.sound.device= to an unaccesible driver, MK3 games will still run but there will be not audio.

At this point all MK3 games are running with audio.

======

Despite I reported this issue specifically for the MK3 games, I will tell you a couple of things about the MK5/MK6 games in this section:

**** List of PLAYBACK Hardware Devices ****
card 0: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]

Hardware = hw
CARD = Generic
DEV = device = 3

RESULT: patch.sound.device=hw:CARD=Generic,DEV=3
[E][2021/3/28-19:38:49:778][patch-sound][sound.c:55] snd_pcm_open failed: No such file or directory
piu: pcm_params.c:2354: snd_pcm_hw_refine: Assertion `pcm && params' failed.
Aborted (core dumped)

UPDATE: I tried every single driver on my list to see if I can make the 3.5mm rear jack work. Here are my results:

MK6 RUNS BUT NO AUDIO:
null  (no audio)
dmix:CARD=Generic_1,DEV=1 (no audio)
iec958:CARD=Generic_1,DEV=0 (no audio)
hdmi:CARD=Generic,DEV=1 (no audio)
hdmi:CARD=Generic,DEV=2 (no audio)
hdmi:CARD=Generic,DEV=3 (no audio)
hw:CARD=Generic,DEV=7 (no audio)
hw:CARD=Generic,DEV=8 (no audio)
hw:CARD=Generic,DEV=9 (no audio)
plughw:CARD=Generic,DEV=7 (no audio)
plughw:CARD=Generic,DEV=8 (no audio)
plughw:CARD=Generic,DEV=9 (no audio)
hw:CARD=Generic_1,DEV=1 (no audio)
plughw:CARD=Generic_1,DEV=1 (no audio)

MK6 RUNS WITH AUDIO:
dmix:CARD=Generic,DEV=3 (HDMI - high-pitched audio)
hdmi:CARD=Generic,DEV=0 (HDMI)
plughw:CARD=Generic,DEV=3 (HDMI)

That's all I have for now. I hope this helps!

voidderef commented 3 years ago

In GitLab by @ChristleVania on Mar 29, 2021, 04:31

changed the description

voidderef commented 3 years ago

In GitLab by @icex2 on Mar 31, 2021, 21:30

Thanks a lot for this very detailed report. I added a few pieces to the general hook documentation (hook.md).

UPDATE: I tried every single driver on my list to see if I can make the 3.5mm rear jack work. Here are my results:

So far, nobody reported a similar issue and I haven't had a similar issue on two different mainboards. At least the 3.5mm analog jack always worked for me.

If you run any audio playback, e.g. using VLC or mplayer, do you get audio output over that physical connection?

Have you tried configuring dmix to use 41.5/48khz according to which game you use?

If the contents of the files are just variables, check /usr/share/alsa/alsa.conf something similar like this:

defaults.pcm.dmix.rate 44100
defaults.pcm.dmix.format "S16_LE"

dmix implements software mixing and might be prefered if you are running under a desktop environment. However, I do not know exactly how this operates with an audio manager like pulse audio.

https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture#Dmix

voidderef commented 3 years ago

In GitLab by @icex2 on Mar 31, 2021, 21:31

mentioned in commit 51cf070fdc17e3396e364ea0a0fb0ef325eaa658

voidderef commented 3 years ago

In GitLab by @ChristleVania on Mar 31, 2021, 22:36

Hello again!

Literally everything in my compouter sends audio to the rear 3.5mm jack (it's my main output) except for PIU games. I will try changing the samplerate as you suggest to see what happens and will update this post with the results.

Thanks for your help and I'm really happy my posts are helping to improve the documentation.

voidderef commented 3 years ago

In GitLab by @ChristleVania on Apr 9, 2021, 02:59

Hello again.

I wasn't able to solve the problem with the rear 3.5mm jack. I wish I had more time to experiment but recently a friend gave me a GTX 970 GPU and I had to install it inmediatlly (he wanted to see it in action ASAP).

But the story doesn't ends there. After installing the GPU and disabling the Integrated Graphics Processor (IGP), my audio devices list changed, not only to include the new HDMI ports from the GPU but the on board audio's device name too.

user@user-xubuntu:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 10: HDMI 4 [HDMI 4]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 11: HDMI 5 [HDMI 5]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 12: HDMI 6 [HDMI 6]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Microphone [Yeti Stereo Microphone], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: Generic [HD-Audio Generic], device 0: ALC887-VD Analog [ALC887-VD Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: Generic [HD-Audio Generic], device 1: ALC887-VD Digital [ALC887-VD Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

While using the IGP, the name of the HD-Audio Generic Device (3.5mm jack) was Generic_1 and the hdmi/hw was Generic (see my previos post)

Now that the IGP audio output is disabled the HD-Audi name is just Generic, so I tried to use this output again with patch.sound.device=hw:CARD=Generic,DEV=0 as the sound deivce in my hook.conf. IT WORKED! Now I have audio from the rear 3.5mm jack (which is connected to my boombox).

_NOTE: Changing the device to hw:0 or dmix (as suggested by @icex2) still didn't work._

I would have loved to find an answer for the original problem without installing a GPU...

My hypothesis is that as the IGP also has an audio output, pumptools was having a problem diferenciating between Generic and Generic_1 devices, causing only the front 3.5mm jack to actually output audio. Maybe if you have an IGP without an audio output (VGA or DVI) you won't have this problem at all. And as you can see, having a GPU and disabling the IGP also solves this problem.

Finally, just as a quick off topic note: I didn't had to add new libraries after migrating from the IGP (RX Vega 11) to the GeForce GTX 970. MK3 and MK6 are working flawlessly.

voidderef commented 3 years ago

In GitLab by @icex2 on Apr 12, 2021, 15:27

Great to hear you found a solution that works and thanks for sharing your insights to that. Considering you changed your setup which also changed some sort of configuration, I would guess that something might not have been configured with your previous setup (for whatever reason). Finding the actual root-cause might be quite difficult now and probably not worth it as long as this doesn't turn out to be a common problem affecting many different users with different hardware and software configurations.

Nevertheless, it's good you reported the issue and details on how you resolved it (even if it is not entirely clear how). This should help with similar issues in the future.

Finally, just as a quick off topic note: I didn't had to add new libraries after migrating from the IGP (RX Vega 11) to the GeForce GTX 970. MK3 and MK6 are working flawlessly.

GPU and sound-wise, it should be fairly transprent to the game no metter what you actually use due to using OpenGL and ALSA. The rather low/old standard should be an advantage if it comes to hardware compatibility.

Considering this issue resolved and closing it.