Ticket #366 (closed enhancement: fixed)
Opened 5 years ago
Last modified 4 years ago
OpenAL - add native sound support - files attached needs review (03/04/2011)
| Reported by: | michaelvoliveira | Owned by: | scottmc |
|---|---|---|---|
| Priority: | normal | Milestone: | LibPak 1.0 |
| Component: | media-libs/openal | Version: | 1.0 |
| Severity: | normal | Keywords: | openal media kit |
| Cc: |
Description
The latest version of OpenAL builds ok on Haiku
but lacks of a media kit backend
adek336 has said that is necessary construct a BSoundPlayer instance and pass an appropriate function as the PlayBuffer? argument. Later check for success with InitCheck?; later use Start to start SetHasData?(true) to signal readiness.
Your PlayBuffer? function will have to pass buffers of audio to the media kit and it will have to get the buffer from OpenAL.
Maybe sndfile-play-beos.cpp created by marcus overhagen ages ago may serve as example
Attachments
Change History
Changed 5 years ago by michaelvoliveira
- attachment sndfile-play-beos.cpp added
comment:1 Changed 5 years ago by michaelvoliveira
Getting the following output
BMediaEventLooper: SchedulingLatency is 750 BMediaRoster::Connect connection established! BMediaRoster::GetParameterWebFor Unflattening 2946 bytes, 0x01030506, 0x00000001, 0x00000002, 0x00000003 BMediaRoster::ReleaseNode, trying to release reference counting disabled timesource, node 2, port 458902, team 39277 OpenAL backend info: Vendor: OpenAL Community Renderer: OpenAL Soft Version: 1.1 ALSOFT 1.12.854 Available sources: 256 Available buffers: 1024 or more Dynamic Sources: requested: 235, created: 235 #static sources: 21 #dyn sources : 235
Changed 5 years ago by michaelvoliveira
- attachment openal-soft-1.12.854.zip added
Sources for David
Changed 5 years ago by michaelvoliveira
- attachment openal-1.12.854.patch added
Patch file to enable g++ buildings with gmake. Introduced new Haiku Audio Functions. Adapted something from Solaris code. Being Mentored by David McPaul?.
comment:2 Changed 5 years ago by michaelvoliveira
By the way, is not working yet
But already detects Haiku, and builds & runs fine
output sound is the way
Changed 5 years ago by michaelvoliveira
- attachment opean-0.2004090900.patch added
patch to allow builds with gcc4. Correct lib name
Changed 5 years ago by michaelvoliveira
- attachment openal-0.2005080600.patch added
patch to allow builds with gcc4. Correct lib name
comment:3 Changed 5 years ago by scottmc
initial patch applied in r1039.
comment:4 Changed 5 years ago by scottmc
Added a .bep file to build from git in r1040. Once you get a patch that gives working sound for Haiku using the git version let me know.
Changed 5 years ago by scottmc
- attachment openal.zip added
patch from GCI student yeputons, to add native Haiku playback support
comment:5 Changed 4 years ago by michaelvoliveira
AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
IT WOOOORRKSSS flawlessly.
THANK YOU YEPUTONS!!! Now we have native OpenAL support
Unfortunately, I took so much time to check this
And now only a version released at january is supported
it means that this patch don't play any sound into the current git repository (almost 4 months later)
But, we can live with it until somebody comes and update it
Many thanks!
comment:6 Changed 4 years ago by michaelvoliveira
- Summary changed from OpenAL - add native sound support to OpenAL - add native sound support - files attached needs review (03/04/2011)
comment:7 Changed 4 years ago by michaelvoliveira
Some commentaries from OpenAL communith
KittyCat * the probe function isn't setting anything and consequently, the open function is only accepting a NULL name * and the ResetPlayback method needs to modify the ALCdevice with the parameters the player * also, only the _init, _deinit, and _probe methods need to be global. all the rest can be static and don't need to be extern "C" * alcGetString(NULL, ALC_DEVICE_SPECIFIER); returns a null-separated list of available devices * it's usually used to display a selection to the user, and an app may assume only the devices returned by that are selectable
Well, but it's working :P
comment:8 Changed 4 years ago by michaelvoliveira
More comments by KittyCat?:
Into HaikuResetPlayback: * how it takes dev->UpdateSize, divides it by frameSize (with rounding up), then squaring it * is fmt.buffer_size the total size of the buffer, or the size of each buffer update? * try tracing, and see whatHaikuPlayBufferCb keeps getting called with for buf_sz
Changed 4 years ago by michaelvoliveira
- attachment openal-1.13.bep added
.bep file for the final 1.13 version. Please note that current git versions aren't supported yet
Changed 4 years ago by michaelvoliveira
- attachment openal-1.13.patch added
comment:9 Changed 4 years ago by scottmc
- Resolution set to fixed
- Status changed from new to closed
applied in r1651. Thanks.

updated example.. actually it play sound!