Jump to content
Eternal Lands Official Forums
d000hg

NEW_SOUND

Recommended Posts

I got Torg to commit the sound changes; to enable them compile with NEW_SOUND. You'll need these sounds from this download - just copy them into your sound folder:

http://www.savefile.com/files/3746467

 

You also need this file. sound_condig.xml goes into the sound folder with the .wavs; the others must go in the actor_defs folder.

 

Note the new options in-game in the audio menu.

Share this post


Link to post
Share on other sites

OK. I've installed the files you mention. I'm using a client freshly built form the latest CVS updates an the game data from the current release. Is this correct or should I be using the new (test) game data too? I'm using Linux (debian testing/unstable).

 

Anyway, the update appears to have broken my sound. There are no sound related errors in the error_log or in the client text output.

 

1) I can toggle sound on/off and that might be working (need to have some weather!). However, I cannot toggle music on/off. This option is always off and will not change. If I modify my el.ini file to enable music, the option is still switched off in the GUI when I start the client. When the client exits, it also resets the music option to 0.

 

2) When I exit the client, it hangs for several seconds before closing. This has happened in the past when sound could not be shut down properly.

 

Prior to the latest change, ttlanhil's changes to enable proper switching on/off of sound and music have worked fine.

 

I'll be happy to be told I'm doing something wrong. I'm also happy to help debug the problem if I can.

Share this post


Link to post
Share on other sites

Will this be part of the 130 update?

<crawls into a dark cave to do more OS X debugging>

No, this isn't for the 1.3.0 update, but you need to test to make sure that nothing has been broken by adding in a chunk of code like this. New bugs may have been introduced.

Share this post


Link to post
Share on other sites
OK. I've installed the files you mention. I'm using a client freshly built form the latest CVS updates an the game data from the current release. Is this correct or should I be using the new (test) game data too? I'm using Linux (debian testing/unstable).

CVS is no longer compatiable with the main server and should *not* be used there until the update. You need to do all testing on the test server, and that requires the test game data.

 

1) I can toggle sound on/off and that might be working (need to have some weather!).

Ummmm. I'm intrigued by this. How do you mean toggle sound? If you are using the define then you should have a 4 way option for sound.

 

Prior to the latest change, ttlanhil's changes to enable proper switching on/off of sound and music have worked fine.

Technically this update should not have changed any of the existing code, if the define is not used. This was done so as not to break things for the 1.30 update.

 

No, this isn't for the 1.3.0 update, but you need to test to make sure that nothing has been broken by adding in a chunk of code like this. New bugs may have been introduced.

Everything is meant to be under a define, which is I believe why Ent approved it being committed before the release.

 

I still don't know why.

 

Anyway, I shall try to find the time to go over all the code and test it. The problem I have is I just started a 4 day per week job, with full time Uni (2 days internal, the rest external), so I'm going to be a very busy boy as of 9 hours ago.

Share this post


Link to post
Share on other sites

Yes if you DON'T define the NEW_SOUND option then everything should look exactly like it used to. If you enable it then you should get a 4-way option in the audio menu instead of just on/off.

 

I can't comment on Test servers and the like because I don't understand that. I can confirm I tested it myself on a clean Windows version and it worked; Torg I think has had it working (with a couple of issues) on Linux.

 

I think proper testing of these changes are due for after the update.

Share this post


Link to post
Share on other sites

to clarify: it's the music and sound in the latest update test package that is not working at all. I just get an error message.

Share this post


Link to post
Share on other sites

Roja complained the music is not working with (or without) the NEW_SOUND thing..

Can anyone confirm this?

 

 

doesnt work over here too :D

Share this post


Link to post
Share on other sites

Roja complained the music is not working with (or without) the NEW_SOUND thing..

Can anyone confirm this?

 

 

doesnt work over here too :P

 

You did compile the lastest client from the CVS, and tested on the test server, right?

Share this post


Link to post
Share on other sites

Roja complained the music is not working with (or without) the NEW_SOUND thing..

Can anyone confirm this?

 

 

doesnt work over here too :blink:

 

You did compile the lastest client from the CVS, and tested on the test server, right?

 

 

erm.. you mean teh 1.3? nope.. :omg:

Share this post


Link to post
Share on other sites

hi,

 

i build a fresh cvs today, added the files from the rc update package and placed the sound files to the proper location.

after starting the client on testserver i have the 4 new audio options but i am unable to enable the music. the only effect i can hear is

rain, nothing else.

 

my error log grows to 200+ kb after some seconds online on the testserver.

 

here is a example from the logfile

 

22:40:08] Unable to find property sound in node CAL_walk

[22:40:08] Unable to find property sound in node CAL_die1

[22:40:08] Unable to find property sound in node CAL_die2

[22:40:08] Unable to find property sound in node CAL_pain1

[22:40:08] Unable to find property sound in node CAL_pain2

[22:40:08] Unable to find property sound in node CAL_idle

[22:40:08] Unable to find property sound in node CAL_attack_up_1

[22:40:08] Unable to find property sound in node CAL_attack_up_2

[22:40:08] Unable to find property sound in node CAL_attack_up_3

[22:40:08] Unable to find property sound in node CAL_attack_up_4

[22:40:08] Unable to find property sound in node CAL_attack_down_1

[22:40:08] Unable to find property sound in node CAL_attack_down_2

[22:40:08] Unable to find property sound in node CAL_in_combat

[22:40:08] Unable to find property sound in node CAL_out_combat

[22:40:08] Unable to find property sound in node CAL_combat_idle

[22:40:10] Downloading http://www.eternal-lands.com/updates/files.lst from www.eternal-lands$

[22:40:18] Error creating a source 0: Illegal call

[22:40:43] Client closed

 

 

hope this is somehow of use

 

edit: dang i forgot to mention i build a linux client

Edited by the_voice

Share this post


Link to post
Share on other sites

I have installed the updated game data over a fresh install of el_120_linux_full.zip. I then installed the new sound files as instructed and built a new copy of the linux client from CVS. First not using the -DNEW_SOUND compiler option, then using the option. In both cases I used the test server.

 

Compiling without the NEW_SOUND option (default Makefile.linux), I get the old sound and music options in the GUI but cannot enable music at all. I don't get any errors in the log file and the client does not crash. However, the client hangs for 10-20 seconds on exit.

 

Compiling with the -DNEW_SOUND option, I get the new sound options in the GUI (the scroll window and the music toggle. However, I still cannot enable music. I get the same huge number of errors as the_voice. I did eventually get some rain and thunder sounds but the rain sound started well after the rain started. If I modify the sound options the client randomly crashes with floating point exceptions, but only when I walk around. When I can hear sounds, they stop if I walk around and start again when I stop. During this activity, I get various errors in the log file, an extract is shown below.

 

Hope this all helps.

 

[23:19:57] Error creating buffer: Invalid enum parameter value

[23:20:10] Error creating buffer: Invalid Name parameter

[23:20:12] Error creating buffer: Invalid enum parameter value

[23:22:00] Got invalid sound number

[23:23:00] Error creating buffer: Invalid Name parameter

[23:23:03] Error creating buffer: Invalid enum parameter value

Last message repeated 2 times

[23:26:14] Error creating buffer: Invalid Name parameter

[23:26:14] Error creating a source 0: Illegal call

Last message repeated 1 time

[23:26:14] Got invalid sound number

Last message repeated 1 time

[23:26:19] Error creating buffer: Illegal call

Last message repeated 1 time

[23:26:31] Error creating buffer: Invalid enum parameter value

Share this post


Link to post
Share on other sites

Quick update.

 

I think the problem with not being able to turn music on is due to the change made to the toggle_music() function in sound.c at line 1282. For the compile without NEW_SOUND defined, I was able to make the GUI toggle switch work by restoring this function back to the previous version (with the actual variable toggle at the top and the test logic inverted). Although this does allow music to play, I get odd lags and music failures if I toggle sound/music on/off several times. The slow exit problem is also fixed with this change.

 

I still can get music to play with the -DNEW_SOUND compiled version, even though the toggle music option actually selects/deselects with the above change. I get the following error:

 

[01:04:54] Error: Can't open file "commands.lst"

[01:05:04] stream_music error: Invalid Name parameter

Last message repeated 3 times

[01:05:04] play_ogg_file error: Invalid Name parameter

[01:05:13] Error creating buffer: Invalid enum parameter value

[01:05:49] Client closed

 

Something else I have admit too though. When I first tried changing the code (the compiled without NEW_SOUND version) music still did not play even though the toggle now worked. Then I realised I had not installed actually the music files in this new version of the data directory :blink:

Share this post


Link to post
Share on other sites

All this talk of test servers keeps confusing me. Torg are you listening to this and can advise me?

 

Bluap, the toggle_music function is this:

void toggle_music(int * var){
if(!have_music && *var){
#ifdef NEW_SOUND
	init_sound(SOUND_CONFIG_PATH);
#else
	init_sound();
#endif	//NEW_SOUND
}
if(music_on){
	turn_music_off();
} else {
	turn_music_on();
}
*var=!*var;
}

Can you post what you replace it with? I did notice that toggling music is wierd for me too with NEW_SOUND; I never use music.

 

As for the error log, the errors like : [07:31:33] Unable to find property sound in node CAL_attack_up_1 are generated because there is no sound set for most animations - only for human_male / human_female.xml (take a look). This must be being generated from line 509 of asc.c in function char *get_string_property (xmlNode *node, const char *prop). Since animation sounds shouldn't ever be mandatory we should make a way for these messages to be optional somehow - maybe:

char *get_string_property (xmlNode *node, const char *prop,bool log) {
xmlAttr *attr;

for (attr = node->properties; attr; attr = attr->next) {
	if (attr->type == XML_ATTRIBUTE_NODE && xmlStrcasecmp (attr->name, (Uint8 *)prop) == 0) {
		return attr->children->content;
	}
}

if(log)LOG_ERROR("Unable to find property %s in node %s\n", prop, node->name);
return;
}

The other errors about sources and so on are from OpenAL - it seems some systems just don't like OpenAL in the new version but I don't know why. Can people who DID get the new sounds to work please raise a hand, and say their OS please and whether they get these errors?

Edited by d000hg

Share this post


Link to post
Share on other sites

Oh, I had a quick look through sound.c and I think under some conditions the sound effects mutex can be locked in a function, and then if the function breaks out with an error the lock isn't removed. I don't really know what these mutexes are used for but does that sound the kind of thing which might cause the 20s-hang on exit and stuff?

Is it possible anyone can debug it and see where it hangs - I just don't get this issue. In fact the only problem I can reproduce is the non-toggling music.

 

I'll have a look and make sure this gets fixed... like I say the use of mutexes here doesn't seem required in the first place and I don't know why some functions use it and not others!

Edited by d000hg

Share this post


Link to post
Share on other sites
Can you post what you replace it with? I did notice that toggling music is wierd for me too with NEW_SOUND; I never use music.

For now, I'm concentrating on getting the build without NEW_SOUND defined working again. "*var=!*var;" needs to be done before the calls as it (music_on) is set inside the functions too. The init_sound() is also called later so I don't think its needed here. Anyway Here's my modified version.

void toggle_music(int * var){
*var=!*var;
if(!music_on){
	turn_music_off();
} else {
	turn_music_on();
}
}

This works and allows any amount of music on/off so long as sound is still on. The problem I still have occurs if both sound and music are turned off. The good news is that the sound device is correctly freed. However, if I switch sound and music back on, I also get lots of lag and lots of skipping messages. No music plays. I also get the hang when I exit. I'll look into this some more later today...

Share this post


Link to post
Share on other sites

This works and allows any amount of music on/off so long as sound is still on. The problem I still have occurs if both sound and music are turned off. The good news is that the sound device is correctly freed. However, if I switch sound and music back on, I also get lots of lag and lots of skipping messages. No music plays. I also get the hang when I exit. I'll look into this some more later today...

OK, could resist investigating further. I think I have the remaining problem. Compiling without NEW_SOUND now works like it did before. The problem was a couple of missing braces in destroy_sound(). Here is the full diff of my now working version.

RCS file: /cvsroot/elc/elc/sound.c,v
retrieving revision 1.83
diff -r1.83 sound.c
1283,1290c1283,1284
< 	if(!have_music && *var){
< #ifdef NEW_SOUND
< 		init_sound(SOUND_CONFIG_PATH);
< #else
< 		init_sound();
< #endif	//NEW_SOUND
< 	}
< 	if(music_on){
---
> 	*var=!*var;
> 	if(!music_on){
1295d1288
< 	*var=!*var;
1569c1562
< 	
---
> 	}
1619c1612
< 	if(mSoundDevice)
---
> 	if(mSoundDevice){

 

Oh, I had a quick look through sound.c and I think under some conditions the sound effects mutex can be locked in a function, and then if the function breaks out with an error the lock isn't removed. I don't really know what these mutexes are used for but does that sound the kind of thing which might cause the 20s-hang on exit and stuff?

Is it possible anyone can debug it and see where it hangs - I just don't get this issue. In fact the only problem I can reproduce is the non-toggling music.

 

I also noticed that the mutex lock macros are disabled in the new version

#define	LOCK_SOUND_LIST()//	SDL_LockMutex(sound_list_mutex)
#define	UNLOCK_SOUND_LIST()//	SDL_UnlockMutex(sound_list_mutex);

Is this intended?

Share this post


Link to post
Share on other sites

Thanks very much for your help. So in reverse order:

 

1)I don't know why (UN)LOCK_SOUND_LIST is like that. I can't connect to CVS to check when this was changed right now.

2)Yep, destroy_sound was a little cocked up. Fixed.

3)toggle_music: init_sound is called in turn_music_on if required so your version is correct I think with/without NEW_SOUND (I'll test it now)...

Edited by d000hg

Share this post


Link to post
Share on other sites

Right. I have the old version working fine. I got rid of all the annoying messages when using NEW_SOUND. Here is a diff - I just used cvs diff, if I need to use other parameters (-u ?) let me know. If somebody could re-try without NEW_SOUND then we need to check in the changes since the client is kind of broken currently!

 

I did reproduce the error when ou turn off sound&music and then turn one back on. I don't get any lag but the game jsut hangs on exit. I've not fixed this yet - I'll look but it seems more urgent to fix the version that is being used!

 

Diff follows...

 

Index: asc.c

===================================================================

RCS file: /cvsroot/elc/elc/asc.c,v

retrieving revision 1.58

diff -r1.58 asc.c

505c505

< LOG_ERROR("Unable to find property %s in node %s\n", prop, node->name);

---

> if(log)LOG_ERROR("Unable to find property %s in node %s\n", prop, node->name);

509c509

< char *get_string_property (xmlNode *node, const char *prop) {

---

> char *get_string_property (xmlNode *node, const char *prop, int log) {

518,519c518,519

< LOG_ERROR("Unable to find property %s in node %s\n", prop, node->name);

< return;

---

> if(log)LOG_ERROR("Unable to find property %s in node %s\n", prop, node->name);

> return NULL;

Index: asc.h

===================================================================

RCS file: /cvsroot/elc/elc/asc.h,v

retrieving revision 1.34

diff -r1.34 asc.h

253c253

< char *get_string_property (xmlNode *node, const char *prop);

---

> char *get_string_property (xmlNode *node, const char *prop, int log);

Index: actor_scripts.c

===================================================================

RCS file: /cvsroot/elc/elc/actor_scripts.c,v

retrieving revision 1.137

diff -r1.137 actor_scripts.c

1402c1402

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1412c1412

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1422c1422

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1432c1432

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1658c1658

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1668c1668

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1678c1678

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1688c1688

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1698c1698

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1708c1708

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1718c1718

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1728c1728

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1738c1738

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1748c1748

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1758c1758

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1768c1768

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1778c1778

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1788c1788

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1798c1798

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1808c1808

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1818c1818

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1828c1828

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1838c1838

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1848c1848

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1858c1858

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1868c1868

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1878c1878

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

1888c1888

< , get_string_property(item,"sound")

---

> , get_string_property(item,"sound",0)

2106c2106

< strcpy(name,get_string_property(cfg, "type"));

---

> strcpy(name,get_string_property(cfg, "type",1));

2121c2121

< strcpy(name,get_string_property(cfg, "type"));

---

> strcpy(name,get_string_property(cfg, "type",1));

2129c2129

< strcpy(act->actor_name, get_string_property(cfg, "type"));

---

> strcpy(act->actor_name, get_string_property(cfg, "type",1));

Index: sound.c

===================================================================

RCS file: /cvsroot/elc/elc/sound.c,v

retrieving revision 1.83

diff -r1.83 sound.c

14,15c14,15

< #define LOCK_SOUND_LIST()// SDL_LockMutex(sound_list_mutex)

< #define UNLOCK_SOUND_LIST()// SDL_UnlockMutex(sound_list_mutex);

---

> #define LOCK_SOUND_LIST() SDL_LockMutex(sound_list_mutex)

> #define UNLOCK_SOUND_LIST() SDL_UnlockMutex(sound_list_mutex);

148a149

> LOCK_SOUND_LIST();

160c161,162

<

---

>

> UNLOCK_SOUND_LIST();

182a185

> LOCK_SOUND_LIST();

183a187

> UNLOCK_SOUND_LIST();

374c378

<

---

> LOCK_SOUND_LIST();

388a393

> UNLOCK_SOUND_LIST();

401a407

> UNLOCK_SOUND_LIST();

413a420

> UNLOCK_SOUND_LIST();

422a430

> UNLOCK_SOUND_LIST();

517a526

> UNLOCK_SOUND_LIST();

528a538,539

> {

> UNLOCK_SOUND_LIST();

529a541

> }

534a547,548

> {

> UNLOCK_SOUND_LIST();

535a550

> }

730a746

> LOCK_SOUND_LIST();

743a760

> UNLOCK_SOUND_LIST();

1282,1290c1299,1302

< void toggle_music(int * var){

< if(!have_music && *var){

< #ifdef NEW_SOUND

< init_sound(SOUND_CONFIG_PATH);

< #else

< init_sound();

< #endif //NEW_SOUND

< }

< if(music_on){

---

> void toggle_music(int * var)

> {

> *var=!*var;

> if(!music_on)

1292c1304

< } else {

---

> else

1294,1295d1305

< }

< *var=!*var;

1309d1318

< music_on=0;

1567c1576

< if(!inited){

---

> if(!inited)

1576c1585,1586

< if(music_thread != NULL){

---

> if(music_thread != NULL)

> {

1580c1590,1591

< while(queued-- > 0){

---

> while(queued-- > 0)

> {

1612,1613c1623,1626

< for(i=0;i<MAX_BUFFERS;i++) {

< if(alIsBuffer(sound_buffer)) {

---

> for(i=0;i<MAX_BUFFERS;i++)

> {

> if(alIsBuffer(sound_buffer))

> {

1619a1633

> {

1631c1645,1646

< if(context != NULL) {

---

> if(context != NULL)

> {

2136a2152

> LOCK_SOUND_LIST();

2151a2168

> UNLOCK_SOUND_LIST();

Edited by d000hg

Share this post


Link to post
Share on other sites

I've been away for the weekend visiting family in Sydney and haven't had the chance to check the forums (although I did spend 5 minutes checking my email). I also now have a full time job, and full time study so my time available is severely limited until mid-september.

 

All this talk of test servers keeps confusing me. Torg are you listening to this and can advise me?
><

 

I thought this had been explained. Do not ever test any new code in the client (that is, anything not in CVS) on the main server unless you have permission from Ent, and you know what you are doing. That is why there is a test server. The test server is at the same IP, just port 2001 instead of the default port 2000.

 

I will have a quick look at fixing this up now, but I need to be awake at 5:30am so I'm not going to spend masses of time on it. I'll try to sort it out tomorrow night if needs be.

Share this post


Link to post
Share on other sites

I thought this had been explained. Do not ever test any new code in the client (that is, anything not in CVS) on the main server unless you have permission from Ent, and you know what you are doing. That is why there is a test server. The test server is at the same IP, just port 2001 instead of the default port 2000.

I don't know if I ever got told this properly - or which port I normally use! Is it a setting in the .ini file?

 

I can't check stuff in; if anyone can verify my patch from 2 posts back and get those changes committed. Then I'll look at the NEW_SOUND-specific issues.

Share this post


Link to post
Share on other sites

Ok, just committing the changes noted by Bluap so hopefully the non -DNEW_SOUND will be fixed. Please test it and I'll check it tonight.

Share this post


Link to post
Share on other sites

ok I compiled the client. And the music/sound works again now! Yay!

 

Except with regards to the "turn the music on/off on the fly patch", we're back to this bug: http://www.eternal-lands.com/forum/index.p...ic=24913&st=40#

 

But that bug is better than the no music at all bug so... :cry:

Oh for crying out loud...! I incorporated the fix for that into my changes; I find the logic for this thing a little tortuous so could someone who worked on the previous fix take a look and see what stupid thing I did?!

 

So to clarify it works fine unless you urn music off and back on while sound is ON? In this case do the check-boxes still work but just no music happens?

 

ps:Thanks for the commit Torg.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×