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

Freeze on export using PortAudio backend #5919

Open
HardwareHaquer opened this issue Feb 23, 2021 · 17 comments
Open

Freeze on export using PortAudio backend #5919

HardwareHaquer opened this issue Feb 23, 2021 · 17 comments

Comments

@HardwareHaquer
Copy link

Searching through the Issues I found a similar problem listed in Linux with JACK, but as this is a different OS and backend I thought I should make a report.

Bug Summary

When exporting a wav file with PortAudio as the backend the export will complete to 95% and then LMMS will hang forever. Have to force quit. However, the wav file successfully exports, yay!

Steps to reproduce

  1. Choose PortAudio as the Audio interface. 2. Export as WAV with default settings.

Expected behavior

No crash on Export

Actual behavior

Crash

Screenshot

Affected LMMS versions

LMMS 1.2.2

Logs

Click to expand: Last two lines of log not sure if the first is involved.
QMetaMethod::invoke: Unable to handle unregistered datatype 'MidiTime'
PortAudio error: Stream is not stopped
@ExperiBass
Copy link
Contributor

wait wasnt MidiTime renamed in #5684? @M374LX, you might wanna look at this

@ExperiBass
Copy link
Contributor

Successfully reproduced using 1.14 build on 1.14.6, will compile latest master later to see if its still there

@ExperiBass
Copy link
Contributor

ExperiBass commented Apr 27, 2021

Reproduced on latest master (89fc6c9). Logs below

Input device: 'Streaming' backend: 'Core Audio'
Output device: 'Streaming' backend: 'Core Audio'
PERFLOG |       Project Render | 0.10user, 0.06system 0.07elapsed
PortAudio error: Stream is not stopped

@M374LX
Copy link
Contributor

M374LX commented Apr 30, 2021

As 1.2.2 was released before MidiTime was renamed to TimePos, it does not seem to be related.

I have had no success in trying to reproduce the problem on the latest master on Linux. Was it reproduced only on OSX?

@ExperiBass
Copy link
Contributor

yes, i havent had a issue on Mint.

@jimstutt
Copy link

I'm not using portaudio but hit a similar or the possibly the same bug. Export .wav or .mp3 (haven't tried .ogg) exports successfully but hangs LMMS and forces quit. I tried it with loops marked and the "export between loop markers" box ticked with the same result.

lmms --version: LMMS 1.2.2
(Linux x86_64, Qt 5.12.8, GCC 9.3.0)

jackd --version: jackdmp version 1.9.12 tmpdir /dev/shm protocol 8
jim@jim-HP-Pavilion-Laptop-14-bk0xx:~$

pasuspender --
jackd -d alsa --device hw:0 --rate 44100 --period 128
&>/tmp/jackd.out &

pulseaudio --version: pulseaudio 13.99.1

lsb_release:

Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal

@ExperiBass
Copy link
Contributor

@jimstutt could you try building the latest master version? If not I'll build and package for you

@jimstutt
Copy link

@ExperiBass tnx for the offer to build the latest version. I'll certainly test it if you do and notify me. Sorry I haven't got the mileage to do it myself atm.

@ExperiBass
Copy link
Contributor

@jimstutt i wasnt able to build the appimage (im assuming its cause im not using ubuntu), so youll have to download the zip, extract it, cd into it, and then run ./lmms. https://mega.nz/file/kVtGVKiY#kbF5vzfdSyXiKdLpaC9sV8RfFqdcggpXZnH7-DJQWvk

@jimstutt
Copy link

Did that but:
I renamed build LMMS but:
"./lmms
./lmms: error while loading shared libraries: libsoundio.so.2: cannot open shared object file: No such file or directory"
~/Dev/LMMS$ ./lmms
Searched for libsoundio on ubuntu on askubuntu, stackexchange but nfu. Seems ubuntu's only got so.1
~/Dev/LMMS$ ldconfig -p | grep libsoundio
libsoundio.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libsoundio.so.1
Is there an obvious fix by tweaking some file in the download?

@ExperiBass
Copy link
Contributor

ah i see, im using arch so my packages are a bit newer. Let me re-compile in my Mint VM, sorry bout that!

@ExperiBass
Copy link
Contributor

or not. i cant seem to get it to build a appimage or work outside of my vm...

@luzpaz
Copy link
Contributor

luzpaz commented Jul 26, 2023

Is this still relevant ?

@ExperiBass
Copy link
Contributor

doesn't seem so, i just built gc53f3d981 on macOS 13.4, exporting worked fine.

@luzpaz
Copy link
Contributor

luzpaz commented Jul 27, 2023

Close issue please

@zonkmachine
Copy link
Member

I'm tagging this as possible macos as I've been bumped on the topic. (Now unsubscribing... ;-)

@tresf
Copy link
Member

tresf commented Oct 23, 2023

No, this bug is not fixed and seems to have been incorrectly closed in #4864. It also occurs for other formats. Title updated.

PERFLOG |       Project Render | 0.06user, 0.14system 0.07elapsed
PortAudio error: Stream is not stopped

image image

I'm not sure if this is still valid or even related, but I found a possible explanation from 14 years ago:

I also noticed the same behavior when I was using DirectSound through PortAudio a few months ago, the implementation is sort of broken when it comes to stopping the stream properly. I solved it by inserting x milliseconds of silence after my actual audio was meant to stop, x being the set delay for the device which in my case was 50 milliseconds. So in short, when I wanted to stop it smoothly I wrote the 50 milliseconds silence to my ring buffer and then set a flag that made the callback return paComplete, and then waited for the stream not to be active. Since the stream stops a little before all data has been played, this made the stream stop almost exactly after the real data had finished without crackling since there was just silence there.

I hope this rant made some kind of sense.

@tresf tresf changed the title LMMS 1.2.2 OSX 10.14.6 - Freeze on export Wav file using PortAudio backend Freeze on export using PortAudio backend Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants