Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No audio devices in McPixel 3 (and probably others) #354

Closed
1 task done
ali1234 opened this issue Jan 7, 2024 · 12 comments · Fixed by #355
Closed
1 task done

No audio devices in McPixel 3 (and probably others) #354

ali1234 opened this issue Jan 7, 2024 · 12 comments · Fixed by #355
Labels
game-specific The issue is related to a specific game or set of games type/bug Something isn't working

Comments

@ali1234
Copy link

ali1234 commented Jan 7, 2024

Ensure there isn't an existing issue for this and check the wiki

  • This issue is not a duplicate and I have checked the wiki.

Current Behavior

On starting the game McPixel 3, the game displays an error message saying that the audio device could not be opened.

Expected Behavior

The game should work.

Steps To Reproduce

  1. Own McPixel 3.
  2. Try to play it.

Environment

os_release:
    name:               "Ubuntu"
    version:            "23.04 (Lunar Lobster)"
snap_info:
    steam_revision:     171
    snapd_revision:     20671
lspci:
    01:00.0:            NVIDIA Corporation TU104 [GeForce RTX 2070 SUPER] (rev a1)
glxinfo:
    gpu:                NVIDIA GeForce RTX 2070 SUPER/PCIe/SSE2
    gpu_version:        4.6.0 NVIDIA 525.147.05
lscpu:
    model_name:         Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
xdg_current_desktop:    XFCE
desktop_session:        xubuntu

gaming-graphics-core22 version

kisak-fresh (default)

Anything else?

image

Additionally the following error message appears on the console where I ran steam:

Initializing audio
Requesting: Freq: 44100, Channels: 2, sample format: 8010, buffer length: 128 
ALSA lib dlmisc.c:337:(snd_dlobj_cache_get0) Cannot open shared library libasound_module_pcm_pulse.so
    (libpulsecommon-15.99.so: cannot open shared object file: No such file or directory)
Couldn't open audio: ALSA: Couldn't open audio device: No such device or address
[!!!ERROR!!!] Couldn't open audio: ALSA: Couldn't open audio device: No such device or address
 at audio_simple.c line 174

These messages are emitted by the game itself, not steam.

libpulsecommon-16.1.so is installed on the host, but no version of it is installed inside the snap. it is installed, see below.

The game works correctly outside of snap, by directly running mcpixel.sh on the host.

Snap connections:

al@al-desktop:~$ snap connections steam
Interface               Plug                                Slot                                Notes
audio-playback          steam:audio-playback                :audio-playback                     -
audio-record            steam:audio-record                  -                                   -
bluez                   steam:bluez                         :bluez                              manual
content[gaming-mesa]    steam:gaming-mesa                   gaming-graphics-core22:gaming-mesa  -
content[gtk-3-themes]   steam:gtk-3-themes                  gtk-common-themes:gtk-3-themes      -
content[icon-themes]    steam:icon-themes                   gtk-common-themes:icon-themes       -
content[sound-themes]   steam:sound-themes                  gtk-common-themes:sound-themes      -
dbus                    -                                   steam:steam                         -
desktop                 steam:desktop                       :desktop                            -
desktop-legacy          steam:desktop-legacy                :desktop-legacy                     -
fuse-support            steam:fuse-support                  -                                   -
gsettings               steam:gsettings                     :gsettings                          -
hardware-observe        steam:hardware-observe              :hardware-observe                   manual
home                    steam:home                          :home                               -
joystick                steam:joystick                      :joystick                           -
mount-observe           steam:mount-observe                 -                                   -
network                 steam:network                       :network                            -
network-bind            steam:network-bind                  :network-bind                       -
network-control         steam:network-control               -                                   -
opengl                  steam:opengl                        :opengl                             -
personal-files          steam:dot-local-share-applications  :personal-files                     -
personal-files          steam:dot-local-share-icons         :personal-files                     -
personal-files          steam:dot-local-share-steam         -                                   -
process-control         steam:process-control               -                                   -
removable-media         steam:removable-media               :removable-media                    -
screen-inhibit-control  steam:screen-inhibit-control        :screen-inhibit-control             -
shared-memory           steam:shmem                         :shared-memory                      -
steam-support           steam:steam-support                 :steam-support                      -
system-observe          steam:system-observe                :system-observe                     manual
uinput                  steam:uinput                        :uinput                             -
upower-observe          steam:upower-observe                :upower-observe                     -
wayland                 steam:wayland                       :wayland                            -
x11                     steam:x11                           :x11                                -
@ali1234 ali1234 added the type/bug Something isn't working label Jan 7, 2024
@ashuntu
Copy link
Collaborator

ashuntu commented Jan 8, 2024

libpulsecommon-16.1.so probably doesn't exist in the snap, but libpulsecommon-15.99.so should. Try running find $SNAP -name libpulsecommon* from snap run --shell steam. Can you also provide the output of echo $LD_LIBRARY_PATH from within snap run --shell steam?

For the sake of testing, do you know of any free games that this issue also occurs on?

