flyinghead / flycast

Flycast is a multiplatform Sega Dreamcast, Naomi, Naomi 2 and Atomiswave emulator
GNU General Public License v2.0
1.45k stars 174 forks source link

Crash when configured ALSA device can't be opened #762

Closed pjagiello closed 2 years ago

pjagiello commented 2 years ago

Please Note: This form is the minimum required information for submitting bugs.
Removing this form may lead to your issue being closed until it is completed.

Platform / OS / Hardware: Linux 64-bit, OpenGL Github hash: b240da4

Hardware: CPU: Intel i5-4200M GPU: Intel(R) HD Graphics 4600

Description of the Issue

On newest master, attempting to play any game results in a crash just after the decryption step is done.

Logs Gathered


$ flycast 
00:00:507 sdl/sdl.cpp:580 N[RENDERER]: Monitor refresh rate: 60 Hz (1920 x 1080)
00:00:548 rend/gui.cpp:262 N[RENDERER]: Screen DPI is 144, size 795 x 600. Scaling by 1.08
00:00:600 rend/gles/gles.cpp:550 N[RENDERER]: OpenGL version 4.6
00:05:739 hw/mem/_vmem.cpp:494 N[VMEM]: Info: nvmem is enabled, with addr space of size 4GB
00:05:758 hw/mem/_vmem.cpp:589 N[VMEM]: BASE 0x7ff4fb100000 RAM(16 MB) 0x7ff587100000 VRAM64(8 MB) 0x7ff57f100000 ARAM(2 MB) 0x7ff57b900000
00:05:763 hw/mem/_vmem.cpp:494 N[VMEM]: Info: nvmem is enabled, with addr space of size 4GB
00:05:799 hw/mem/_vmem.cpp:589 N[VMEM]: BASE 0x7ff4fb100000 RAM(32 MB) 0x7ff587100000 VRAM64(16 MB) 0x7ff57f100000 ARAM(8 MB) 0x7ff57b900000
00:15:374 hw/naomi/naomi_cart.cpp:582 N[NAOMI]: NAOMI GAME ID [BORDER DOWN] region ff players 0 vertical 1
00:15:374 emulator.cpp:229 N[BOOT]: Game ID is [BORDER DOWN]
00:15:382 hw/naomi/naomi_flashrom.cpp:206 N[NAOMI]: EEPROM: horizontal monitor orientation
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM pulse
00:15:389 oslib/audiobackend_alsa.cpp:63 W[AUDIO]: ALSA: unable to open PCM device pulse: No such file or directory
00:15:392 linux/common.cpp:70 E[COMMON]: SIGSEGV @ 0x7ff5fd61e014 -> 0x34 was not in vram, dynacode:0
Minidump saved to '/tmp/48785fda-babb-4fcf-e09d2aa0-dd3a9258.dmp'
Segmentation fault (core dumped)

Let me know if I can provide anything else to debug the issue.

flyinghead commented 2 years ago

It looks like there's an audio issue with ALSA or pulse on your machine. Try using a different audio driver, such as sdl2 (Settings > Audio).

cinnamonmatexfce commented 2 years ago

Here it's fully functional latest master with ArchLinux and Intel HD 4400 (i3 4130T). Tested both Dreamcast games and NAOMI roms. Don't know if it's related but did you try using another audio driver?

pjagiello commented 2 years ago

Hm I kinda dismissed this message because I'm used to seeing various ALSA errors all over the place while everything is working, but you're right, switching to e.g. "sdl2" makes the crash go away. Not sure if anything on my machine changed audio-wise though, I'm using Pipewire (with the pipewire-pulse comp. layer) and this configuration worked in some earlier flycast version.

flyinghead commented 2 years ago

Apparently the configured ALSA device is pulse and it can't be found anymore. Switching the device to auto or default would probably fix the crash as well.

I'll push a change to default to auto if the configured ALSA device can't be opened.

pjagiello commented 2 years ago

Actually, I had it set to auto to begin with, and switching to auto now also triggers the same crash.

EDIT: ah, right, you meant the "auto" device, not the "auto" audio setting. To be clear, what I mean here is that the automatic driver selection crashes.

pjagiello commented 2 years ago

Even more interestingly, even just setting it to pulse or alsa works fine - in the case of alsa I don't even need to pick a device from a list and it just works (and I can't set the alsa device to "pulse" because it's not even on the list, I have a "pipewire" device instead). The only setting that crashes seems to be auto.

pjagiello commented 2 years ago

I guess I forgot to write that, but on newest master the automatic detection option indeed doesn't crash anymore. Thanks!