Ogg stream problems

(CZ)genius

31-03-2007 20:55:26

Hi,

I have two problems with playing ogg streams:

1. Some oggs don't loop.. it's really strange.. It looks like it depends on encoder version.. oggs encoded with version 20040629 don't loop, but when i reencode them with 20050304 or 20020717 they loops ok...

2. This one is more serious... when something in my application takes a little longer (~3 seconds.. (Connection to website for version info or so..)), music stops playing.. I've tried controlling every frame if it's playing and starting it if it doesn't, but it crashed on starting although it was saying that it's stopped...

Thanks for help and for this amazing binding..

CaseyB

02-04-2007 06:11:24

I actually just ran into a similar problem in a small project that I am working on and I am looking into it further, I'll keep you posted.

Ridhan

04-04-2007 22:15:39

Well, I'm having the same problem. It plays the file for less than a second and stops. In my case I start the music before my game enters the main screen. For now I'm using wav's to bypass the problem....but 30MB for a single song...

Now, this happen when I use the createSoundStream, because when I simply use createSound, the file is played incredibly fast. I tried changing the pitch but nothing happened...

daedar

05-04-2007 21:14:08


Now, this happen when I use the createSoundStream, because when I simply use createSound, the file is played incredibly fast. I tried changing the pitch but nothing happened...


I have the same problem :(

CaseyB

05-04-2007 21:17:18

Can you guys email me the files you are having trouble with? I have a file that is giving me trouble, so when I sit down to work on it I'd like to have a few examples to test against.

Dirso

08-04-2007 17:51:22

I can't play any ogg files. Even the files from the sample, here is my code:

sndBkg = soundManager->createSoundStream("Bkg", sSndName, true);
//sndBkg = soundManager->createSound("Bkg", sSndName, true);
sndBkg->setGain(3);
sndBkg->play();
//sndBkg->setRelativeToListener(true);

It raises an exception:

Ogre Exception (6): Ogg Error: Unkown Ogg Error. in OgreAL::OggSoundStream::stream


Thanks,
Dirso

Dirso

08-04-2007 17:53:04

I also have this screen error with some .ogg (from the samples)

HEAP[WizEihort.exe]: Invalid Address specified to RtlValidateHeap( 01350000, 014F3410 )
Windows has triggered a breakpoint in WizEihort.exe.

This may be due to a corruption of the heap, and indicates a bug in WizEihort.exe or any of the DLLs it has loaded.

(CZ)genius

15-04-2007 09:14:08

so.. How is it going? Any improvement?

syedhs

15-04-2007 18:24:49

Maybe it is more helpful if somebody can get more detail out of this error:-

Ogre Exception (6): Ogg Error: Unkown Ogg Error. in OgreAL::OggSoundStream::stream

Dirso

15-04-2007 19:07:58

Maybe it is more helpful if somebody can get more detail out of this error:-

Ogre Exception (6): Ogg Error: Unkown Ogg Error. in OgreAL::OggSoundStream::stream

I really don't know how. Every .ogg file I try to load raises this exception

daedar

16-05-2007 01:22:18

Now, this happen when I use the createSoundStream, because when I simply use createSound, the file is played incredibly fast. I tried changing the pitch but nothing happened...

Sorry to insist :( but is there any improvements? because we need to release an alpha version of our game soon ( http://www.ogre3d.org/phpBB2/viewtopic.php?t=31735 ) and we still can't use createStream and sometimes the music plays faster/slower than the original speed.

Thx a lot.

CaseyB

16-05-2007 18:20:06

I am sorry it's taking so long, when is your release?

daedar

16-05-2007 20:46:14

That's not really a problem as it's just an alpha version and it doesn't really matters if the sounds plays quickly. But we plan to release it in the next 2 weeks so it would be perfect if the sounds are ok :D

M2H

17-05-2007 00:32:19

Every .ogg file I play plays about 5 to 10 times too fast.
(for example: http://nfo.net/TUNES/afterparee.ogg )

The siren.wav from the examples works fine.
An other .wav I downloaded did not properly work.

I'm very happy with this project so far, I hope the play-speed problems can be explained: Is this the same bug other people reported about ?


OgreAL::SoundManager *soundManager = new OgreAL::SoundManager();


Ogre::SceneNode *node = sceneMgr->getRootSceneNode()->createChildSceneNode("OgreHead");
//ent = sceneMgr->createEntity("Ogre", "ogrehead.mesh");
//node->attachObject(ent);
//node->setPosition(0, 50, 0);

OgreAL::Sound *sound = soundManager->createSound("Siren", "siren.wav", false);
node->attachObject(sound);
sound->play();

CaseyB

17-05-2007 04:57:01

I will do my best to look into it as soon as possible. I've never experienced the sounds playing too quickly, I'll have a go with the one you linked and see how that does for me. Thanks for bearing with me!

DarksterZeroOne

03-06-2007 14:45:52

Hello,

I want to use ogreAL because of the ogg support. But now it seems to have problems with it. I got the same two problems with OgreAL, like the others and one more. The stop after 1-2 seconds of playback if I use ogg as stream. And the playback of ogg files x times faster than normal. But this not on all machines. On my dev system at school the ogg file plays normal, but at home x times faster.
At school I use a PC with Intel P4 and WinXP and at home a Laptop with Amd64 3000+ mobile and WinXP. Maybe there are problems with calculating the speed of the processor because it uses 800mhz normal but speeds up to 1600mhz when needed. I heard some programs has problems getting the real speed of mobile processors.
I hope I can help you to point you in the right direction.

My new Problem is that I use to destroy and recreate the scenemanager while changing from menu to game. It crashes. I figured out that the framelistener isn't dergistered in the destructor of Soundmangaer. So I recompiled ogreAL with the deregistering. But know I it seems a new problem, It starts to play the sound but, when it will show the scene it chrashes.
When I try to debug the soundmanager, for example the framestarted function, and stepp through slowly sometimes, it works !!! I don't know why.
Maybe someone has found this problem, because it is impossible for me to find it ..

Thank you
Darkster ZERO ONE

Martins1

04-06-2007 11:22:32

I on the other hand get playback 2 times slower, but not always. It happens quite rarely, in about 10% of cases (on the same computer).

I experimented with different sound card drivers, and with some
drivers problem was more evident that with others.

To me it looks more a driver or OpenAl problem.

rluck

07-06-2007 05:09:46

Having the speed up issue here too
only happens with ogg files, nothing else

Kreso

13-08-2007 16:06:51

same here. it seems to be only related to OggSound. OggSoundStream works ok.

andy

26-08-2007 07:10:57

The problem with playing ogg sounds is in OgreALOggSound.cpp in that the variable mFreq is never being set so playback speed is "random"

You can patch the file by setting mFreq as shown (about line 62):
mVorbisInfo = ov_info(&mOggStream, -1);
mFreq = mVorbisInfo->rate; // AJM Fix for ogg's playing incorrectly
mVorbisComment = ov_comment(&mOggStream, -1);

// Use a different buffer format?
Cheers
Andy

Somotaw

09-10-2007 20:46:30

when using Ogg streams i get an error when returning false in framestarted if there has been enough time to stop the music , which only happens when there's been a slight delay , (like when i connect with my network class and it doesnt work)
i get OGREEXEPTION(3) OpenAL error : the value pointer given is not valid in OgreAL::SoundStream::emptyQueue

when there's been no delay, the application quits flawlessly

hope this can help out,

Igor

11-10-2007 09:06:43

Hi!
I've got a problem, that looks like Somotaw mentioned.
When ogg music is playing and app is low on fps, sometimes an exception is thrown in Sound::errorToString with error code=AL_INVALID_VALUE

CaseyB

11-10-2007 18:43:10

Can you step through and see where that exception is being thrown?

Igor

12-10-2007 04:50:21

Not a trace really, just defined checkError as macros, so i can use __XXX__
vars ^^

it stops here
OgreAL\src\OgreALOggSoundStream.cpp (revision 70)
bool OggSoundStream::stream(ALuint buffer)
in checkError after calling alBufferData(buffer, mFormat, data, size, mFreq);

Does OpenAL have function like IDirectSoundBuffer::Restore() ?
It'd be niice!

CaseyB

12-10-2007 07:15:22

Can you send me the ogg file you're using, I'll see if I can recreate the issue.Does OpenAL have function like IDirectSoundBuffer::Restore() ?
It'd be niice!
I don't know what that does, I've never used DirectSound.

Igor

12-10-2007 12:26:43

Hi!
i'm sorry, here is a dirty example
lpDSBuffer->GetStatus(&dwStatus);
if(dwStatus & DSBSTATUS_BUFFERLOST)
lpDSBuffer->Restore();
if DirectSound buffer is lost (window lost its focus or whatever) restore it.
my old codebase (DirectSound) works with this file well :?

It is 44100/Mono/128kbps
ogginfo saz "average bitrate is 129,021923kbps". maybe reason is here?
/EDIT
legal issues arise :evil: i cannot attach it without NDA

fata1err0r

23-10-2007 05:41:10

I having the problem streaming oggs, when i have a lag eg 1 second between frames for loading assets the sound just drops out :(

CaseyB

23-10-2007 07:06:02

Does it come back, stay gone or crash the app? If it drops out and comes back that makes sense because the SoundManager is a FrameListener that uses the frame events to update sound buffers, so if there is a single frame that takes a very long time then those buffers are not going to be updated and this will cause the music to stop since there is no new info for the sound being played. Hmmm, it may also be the case if it stops completely that OpenAL thinks that it has gotten to the end of the sound and it enters the Stop state.

fata1err0r

26-10-2007 02:23:07

the sound drops out, doesnt come back and when i try to access it throught a pointer it kills the game.

its not on every pc i run the game on though, it seems to be acting differently on every pc. my friend even said the game crashed if he didnt have winamp playing when he runs it? :? My latest problem seems to be that i can only create 20 instances of the same sound file, when i create 21 it crashes on create sound, even though they are originally named strings. My code is quite simple i guess:

void Sound::Init()
{
soundManager = new OgreAL::SoundManager();

soundManager->getListener()->setPosition(Ogre::Vector3(16,16,-5));
soundManager->getListener()->setDirection(Ogre::Vector3(0,0,1));
}

void Sound::AddSound(std::string filename, std::string soundname, Ogre::SceneNode *sn, bool loop, bool stream)
{

if(stream)
sound = soundManager->createSoundStream(soundname, filename, loop);
else
sound = soundManager->createSound(soundname, filename, loop);
sn->attachObject(sound);
}


Im developing a game for a competition and it would be awesome if i could work out whats going on in the next 2 weeks.

Aquatix

26-10-2007 03:18:32

Hmm, fata1err0r, are you using the latest version of everything? (OgreAL, OpenAL, libogg, libvorbis...)
Just tried a similar code on different machines, seems to be working fine (at least the part with creating >20 sounds).
Just check, that you have only 1 .dll - (OgreAL.dll), that you properly install OpenAL redist, and that you use OgreAL.lib + OpenAL32.lib

CaseyB

26-10-2007 10:47:05

OpenAL relies on sound hardware to dictate how many sources can be created, so this can be different from machine to machine. You can find out how many sounds you can create with SoundManager::maxSources(). This is one of the very next things I want to address with OgreAL, better resource management. You should be able to create as many sounds as you want and be able to play them whenever you like and it should make some reasonable decisions about which to actually play and which to let slide based on how many sources the sound hardware will allow.

Aquatix

26-10-2007 13:06:55

Hey, CaseyB, could you please give a bit more info on this limit thing?
Its just that I haven't encountered it yet, but what do you mean by "sound hardware to dictate how many sources can be created"?
I just did a ::maxSources() on my machine and got 32. So, I assign a createSound() to a key, and just create 32 sounds in a row. Nothing happens. So, I create 50, 70, 100... still no effect. So, what exactly is this limit? Just for info, I used the same .wav or .ogg file to create the sounds. Does it perhaps limit the number of different files?

And another thing - just noticed that sometimes (or actually most of the times) when I create a SoundObject (from a .wav), then if I'm (i.e. the listener) standing to the right of the object, then instead of hearing the sound in my LEFT ear (logical, right?), I hear it in my RIGHT ear. Sounds like an inverse of the channels (i.e. left switched with right). Any way to correct that?

CaseyB

26-10-2007 21:30:46

Its just that I haven't encountered it yet, but what do you mean by "sound hardware to dictate how many sources can be created"?
I just did a ::maxSources() on my machine and got 32. So, I assign a createSound() to a key, and just create 32 sounds in a row. Nothing happens. So, I create 50, 70, 100... still no effect. So, what exactly is this limit? Just for info, I used the same .wav or .ogg file to create the sounds. Does it perhaps limit the number of different files?

I'm not sure why that happened, did you delete the old ones first so that you only had a few at a time, or did you have all 100 active at the same time? The limit is the on the number of sources, that it the number of objects in the scene that can be emitting sound at any given time. Currently when you create a sound, OgreAL creates a source and binds it to that sound, so you should only be able to create maxSources() sounds. In fact I determine the max number of sources by creating a bunch on initialization until I get an failure.

-=EDIT=-
I just looked at that section of code again and I cap it at 32. There was a reason for capping it, I don't remember what that reason was though. One of the very next things to do though it make this requirement unnecessary.

And another thing - just noticed that sometimes (or actually most of the times) when I create a SoundObject (from a .wav), then if I'm (i.e. the listener) standing to the right of the object, then instead of hearing the sound in my LEFT ear (logical, right?), I hear it in my RIGHT ear. Sounds like an inverse of the channels (i.e. left switched with right). Any way to correct that?
Does it not do the same thing with an ogg file? Do you do any sort of rotation of the scene node before you attach the listener?

Aquatix

27-10-2007 03:56:55

did you delete the old ones first so that you only had a few at a time, or did you have all 100 active at the same time?

Actually they weren't active ALL at the same time... :oops: So you are right, it crashed. Just checked again now - its 34 sounds active at the same time. With the activation of the 35'th one it crashes to desktop.

One of the very next things to do though it make this requirement unnecessary.
That would be great indeed! Looking forward!

Does it not do the same thing with an ogg file? Do you do any sort of rotation of the scene node before you attach the listener?

It does. With all files. Seems like an effect of reversed stereo. The sceneNode's transformations are only:
1) create the scene node, as a child of another node (no transforms here)
2) do a translate -1 unit in y-axis.
3) attach listener().

That's all really. Tried it with other nodes - same effect. Well, surely there's something I'm doing wrong, just need to figure out what.
Atually, thinking about it - that can be a good feature to give users the ability to choose a reverse stereo if they need it. (AFAIK it is a standard thing more many games/apps)

CaseyB

27-10-2007 06:16:47

I just had a look at the Basic Demo and it seems to be working perfectly fine on my machine. Does it exhibit the same behavior for you?

Aquatix

28-10-2007 02:25:52

Does it exhibit the same behavior for you?
Yep. Actually that was just the way I was defining nodes. Already fixed, thanks!
The poing was to make sure to attach the listener to a purely clean node (no transforms, nothing).

CaseyB

28-10-2007 16:47:08

So it's all sorted out?

Aquatix

28-10-2007 17:08:50

Yeah, thnx!

CaseyB

29-10-2007 00:39:15

Awesome!!!

Have fun!!

faraklit

13-03-2008 12:15:25

I am having latency issues with ogg files. When I want to play an ogg file the ogre screen just freezes and comes back 0.5 ~ 1 second later causing an annoying delay. I thought it may be because of creating sounds so I tried creating sounds in advance but it did not change anything. I do not have such problem with wav files. Is it because of ogg decompression speed?

CaseyB

13-03-2008 15:05:06

It's because of loading in the sound file itself, try creating it and setting streaming to true in the constructor.

faraklit

14-03-2008 15:38:10

thnx it fixed the problem.

but i still have to destroy sound manager every time I want to change active sounds in the scene.