Opened 15 years ago

Closed 13 years ago

#5093 closed bug (fixed)

[patch] BPushGameSound is not working correctly...

Reported by: bmkx Owned by: axeld
Priority: normal Milestone: R1
Component: Kits/Game Kit Version: R1/alpha1
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

...and this is why I think they completely disabled sound in BeVICE (www.viceteam.org) under Haiku for now. I'm posting two patches I came up with after some digging in the code. First one is pretty obvious and only fixes some oversights. The second one is rather a proposal that maybe needs some more explanation. I'll post soon on developer mailing list.

Attachments (3)

PushGameSound.patch (1.3 KB ) - added by bmkx 15 years ago.
Small fixes for BPushGameSound
game_kit_sound.patch (8.2 KB ) - added by bmkx 15 years ago.
Proposal of some more fixes
push_game_sound_test.zip (2.7 KB ) - added by bmkx 15 years ago.
simple playback test

Download all attachments as: .zip

Change History (19)

by bmkx, 15 years ago

Attachment: PushGameSound.patch added

Small fixes for BPushGameSound

by bmkx, 15 years ago

Attachment: game_kit_sound.patch added

Proposal of some more fixes

comment:1 by axeld, 15 years ago

The second patch breaks binary compatibility; you cannot replace an existing method of a public API.

From a first glance, the first patch looks good. Is there any test program for the BPushGameSound? If not, we should definitely add one to our repository.

comment:2 by bmkx, 15 years ago

No, I'm afraid I don't have one. I used BeVICE to test it.

comment:3 by axeld, 15 years ago

Didn't notice the GameDevice.h header to be private.

by bmkx, 15 years ago

Attachment: push_game_sound_test.zip added

simple playback test

comment:4 by bmkx, 15 years ago

I've added console app for testing playback with BPushGameSound. It uses BMediaTrack to provide some raw audio data. One can also test different values for frames per buffer part and buffer parts, these can be passed as optional parameters.

comment:5 by axeld, 15 years ago

Owner: changed from marcusoverhagen to axeld
Status: newassigned

Thanks! I'll look into it tomorrow.

comment:6 by axeld, 15 years ago

Your patch has a few issues like unsafe access to a shared member (fPlayPos). The test application seems to have issues as well, though. Don't have time today anymore.

Also, the media server obviously needs to be restarted after each run, or else the BGameSoundDevice will fail to initialize. This is not related, I just wanted to mention it.

I will look into those issues in the next days.

comment:7 by bmkx, 15 years ago

You mean there: fPlayPos += bytes; fPlayPos %= fBufferSize; yes? :)

Just a note: I don't need to restart media server, it plays each time just fine. Still using a1r1 though. There's an issue with test application when run on system w/o available audio output, it stalls on BGameSoundDevice's StartPlayback, AFAIR.

comment:8 by mmadia, 15 years ago

Summary: BPushGameSound is not working correctly...[patch] BPushGameSound is not working correctly...

comment:9 by nielx, 14 years ago

patch: 1

comment:10 by nielx, 14 years ago

(this is a test, please ignore)

comment:11 by michaelvoliveira, 14 years ago

Some progress in this one lately? I mean in provide a better patch?

comment:12 by bmkx, 14 years ago

Not from me, if that's what you ask. I'm not using Haiku for over half a year now. But the whole issue shouldn't be a problem for one of core developers to fix it, in a cleaner way than the provided second patch. It's probably just a matter of finding some free time to do it :)

comment:13 by axeld, 14 years ago

I had started to work on this a while back, but ran into some problems. I don't really remember what it was, but I still have the uncommitted stuff here. I guess I should have a second look at that some day.

comment:14 by pulkomandy, 13 years ago

axeld: we're still waiting for your commit here ?

comment:15 by pulkomandy, 13 years ago

Applied a modified version of the first patch in hrev43064. Looking at the other one now, but at least it doesn't crash anymore.

comment:16 by pulkomandy, 13 years ago

Resolution: fixed
Status: in-progressclosed

And other patch applied in hrev43128. It at least improves the situation.

Note: See TracTickets for help on using tickets.