From 2.71, BlenderPlayer can't quit when Jack is running (Ubuntu 14.04) #43214

Closed
opened 2015-01-11 21:32:42 +01:00 by Mario Mey · 24 comments

System Information
Ubuntu 14.04 64x
jackdmp 1.9.10
nVidia GT620

Blender Version
Broken: From 2.71
Worked: Up to 2.70

Short description of error
This was a a problem that I had talked with neXyon some years ago.

I start jackd or QjackCtl and I run BlenderPlayer. When trying to quit BlenderPlayer, it "freezes". When I close Jack server, BP unfreezes and quit.

He told me that it was a pulseaudio problem, he suggested me this:

//Don't use pulseaudio (prefered) or configure OpenAL to use pulseaudio directly via the ~/.alsoftrc configuration file with the content:

[general]
drivers = pulse//

So, after doing this, the problem was fixed (I don't remember the version of Blender). Uninstalling Pulseaudio, worked too. But now, I discovered that it is still there. Now, I'm working with BlenderPlayer 2.70, because it can quit. With 2.71 to 2.73, it can't.

In this version of Ubuntu (14.04), there is no way to uninstall Pulseaudio (it would uninstall everything). So, I tried different things, with no success:

1.- Starting Jack with
pasuspender -- jackd ... (or this sequence, inside Qjackctl as a prefix, too)

2.- Killing pulseaudio and avoiding to restart, doing:
echo "autospawn = no" > $HOME/.config/pulse/client.conf

**System Information** Ubuntu 14.04 64x jackdmp 1.9.10 nVidia GT620 **Blender Version** Broken: From 2.71 Worked: Up to 2.70 **Short description of error** This was a a problem that I had talked with neXyon some years ago. I start jackd or QjackCtl and I run BlenderPlayer. When trying to quit BlenderPlayer, it "freezes". When I close Jack server, BP unfreezes and quit. He told me that it was a pulseaudio problem, he suggested me this: //Don't use pulseaudio (prefered) or configure OpenAL to use pulseaudio directly via the ~/.alsoftrc configuration file with the content: [general] drivers = pulse// So, after doing this, the problem was fixed (I don't remember the version of Blender). Uninstalling Pulseaudio, worked too. But now, I discovered that it is still there. Now, I'm working with BlenderPlayer 2.70, because it can quit. With 2.71 to 2.73, it can't. In this version of Ubuntu (14.04), there is no way to uninstall Pulseaudio (it would uninstall everything). So, I tried different things, with no success: 1.- Starting Jack with pasuspender -- jackd ... (or this sequence, inside Qjackctl as a prefix, too) 2.- Killing pulseaudio and avoiding to restart, doing: echo "autospawn = no" > $HOME/.config/pulse/client.conf
Author

Changed status to: 'Open'

Changed status to: 'Open'
Joerg Mueller was assigned by Mario Mey 2015-01-11 21:32:42 +01:00
Author

Added subscriber: @MarioSottile

Added subscriber: @MarioSottile
Member

Added subscriber: @Blendify

Added subscriber: @Blendify

Added subscribers: @MartijnBerger, @ideasman42, @Sergey

Added subscribers: @MartijnBerger, @ideasman42, @Sergey

Don't have pulseaudio here, anyone from @ideasman42 or @MartijnBerger to test?

Don't have pulseaudio here, anyone from @ideasman42 or @MartijnBerger to test?
Author
  • Blender (not BlenderPlayer) do the same trying to quit. If I don't close Jack server, Blender doesn't quit, it freezes. Stopping Jack, Blender quits.

  • If I configure Blender to use None as sound (instead of OpenAL), the problem is not there. Blender quits OK. But only configuring it before starting Jack, because if...

  • I change to None, when Jack is running, again, it freezes... till I stop Jack.

  • Also, Jack doesn't appear as an option in stable version, from blender.org... but I think it is not a bug... it's on purpose? (I think this option was on earlier stable versions).


A long time ago, blenderplayer used to have an option "-g noaudio"... because it is still on examples of its help (2.73). At the end of the help, there are these examples (try it yourself):

//
...
example: bl-2.73/blenderplayer -w 320 200 10 10 -g noaudio /home/user/filename.blend
example: bl-2.73/blenderplayer -g show_framerate = 0 /home/user/filename.blend
example: bl-2.73/blenderplayer -i 232421 -m 16 /home/user/filename.blend
//

It would very usefull for this case, blenderplayer to have this option again. It would work as Blender with None as sound device. It wouldn't interere with Jack and it could quit OK.

- Blender (not BlenderPlayer) do the same trying to quit. If I don't close Jack server, Blender doesn't quit, it freezes. Stopping Jack, Blender quits. - If I configure Blender to use None as sound (instead of OpenAL), the problem is not there. Blender quits OK. But only configuring it before starting Jack, because if... - I change to None, when Jack is running, again, it freezes... till I stop Jack. - Also, Jack doesn't appear as an option in stable version, from blender.org... but I think it is not a bug... it's on purpose? (I think this option was on earlier stable versions). ---------------------- A long time ago, blenderplayer used to have an option "-g noaudio"... because it is still on examples of its help (2.73). At the end of the help, there are these examples (try it yourself): // ... example: bl-2.73/blenderplayer -w 320 200 10 10 -g noaudio /home/user/filename.blend example: bl-2.73/blenderplayer -g show_framerate = 0 /home/user/filename.blend example: bl-2.73/blenderplayer -i 232421 -m 16 /home/user/filename.blend // It would very usefull for this case, blenderplayer to have this option again. It would work as Blender with None as sound device. It wouldn't interere with Jack and it could quit OK.
Author

Examples with other programs: Audacious and Audacity, both using Alsa device to play:

Start Jack -> Start Audacious (ALSA) -> Close Audacious = OK
Start Jack -> Start Audacious (ALSA) -> Try to play: it doesn't play -> Close Audacious = OK

Start Jack -> Start Audacity (ALSA) -> Close Audacity = OK
Start Jack -> Start Audacity (ALSA) -> Try to play: it doesn't play -> Close Audacity = OK

Start Jack -> Start Blender (OpenAL) -> Close Blender = IT FREEZES
Start Jack -> Start Blender (OpenAL) -> Try to play with audio: playing but no audio -> Close Blender = IT FREEZES

It seems that, for quitting, Blender (OpenAL) requires access to the audio device (owned by Jack, at this moment) And, if it doesn't have it, it freezes till Jack gives it back to Blender. It's only my deduction.

Examples with other programs: Audacious and Audacity, both using Alsa device to play: Start Jack -> Start Audacious (ALSA) -> Close Audacious = OK Start Jack -> Start Audacious (ALSA) -> Try to play: it doesn't play -> Close Audacious = OK Start Jack -> Start Audacity (ALSA) -> Close Audacity = OK Start Jack -> Start Audacity (ALSA) -> Try to play: it doesn't play -> Close Audacity = OK Start Jack -> Start Blender (OpenAL) -> Close Blender = IT FREEZES Start Jack -> Start Blender (OpenAL) -> Try to play with audio: playing but no audio -> Close Blender = IT FREEZES It seems that, for quitting, Blender (OpenAL) requires access to the audio device (owned by Jack, at this moment) And, if it doesn't have it, it freezes till Jack gives it back to Blender. It's only my deduction.
Member

Hey,

I could reproduce the bug, but it's in OpenAL. I forwarded it and the developer said he'll fix it.

What happens is this: http://www.pasteall.org/56262

OpenAL won't quite as long as it doesn't get mixing requests, but pulseaudio doesn't send them because it doesn't have the output device.

Regards

Hey, I could reproduce the bug, but it's in OpenAL. I forwarded it and the developer said he'll fix it. What happens is this: http://www.pasteall.org/56262 OpenAL won't quite as long as it doesn't get mixing requests, but pulseaudio doesn't send them because it doesn't have the output device. Regards
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Author

Chris Robinson, OpenAL developer, said

*Yes, it's been fixed in commit http:*repo.or.cz/w/openal-soft.git/commit/290badea95fb7a971fbf6efdf792cc322128098a. There's no ETA for the next release yet, but there will be one. //

I clone git OpenAL source and compiled it... but Blender does the same.

It is about compiling Blender using OpenAL updated version? @neXyon?

Chris Robinson, OpenAL developer, said *Yes, it's been fixed in commit <http:*repo.or.cz/w/openal-soft.git/commit/290badea95fb7a971fbf6efdf792cc322128098a>. There's no ETA for the next release yet, but there will be one. // I clone git OpenAL source and compiled it... but Blender does the same. It is about compiling Blender using OpenAL updated version? @neXyon?
Member

Just compiling is not enough, you also have to install the library on your system! Which version of blender do you use? If you use one with statically linked OpenAL, then you have to build blender with your new OpenAL installed and properly configured as well.

Just compiling is not enough, you also have to install the library on your system! Which version of blender do you use? If you use one with statically linked OpenAL, then you have to build blender with your new OpenAL installed and properly configured as well.
Author

I compiled OpenAL by doing:

git clone git://repo.or.cz/openal-soft.git
cd openal-soft/build
cmake ..
make
sudo make install
sudo ldconfig

Now, I do "openal-info" and I get:

...
OpenAL version string: 1.1 ALSOFT 1.16.0
... 

But, in Synaptic, it still says "1:1.14-4ubuntu1". So... I don't know if it is correctly installed... if libopenal-dev is installed, too... I'm a bit confused. I'll ask Chris about this.

I'm working with 2.74 stable from blender.org. Is there any other version of Blender with no "statically linked OpenAL"?

I compiled OpenAL by doing: ``` git clone git://repo.or.cz/openal-soft.git cd openal-soft/build cmake .. make sudo make install sudo ldconfig ``` Now, I do "openal-info" and I get: ``` ... OpenAL version string: 1.1 ALSOFT 1.16.0 ... ``` But, in Synaptic, it still says "1:1.14-4ubuntu1". So... I don't know if it is correctly installed... if libopenal-dev is installed, too... I'm a bit confused. I'll ask Chris about this. I'm working with 2.74 stable from blender.org. Is there any other version of Blender with no "statically linked OpenAL"?
Member

The official releases on the website have statically linked OpenAL. If you have ubuntu 15.04 you could try their blender package (http://packages.ubuntu.com/wily/blender) which is 2.74 too and might have dynamically linked OpenAL. The OpenAL installation you have seems fine, as openal-info shows the proper version.

The official releases on the website have statically linked OpenAL. If you have ubuntu 15.04 you could try their blender package (http://packages.ubuntu.com/wily/blender) which is 2.74 too and might have dynamically linked OpenAL. The OpenAL installation you have seems fine, as openal-info shows the proper version.
Author

Ups... I have Ubuntu 14.04. I prefer LTS versions.

How do I know if it has dinamically linked OpenAL? (You are the only one who can know something like that...)

Ups... I have Ubuntu 14.04. I prefer LTS versions. How do I know if it has dinamically linked OpenAL? (You are the only one who can know something like that...)
Member

With the command ldd you can find out which libraries are dynamically linked. Here my self built blender:

% ldd bin/blender | grep -i openal
        libopenal.so.1 => /usr/lib/libopenal.so.1 (0x00007f2ddafce000)

versus the official release:

% ldd blender | grep -i openal

which shows no output, as the library is linked statically.

With the command ldd you can find out which libraries are dynamically linked. Here my self built blender: ``` % ldd bin/blender | grep -i openal libopenal.so.1 => /usr/lib/libopenal.so.1 (0x00007f2ddafce000) ``` versus the official release: ``` % ldd blender | grep -i openal ``` which shows no output, as the library is linked statically.

Changed status from 'Archived' to: 'Open'

Changed status from 'Archived' to: 'Open'

The updated OpenAL library still isnt distributed with blender.org builds according to @MarioSottile, re-openeing and assigning to blender-next project, so its not forgotten.

The updated OpenAL library still isnt distributed with blender.org builds according to @MarioSottile, re-openeing and assigning to blender-next project, so its not forgotten.
Author

I built OpenAl 1.16.0 and, as @ideasman42 told me, I configured CMakeCache.txt to:

//Path to a file.
OPENAL_INCLUDE_DIR:PATH=/include/AL

//Path to a library.
OPENAL_LIBRARY:FILEPATH=/lib/libopenal.so

(because OpenAL installed the files in that location)

Then, I compiled Blender to last version f337fea and... "voilà", Blender and BlenderPlayer can quit while Jack is running!

@neXyon, your hypothesis was correct. Now, I realized that I built Blender without BlenderPlayer... and that's exactly what I need. I'm building again with BP and testing it. I'm reporting here when I finish.

EDIT: I built BlenderPlayer and it seems to work OK! It can quit perfectly (I'm having some "segment faults" but I also have some errors from my code. If the segment faults still ocurrs, it is maybe about something else, not this "bug")

I built OpenAl 1.16.0 and, as @ideasman42 told me, I configured CMakeCache.txt to: ``` //Path to a file. OPENAL_INCLUDE_DIR:PATH=/include/AL //Path to a library. OPENAL_LIBRARY:FILEPATH=/lib/libopenal.so ``` (because OpenAL installed the files in that location) Then, I compiled Blender to last version f337fea and... "voilà", **Blender and BlenderPlayer can quit while Jack is running!** @neXyon, your hypothesis was correct. Now, I realized that I built Blender without BlenderPlayer... and that's exactly what I need. I'm building again with BP and testing it. I'm reporting here when I finish. EDIT: I built BlenderPlayer and it seems to work OK! It can quit perfectly (I'm having some "segment faults" but I also have some errors from my code. If the segment faults still ocurrs, it is maybe about something else, not this "bug")

Blender is statically linked against OpenAL-soft 1.6.0 which is according to - [x] is the latest version. It is possible that there's difference in binary protocol which confuses Jack, and the only way to solve this would be to dynamically dlopen() the openal library.

Blender is statically linked against OpenAL-soft 1.6.0 which is according to - [x] is the latest version. It is possible that there's difference in binary protocol which confuses Jack, and the only way to solve this would be to dynamically `dlopen()` the openal library. - [x] http://kcat.strangesoft.net/openal.html#download
Member

Nah, 1.6.0 is old, 1.16.0 is the current version.

Nah, 1.6.0 is old, 1.16.0 is the current version.

@neXyon, eeeeeh, what an embarrassing typo :S It is "1.16.0", just one of the ones didn't type properly.

Once again: it is in fact openal-soft-1.16.0. So, any ideas what's wrong? :)

@neXyon, eeeeeh, what an embarrassing typo :S It is "1.16.0", just one of the ones didn't type properly. Once again: it is in fact openal-soft-1.16.0. So, any ideas what's wrong? :)
Member

Is this still a problem with 2.78a?

Is this still a problem with 2.78a?
Author

As my computer state is right now, the problem persists in 2.78a.

Consider that:

  • openal-info returns me OpenAL version string: 1.1 ALSOFT 1.14. I thought I had installed 1.16 version (as I said above)... so, I don't know why it says 1.14.
  • sudo apt-get install libopenal1 says that I have the most recent version (but openAL download page has 1.17.2). So, with openAL from Ubuntu (I have UbuntuMate 14.04), the problem still there.
  • If a recent version of Ubuntu has a recent version of OpenAL... then, maybe, mightbe, likely... it should work. But, right now, I can't say that.

I will have this report as non-read mail to check it again in the future. Now... I have a lot of work to do.

As my computer state is right now, the problem persists in 2.78a. Consider that: - `openal-info` returns me `OpenAL version string: 1.1 ALSOFT 1.14`. I thought I had installed 1.16 version (as I said above)... so, I don't know why it says 1.14. - `sudo apt-get install libopenal1` says that I have the most recent version (but openAL download page has 1.17.2). So, with openAL from Ubuntu (I have UbuntuMate 14.04), **the problem still there**. - If a recent version of Ubuntu has a recent version of OpenAL... then, maybe, mightbe, likely... it should work. But, right now, I can't say that. I will have this report as non-read mail to check it again in the future. Now... I have a lot of work to do.
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#43214
No description provided.