GithubHelp home page GithubHelp logo

Comments (7)

JWorthe avatar JWorthe commented on September 14, 2024 2

I had the same issue on Arch Linux. It ended up being a bug in the version 2.0.2 of sdl2_mixer. I got it working by rolling back to sld2_mixer 2.0.1.

The bug appears in their bugtracker and looks like it's been fixed, but I'm not sure how to see if the fix has been released or what version it was released in.
https://bugzilla.libsdl.org/show_bug.cgi?id=3929

from gate.

OtherAesop avatar OtherAesop commented on September 14, 2024 1

For anyone trying to run this on a Windows machine I found the following fix (though this does lead to another bug).

Right out of the box it seemed like rustup needed SDL2 lib and dll files to even attempt rendering. The SDL2_mixer-2.0.2 version is bugged as noted above and the files from the 2.0.1 version must be used. The following files were added to the rustup toolchain lib location (i.e. the furthest thing down the rabbit hole of rustup)

I have linked the current location of the files I used for your convenience.
https://www.libsdl.org/release/SDL2-devel-2.0.8-VC.zip
https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.3-VC.zip
https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-devel-2.0.1-VC.zip (DO NOT use 2.0.2)

For any other Windows readers just drop these in rustup's library folder. It should look something like this on your machine.
"C:\Users[USERNAME].rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib"

This fixes the linker error but leads to a bug in SDL2 and/or

from gate.

SergiusIW avatar SergiusIW commented on September 14, 2024 1

Thanks everyone for the details. I have observed the same problem when I upgraded to sdl2-mixer v2.0.2. The thread that @JWorthe linked to ( https://bugzilla.libsdl.org/show_bug.cgi?id=3929 ) suggests a workaround for v2.0.2: ignoring the error flag of Mix_Init. It is definitely a hacky solution, but it should be fine as a stopgap solution until v2.0.3 is released. I will upload a commit shortly that fixes this issue.

from gate.

SergiusIW avatar SergiusIW commented on September 14, 2024

Hi! Sounds like an SDL2 issue, which I'm not an expert at. I've only been developing on Ubuntu so I don't have experience with the MacOS install. A quick search led me to this stackoverflow post https://stackoverflow.com/questions/35102599/no-sound-using-sdl2-mixer-from-homebrew. Seems there are some options you can use when invoking brew install sdl2_mixer, in particular the --with-libvorbis option (libvorbis is an OGG decoder). Let me know if that works.

from gate.

dortamiguel avatar dortamiguel commented on September 14, 2024

I installed it now like this with all the options but I still get the same result.

brew install SDL2_mixer --with-flac --with-fluid-synth --with-libmikmod --with-mpg123

It looks like libvorbis is no longer an option.

from gate.

booyaa avatar booyaa commented on September 14, 2024

libvorbis is a mandatory requirement so homebrew will install it if it's absent:

$ brew info sdl2_mixer
sdl2_mixer: stable 2.0.2 (bottled), HEAD
Sample multi-channel audio mixer library
https://www.libsdl.org/projects/SDL_mixer/
/usr/local/Cellar/sdl2_mixer/2.0.2_3 (10 files, 307.8KB) *
  Poured from bottle on 2018-04-21 at 11:17:00
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/sdl2_mixer.rb
==> Dependencies
Build: pkg-config ✔
Required: libmodplug ✔, libvorbis ✔, sdl2 ✔

note the checkmark.

I'm experiencing the same problem, I'm going to try to isolate the problem. Oddly enough the wasm version works fine.

update: I should probably point out I don't think this is an issue with gate, rather it's a bad homebrew binding to sdl2_mixer.
update 2: I was able to get an ogg track to play using the reference example mixer-demo.rs. I've created a standalone example to prove it's not an issue with the SDL2 crate for either v0.29 (which gate uses) or v0.31 which is current.

from gate.

lourinaldi avatar lourinaldi commented on September 14, 2024

@ellipticaldoor the trick is to brew reinstall sdl2_mixer --HEAD to get that bug fix.

from gate.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.