lovebrew / lovepotion

LÖVE for Nintendo Homebrew
https://lovebrew.org
Other
536 stars 39 forks source link

[Bug]: Calling `Source:stop()` on a sound that hasn't been started yet causes the console to lock up #226

Closed Nawias closed 3 weeks ago

Nawias commented 5 months ago

Software Version

3.0.1

What Happened?

As in the title, calling Source:stop() when it hasn't been started yet causes the whole console to lock up. The only way to exit the game is to hold the power button or use Luma3DS's menu to reboot.

What was Expected?

In 2.4.x and in regular LÖVE, calling Source:stop() on an unplayed sound source does nothing. This can be used to preemptively restart a Source when its current state is unknown.

Code to Reproduce

local soundSource = nil
function love.load()
  soundSource = love.audio.newSource("assets/sound/menu.ogg") -- use any other source
  soundSource:stop()
end

function love.draw(screen)
  local width, height = love.graphics.getDimensions(screen)
  love.graphics.print('Hello World!', width / 2, height / 2)
end

function love.gamepadpressed(joystick, button)
  love.event.quit()
end

Console

Nintendo 3DS

Firmware Version(s)

11.17.0-50E

Custom Firmware Version

11.0

Execution Method

Homebrew Menu

Code of Conduct

Nawias commented 5 months ago

Forgot to add. Console locking up also means a completely black screen. Running the provided example will show that the "Hello World" text won't show up at all.

Nawias commented 3 weeks ago

Update: this also happens when calling :stop() on sources that are playing. So Source:stop() just seems to lock up the console no matter what. Tested both on LP 3.0.1 latest and the latest beta 3.1 (Commit 55f91c).

Nawias commented 3 weeks ago

Looks like I made a mistake testing 3.1, it works there. The issue should be fixed with commit df78c.