line thickness and sound problems

hi, im new to this forum :slight_smile:

what im doing wrong, i want to set the line thickness, but it dont work. :frowning:

this is what im doing:

LineSegs lines("lines");
	lines.set_vertex(1,.5,0,.5);
	lines.get_current_position();
	lines.draw_to(-.5,0,-.5);
	lines.set_thickness(10.0);
	NodePath test(lines.create()); 
	test.reparent_to(window->get_render_2d()); 

neither the sound is working.? :frowning:

PT(MovieAudio) audio; 
audio->get("/d/SleepAway.mp3");
audMA = AudioManager::create_AudioManager(); 
Sound = audMA ->get_sound(audio);
Sound ->play();

sorry im new to c++

greetz
krid

The call to set_thickness() must be made before the call to draw_line(). Also, line thickness is only supported in OpenGL, so make sure you are using OpenGL in your Config.prc file.

Are you saving the AudioSound object returned from get_sound() in a PT(AudioSound), or just in an ordinary AudioSound *? The former is correct. If the latter, it will destruct and make itself invalid before you can use it.

David

thx,

first off, the problem i have with panda at c++, only the dx is supported, if i try to run panda on opengl my application crashes.

before i tried to run a autonom audiofile, i wanted to include a video with audio supported, that why i used PT(MovieAudio)…

yes, im used/using PT(AudioSound) (sorry i forgot to write this lines in here), so i changed my code to this, but this is also not working (neither on openAL, or fmod):

PT(AudioSound) audio;
	PT(AudioManager) audMA;
	audMA = AudioManager::create_AudioManager(); 
	audMA->set_active(true);
	audio = audMA->get_sound("/d/SleepAway.mp3");
	audio->play();

greetz
krid

so now, i got it so far, that the first 5 sec get played, my programm stays in silence.

Hmm, if your OpenGL isn’t working, perhaps you just need to install a new graphics driver? If you can’t use OpenGL at all, you won’t be able to use thick lines, because it’s an OpenGL-only concept. You could use the more-complex RopeNode class instead of LineSegs, though; and RopeNode provides the RM_tube or RM_tape render modes, which can simulate thick lines, even on DirectX.

I don’t understand this sentence:

Do you mean the audio only works for 5 seconds, and then it stops working?

David

then i have to use dx (i have already the newest drivers installed) :frowning: anyway, i just use this lines for displaying my raster at my AI and particle mode. i can work with that.

the sentence which you dont understand. :wink:
it means that the sound only gets 5 seconds playback, then it stops to play.

so now it works via fmod, but i cant fix it for openAL. there is still this 5 sec behavour.

There have been several people reporting various issues with OpenAL. I’d suggesting continuing to use FMod for now.

David

thx david,
yes, i will take the fmod in the meantime…

krid, about the OpenAL problems, can you mention what is your platform?

if you mean the developing platform = vc++ 2008 express
if you mean the os, then its win 7.
if you mean the panda3d = 1.7
// sound
sound = high definition audio device 6.1.7600.16385

the audio support on openAL isnt that importing at moment.

but the graphic ~bug, is a bit a pita. its not really smooth that i can only compile for dx8. it would be ok, if the dx9 would work, but neither dx9 is working for dev on c++. yes, i installed the dx9 sdk.

maybe i have to fix the reg. for?? which keys needs to be changed?

maybe someone have a idea? i need to build shaders and i wanna create those with dx9 or opengl supporting.

thanks

(if there is no solution for, i have to work on my other machine. but i love to work on the laptop)

First of all, I take it that you are using the panda binaries and didn’t build your own panda. If you have problems building Panda with DX, let me know, that’s a whole other story.

You don’t need to install a DirectX SDK to build a Panda app that can use DX, because the DX support is already linked inside your panda distribution, you just need to install the runtime to run the app. Did you install the DX9 user runtime?

microsoft.com/downloads/deta … laylang=en

EDIT: krid, about the sound. I would like you to try something, I’d like to find out if this fixes your problem.

When I say “binary dir” I mean the dir where the panda dll’s are, typically c:\Panda3D-1.7.0\bin.

  1. Go to your binary dir, and remove (make a copy somewhere) pandaopenal32.dll and pandawrap_oal.dll. Or to make sure they aren’t loaded from the path rename them to .dl_.

  2. Next download the openalsoft binaries from here: kcat.strangesoft.net/openal-soft … 53-bin.zip

  3. Extract the oal_soft.dll file and rename it to pandaopenal32.dll, put it in the binary dir.

Test sound now.

cool thanks,
still the same. 5 sec playback.

about the graphics,
i solved it in the meantime, by copying the cg.dll into my projekt.

A guy on irc had exactly the same sound problem with Openal, but in Linux, that kinda gave away it was a ffmpeg problem. He gave me his mp3 and I was able to reproduce the problem and fix it. Note that the problem also occurred when converting the mp3 to a simple wav format. The problem is the length.

In FfmpegAudioCursor::read_samples() there’s a max number of tries, by default 100, to read a valid sample. This fails because larger files may need more tries (I don’t know what those invalid samples are but they could be a lot of things). The fix was merely to remove that and rely on the amount of samples received to know where to end.

So any clue what was the purpose of that limitation? If it was there for a reason I’ll need to find a proper replacement before removing it.

Perhaps this lengthy CVS comment is useful:

Doh, I’m ashamed it didn’t occur to me to just check CVS, I assumed the limitation would have been there from the initial commit.

So it seems to me the proper fix instead of the arbitrary 100-tries limitation was to convert reload_buffer from void to bool, check for 0 but return false on <0 and true on 0 so that the loop at read_samples() can break. Then again the only way to check that this still fixes the original problem is to get an offending audio file that caused this infinite loop from the author, I don’t know if that’s possible. Also, I’m not even sure of the implications of the change, for example I’m not sure under what circumstances ffmpeg produces silence, I’m not treating it as a loop-breaking event. Summary: little confidence in this patch.

So here’s the patch with the solution described above pastebin.com/HwRG71Tw . It fixes the “sound cut-off” problem people have been reporting for 2 years but for your own tranquility you should try to test it with eiforall’s broken sound sample and see if you still get the infinite loop, so I’m not committing it unless you want me to go ahead.

(Also, maybe we should update the ffmpeg build we have in the thirdparty package, it’s ancient. I looked into building it for MSVC but it looks like a pain.)

EDIT: Updated the link to a new patch, first one had a vestigial debug message and bad indentation.

After discovering the shocking identity of the original committer I’ve been talking to him. We have decided to go ahead with my patch as we haven’t been able to determine for sure the nature of the original bug. In any case this will fix more things that it breaks for sure. I’m committing it, but let me know if you experience freezes while playing audio.

now the audio is playing right, but when I try to synchronize with the video,a problem happens, the movie stops.

 mov = new MovieTexture("movie");
    mov->read("models/videos/vinheta_opcao_1_mpeg4.avi"); 

    cm = new CardMaker("My Fullscreen Card");
    cm->set_frame_fullscreen_quad();
    cm->set_uv_range(mov);
    node_card = NodePath(cm->generate());
    node_card.reparent_to(Simdunas::get_window()->get_render_2d());
    node_card.set_texture(mov);
    node_card.set_tex_scale(TextureStage::get_default(), mov->get_tex_scale());
   
    AM = AudioManager::create_AudioManager();
    ASound = AM->get_sound("models/videos/vinheta_opcao_1_mpeg4.avi", true, 1);
   
    mov->synchronize_to(ASound);
 
    ASound->play();
    

Fladmy, we haven’t committed the change yet (in fact I was about to), did you apply my patch manually?

yes I made the changes and compiled.