@ali1234
Copy link
Author

ali1234 commented Jan 8, 2024

It exists:

/snap/steam/171/usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-15.99.so

path (above directory is present):

/snap/steam/171/graphics/lib/i386-linux-gnu:/snap/steam/171/graphics/usr/lib:/snap/steam/171/usr/lib/i386-linux-gnu:/snap/steam/171/lib/i386-linux-gnu:/snap/steam/171/usr/lib/i386-linux-gnu/pulseaudio:/snap/steam/171/usr/lib/x86_64-linux-gnu/alsa-lib:/snap/steam/171/usr/lib/x86_64-linux-gnu/pulseaudio:/snap/steam/171/graphics/usr/lib/i386-linux-gnu:/snap/steam/171/graphics/usr/lib/x86_64-linux-gnu:/var/lib/snapd/lib/gl:/var/lib/snapd/lib/gl/vdpau

However, the launcher for the game does this:

#!/bin/sh
export LD_LIBRARY_PATH=.
./mcpixel3

@ali1234
Copy link
Author

ali1234 commented Jan 8, 2024

I modified the launcher to this:

#!/bin/sh
export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH
./mcpixel3

And it makes the game work. I'll try to report this to the developer.

@ali1234
Copy link
Author

ali1234 commented Jan 8, 2024

@TheSos tl;dr McPixel3 Linux launcher script clears out LD_LIBRARY_PATH to add the current directory. This breaks the game for people who run steam in containers that need a custom library path. Instead please prepend your path to whatever currently exists. See above for details.

@TheSos
Copy link

TheSos commented Jan 8, 2024

Sure! I can fix this! Will let you know when the fix is live so you can test!

@ashuntu
Copy link
Collaborator

ashuntu commented Jan 8, 2024

@ali1234 could you try this build of the Steam snap with the default launch script of the game, if you're willing: https://github.com/canonical/steam-snap/actions/runs/7453047503/artifacts/1155183587 (download that file and then install with snap install <file name> --dangerous. You can go back to the regular build of Steam with snap refresh steam --amend afterward)

@ashuntu ashuntu added the game-specific The issue is related to a specific game or set of games label Jan 8, 2024
@ali1234
Copy link
Author

ali1234 commented Jan 8, 2024

With that snap version the game does not run at all. Tail end of the console output looks like this:

/bin/sh\0-c\0/home/al/snap/steam/common/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=1338580 -- /home/al/snap/steam/common/.local/share/Steam/ubuntu12_32/steam-launch-wrapper -- '/home/al/snap/steam/common/.local/share/Steam/steamapps/common/McPixel 3/bin/mcpixel3.sh'\0
chdir "/home/al/snap/steam/common/.local/share/Steam/steamapps/common/McPixel 3/bin/"

(steam:51872): GLib-GIO-CRITICAL **: g_settings_schema_source_lookup: assertion `source != NULL' failed
WARNING: discarding _NET_WM_PID 6109 as invalid for X11 window - use specialized XCB_X11_TO_PID function!

(steam:51872): GLib-GIO-CRITICAL **: g_settings_schema_source_lookup: assertion `source != NULL' failed

(steam:51872): GLib-GIO-CRITICAL **: g_settings_schema_source_lookup: assertion `source != NULL' failed
ERROR: ld.so: object '/home/al/snap/steam/common/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/al/snap/steam/common/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
ERROR: ld.so: object '/home/al/snap/steam/common/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/al/snap/steam/common/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/al/snap/steam/common/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
./mcpixel3: error while loading shared libraries: libasound.so.2: cannot open shared object file: No such file or directory

@ashuntu
Copy link
Collaborator

ashuntu commented Jan 8, 2024

Hmm, if that's an issue then it's also an issue with the edge channel. Give this one a shot: https://github.com/canonical/steam-snap/actions/runs/7453866820/artifacts/1155350402

@ali1234
Copy link
Author

ali1234 commented Jan 8, 2024

That one works.

(I still think it's more correct to not wipe LD_PRELOAD_PATH though.)

@ashuntu
Copy link
Collaborator

ashuntu commented Jan 8, 2024

That one works.

(I still think it's more correct to not wipe LD_PRELOAD_PATH though.)

Oh for sure, we'd greatly appreciate it if games didn't do that :).

For context, Northgard did the same thing and we added a workaround using the LD cache. The LD cache workaround should have still worked for this game as well, but it didn't because it was missing an audio path, so that's what you tested for me.

I'll close this issue once I get a fix in for the cache on our side, but yeah, we'd appreciate it if the launch script was changed as well.

@TheSos
Copy link

TheSos commented Jan 19, 2024

Does this mean I don't have to fix the .sh anymore? Apologies for the hold up, I got really sick.

@ashuntu
Copy link
Collaborator

ashuntu commented Jan 19, 2024

Does this mean I don't have to fix the .sh anymore? Apologies for the hold up, I got really sick.

You shouldn't have to, but I definitely would strongly recommend it if at all possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
game-specific The issue is related to a specific game or set of games type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants