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

Issue with multiple players #70

Open
fred-dev opened this issue Apr 28, 2021 · 6 comments
Open

Issue with multiple players #70

fred-dev opened this issue Apr 28, 2021 · 6 comments
Assignees
Labels

Comments

@fred-dev
Copy link

I want to use a ping pong system of multiple players to get seamless playback. There would be several pairs of players - all playerFronts and playerBacks are loaded on startup. When playerFronts[0] is done, playerbacks[0] is displayed (it is already loaded), playerFronts[0] should then load and wait until playerbacks[0] is done and around we go.

When I try to load a player while the rest are running everything crashes.

When I try this with a single player I can call load pretty much any time without stopping and it will load incredibly fast and efficiently.

Is there something I need to do to load on the fly while using multiple players?

@bangnoise
Copy link
Owner

Which OF version and OS?
Can you provide the simplest possible project which reproduces this issue?

@fred-dev
Copy link
Author

fred-dev commented May 5, 2021

I am on OSX 10.15.7 (19H15) with OF 0.11.2
Here is a basic example https://github.com/fred-dev/ofxHapPlayer_PingPong_test
I am using hap movies with aac audio converted with AVF Batch Converter - using just the built in sound card on a macbook pro.

@bangnoise
Copy link
Owner

bangnoise commented May 5, 2021

Ah yeah, I see multiple issues - just as a note to myself: there's bad usage of std::condition_variable, plus deadlock when audio threads are destroyed, plus deadlock if you destroy a Demuxer and it tries to call foundMovie() before it dies.

Even once that's fixed, multiple audio streams have their own issues and it'll require a fairly hefty workaround due to limitations in OF - as detailed in #29.

@fred-dev
Copy link
Author

fred-dev commented May 6, 2021

Hi cool, I saw the thread, it is a difficult issue. It does not solve the deeper problem but Roy Macdonald made some small changes and has a fork of this repo to make this work with ofxSoundObjects , connecting to a single instance of ofSoundstream

https://github.com/roymacdonald/ofxHapPlayer/tree/ofxSoundObjects_integration

. As I said it does not solve the deeper problem and makes using ofxHapPlayer with audio somewhat more complex, but very flexible as it allows for multichannel routing.

@bangnoise
Copy link
Owner

OK I'll fix the problems with deadlock and crashing in this issue when I get time - if nobody beats me to it.

@dimitre
Copy link

dimitre commented May 6, 2021

Not sure if it helps but the issue was always triggered by video closing (if I load another video file in the same ofxHapPlayer object or in program exit)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants