Page MenuHome

From 2.71, BlenderPlayer can't quit when Jack is running (Ubuntu 14.04)
Open, Confirmed, MediumPublic

Description

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

Details

Type
Bug

Event Timeline

Mario Mey (mariomey) set Type to Bug.
Mario Mey (mariomey) created this task.
Mario Mey (mariomey) raised the priority of this task from to Needs Triage by Developer.
  • 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.

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.

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

Joerg Mueller (nexyon) closed this task as Invalid.Jan 22 2015, 6:54 AM

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? @Joerg Mueller (nexyon)?

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.

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"?

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.

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...)

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.

Campbell Barton (campbellbarton) reopened this task as Open.
Campbell Barton (campbellbarton) raised the priority of this task from Normal to Confirmed, Medium.

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

Mario Mey (mariomey) added a comment.EditedNov 10 2015, 4:39 AM

I built OpenAl 1.16.0 and, as @Campbell Barton (campbellbarton) 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!

@Joerg Mueller (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 [1] 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.

[1] http://kcat.strangesoft.net/openal.html#download

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

@Joerg Mueller (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? :)

Is this still a problem with 2.78a?

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.