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

Crash importing audio on Fedora Linux #2308

Closed
ghost opened this issue Oct 1, 2018 · 9 comments · Fixed by #3264
Closed

Crash importing audio on Fedora Linux #2308

ghost opened this issue Oct 1, 2018 · 9 comments · Fixed by #3264

Comments

@ghost
Copy link

ghost commented Oct 1, 2018

Issue Summary

I am using OpenToonz 1.2.1 on Fedora 28 KDE on a baseline ThinkPad X380, and whenever I try to import audio, the program acts up. When I import an MP3 (I have ffmpeg), the audio is imported as being one frame long, and when I try to play it back using the grate thing on the right of the XSheet column (I'm new to OpenToonz), the program crashes entirely.

I don't know if this is a problem on my end or yours; I've already tried reinstalling PulseAudio from scratch (given the penultimate line of the traceback and some frantic Googling).

Steps to Reproduce

  1. Open OpenToonz; ensure that ffmpeg is installed and configured.
  2. Use drag-and-drop to load an MP3 into the XSheet.
  3. Try to play it back.

Expected Results

When the audio is loaded, it takes up as many frames as are needed to account for the time it takes; it can be played back.

Actual Results

When the audio is loaded, it shows up as occupying a single frame, regardless of length. When an attempt to play it back is made, the program crashes.

I have the traceback of the last session where I tried to do it:

Qt: Session management error: Could not open network socket
plugin search directory:/home/[me]/.config/OpenToonz/stuff/plugins
walkDirectory_: /home/[me]/.config/OpenToonz/stuff/plugins
===== PluginLoadController::finished() =====
plugin search directory:/home/[me]/.config/OpenToonz/stuff/plugins
walkDictionary: /home/[me]/.config/OpenToonz/stuff/plugins [dry]
QFileSystemWatcher::addPath: path is empty
/run/build/opentoonz/toonz/sources/toonz/iocommand.cpp:loadScene Progressing:
/run/build/opentoonz/toonz/sources/toonz/iocommand.cpp:loadScene end load:
/run/build/opentoonz/toonz/sources/toonz/iocommand.cpp:loadScene loadScene() completed :
QString::arg: Argument missing: Always do this action., /home/[me]/Desktop/anime crisis.mp3
QSettings::setValue: Empty key passed
QSettings::setValue: Empty key passed
PulseAudioService: pa_context_connect() failed
terminate called after throwing an instance of 'TException'

System Information

  • OpenToonz Version: 1.2.1 (Flathub flatpak)
  • Operating System: Fedora 28 w/ KDE
  • CPU: Intel Core i7 8th Gen (x4)
  • Memory: 8 GB RAM
  • Graphics Tablet: Whatever comes with the baseline X380; some sort of Wacom something (would that I could be more specific)
@ghost ghost changed the title Trying to import audio crashes program Trying to import audio on Fedora Linux crashes program Oct 1, 2018
@artisteacher
Copy link
Contributor

If you use the most recent Morevna release, do you have the same result? I know there is a Linux audio fix from @morevnaproject waiting to be merged.

@ghost
Copy link
Author

ghost commented Oct 1, 2018 via email

@artisteacher
Copy link
Contributor

Make sure your FFmpeg path goes to the parent directory:
screen shot 2018-10-01 at 1 33 39 pm

I believe both aiff and mp3 files are converted to a wav format once they are in OpenToonz. How are you changing the volume - in the column header? @blackwarthog may be able to help with the crashing.

@RodneyBaker RodneyBaker changed the title Trying to import audio on Fedora Linux crashes program Crash importing audio on Fedora Linux Dec 6, 2018
@DavidDuncker
Copy link

I'm using Ubuntu Linux. Opentoonz crashes the second I click either "Load" or "Import" to create a level made of sound.
I have gone so far as to reinstall Opentoonz numerous times, and run Opentoonz through GDB debugger. Here is the stack trace:

(gdb) bt
#0 0x00007ffff2db6077 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007ffff2d97535 in __GI_abort () at abort.c:79
#2 0x00007ffff3194957 in () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007ffff319aaa6 in () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007ffff3199b09 in () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007ffff319a4b8 in gxx_personality_v0 () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00007ffff2f6fd73 in () at /lib/x86_64-linux-gnu/libgcc_s.so.1
#7 0x00007ffff2f705f5 in _Unwind_Resume () at /lib/x86_64-linux-gnu/libgcc_s.so.1
#8 0x00007ffff332657b in () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#9 0x00007ffff60f8ab3 in TXsheetHandle::xsheetChanged() (this=0x555557e0a560)
at /home/dave/opentoonz/toonz/build/toonzlib/
/include/toonz/moc_txsheethandle.cpp:155
#10 0x00005555559e9790 in TXsheetHandle::notifyXsheetChanged() (this=0x555557e0a560)
at /home/dave/opentoonz/toonz/sources/include/toonz/txsheethandle.h:38
#11 0x0000555555cc10ce in IoCmd::LoadResourceArguments::ScopedBlock::~ScopedBlock()
(this=0x7fffffffc828, __in_chrg=) at /home/dave/opentoonz/toonz/sources/toonz/iocommand.cpp:2194
#12 0x00005555559b4376 in boost::optional_detail::optional_baseIoCmd::LoadResourceArguments::ScopedBlock::destroy_impl() (this=0x7fffffffc820) at /usr/include/boost/optional/optional.hpp:753
#13 0x00005555559b398d in boost::optional_detail::optional_baseIoCmd::LoadResourceArguments::ScopedBlock::destroy() (this=0x7fffffffc820) at /usr/include/boost/optional/optional.hpp:739
#14 0x00005555559b31da in boost::optional_detail::optional_baseIoCmd::LoadResourceArguments::ScopedBlock::~optional_base() (this=0x7fffffffc820, __in_chrg=) at /usr/include/boost/optional/optional.hpp:237
#15 0x00005555559b2e30 in boost::optionalIoCmd::LoadResourceArguments::ScopedBlock::~optional()
(this=0x7fffffffc820, __in_chrg=) at /usr/include/boost/optional/optional.hpp:829
#16 0x0000555555cc269d in IoCmd::loadResources(IoCmd::LoadResourceArguments&, bool, IoCmd::LoadResourceArguments::Sc------------Type for more, q to quit, c to continue without paging--
opedBlock*, int, int, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, int, int, int, bool, IoCmd::CacheTlvBehavior)
(args=..., updateRecentFile=true, sb=0x7fffffffc828, xFrom=-2, xTo=-2, levelName=L"maybe-next-time-huh", step=0, inc=0, frameCount=1, doesFileActuallyExist=true, cachingBehavior=IoCmd::ON_DEMAND)
at /home/dave/opentoonz/toonz/sources/toonz/iocommand.cpp:2235
#17 0x0000555555ba44ba in LoadLevelPopup::execute() (this=0x55555d50aeb0)
at /home/dave/opentoonz/toonz/sources/toonz/filebrowserpopup.cpp:1152
#18 0x0000555555b9cc34 in FileBrowserPopup::onOkPressed() (this=0x55555d50aeb0)
at /home/dave/opentoonz/toonz/sources/toonz/filebrowserpopup.cpp:263
#19 0x0000555555e5682a in FileBrowserPopup::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)
(_o=0x55555d50aeb0, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x7fffffffce40)
at /home/dave/opentoonz/toonz/build/toonz/moc_filebrowserpopup.cpp:98
#20 0x00007ffff35266db in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#21 0x00007ffff44657a2 in QAbstractButton::clicked(bool) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#22 0x00007ffff44659ba in () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#23 0x00007ffff4466d7f in () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#24 0x00007ffff4466f55 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#25 0x00007ffff43bd7d8 in QWidget::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#26 0x00007ffff437f4a1 in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#27 0x00007ffff4386d28 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#28 0x00007ffff34fd499 in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#29 0x00007ffff4386029 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<--Type for more, q to quit, c to continue without paging--
QWidget>&, bool) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#30 0x00007ffff43d8304 in () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#31 0x00007ffff43dae8e in () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#32 0x00007ffff437f4a1 in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#33 0x00007ffff4386ae0 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#34 0x00007ffff34fd499 in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#35 0x00007ffff3aa853b in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) ()
at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#36 0x00007ffff3aaa435 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*)
() at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#37 0x00007ffff3a84b6b in QWindowSystemInterface::sendWindowSystemEvents(QFlagsQEventLoop::ProcessEventsFlag) ()
at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#38 0x00007fffe836ae5b in () at /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#39 0x00007ffff34fc16b in QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) ()
at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#40 0x00007ffff35042e2 in QCoreApplication::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#41 0x00005555559bb473 in main(int, char**) (argc=1, argv=0x7fffffffdea8)
at /home/dave/opentoonz/toonz/sources/toonz/main.cpp:741
(gdb)

@RodneyBaker
Copy link
Collaborator

@4of92000 @DavidDuncker
If it is an option you might test with the latest linux release of OTX:

https://github.com/manongjohn/OTX/releases

@bkmgit
Copy link
Contributor

bkmgit commented Jan 1, 2020

Built commit ebfbb9c from scratch on Fedora 30. Then install ffmpeg from Fedora repositories. It seemed to playback ok.

@RodneyBaker RodneyBaker added this to Open / Unassigned in Crash and Show Stopping Bugs Jan 6, 2020
@RodneyBaker
Copy link
Collaborator

No recent update on this issue...

audio is imported as being one frame long

The 'one frame long' symptom suggests ffmpeg is not connecting to Opentoonz properly.

@Toondad
Copy link
Contributor

Toondad commented Apr 19, 2020

I'm using Debian Buster and get the same issue. Drag and drop a sound file or loading a sound level get the process to an abort signal.
I have given a try to OTX with the exact same result.
At the moment I am struggling with the debugger trying to corner the issue but I am still unsuccessful.
Any help would be very appreciated to orient my investigations.

One difference from 4of92000 symptoms is I don't get to the one frame long sound level step: OT hangs up as soon as I drop the file to the frame. The backtrace is similar to DavidDuncker's one.

@Toondad
Copy link
Contributor

Toondad commented Apr 22, 2020

I solved my issue by installing the QAudio backends so, in a nutshell, what is needed is:
apt-get install libqt5multimedia5-plugins

Now, I suggest to add this package to the list in doc/how_to_build_linux.md.

Also I think OT should not hang up because of an external setup, so I suggest throwing an exception when an empty device is found and catching it upper in the frame stack to print a warning and a few hints. I do not have the necessary knowledge about OT architecture to present a decent patch but I can suggest:

  • Adding a NoDevice member to the TSoundDeviceException in source/include/tsound.h

  • Inserting a test at line 1009 in file source/toonzlib/txshsoudcolumn.cpp that could look like:

if (info.deviceName().length() == 0) throw TSoundDeviceException(TSoundDeviceException::NoDevice, "No device found, check QAudio backends" )

  • catching the exception at every relevant place

I made this patch to present the idea. It stays silent when the QAudio backends are properly installed and prevent OT from crashing when they are not.
no_device.patch.txt

Do OpenToonz gurus think it worth a branch and pull request ?

Toondad added a commit to Toondad/opentoonz that referenced this issue Apr 29, 2020
@RodneyBaker RodneyBaker moved this from Open / Unassigned to In Progress / Known Issue in Crash and Show Stopping Bugs Sep 27, 2020
@RodneyBaker RodneyBaker moved this from In Progress / Known Issue to Closed in Crash and Show Stopping Bugs Sep 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

5 participants