PDA

View Full Version : Mumble Positional(3D) Sound Support



Lordearon
01-28-2010, 11:17 AM
As suggested by Maven here (http://cspromod.com/community/viewtopic.php?f=8&t=993&p=32232#p14949)

TS3 has option of allowing 3d positioning of players, I've browsed their forums for some info as to how games can synchronize in-game position with 3d audio position, but haven't found much.

However I found that Mumble already supports this for CSS and HL2:DM as listed here:
http://mumble.sourceforge.net/Games#Positional_audio



f you want to add support for a game and you are able to modify the source of this game you can use the Link (http://mumble.sourceforge.net/Link) plugin. If you cannot modify the source of the game you want to add, this guide (http://mumble.sourceforge.net/Pluginguide) should help. For an overall look at retrieving positional data from a game, see here (http://mumble.sourceforge.net/HackPositionalAudio).

DonlanMK2
01-28-2010, 11:23 AM
Wouldn't this affect your communication, say if you were at B on Dust2 and a team member at A was calling wouldn't this stop you from hearing him?

Lordearon
01-28-2010, 11:26 AM
not sure, depends on how much the volume decreases by the distance, if this would be an issue (I haven't tried mumble yet) maybe csp can limit the maximum distance created between players through the data it feeds to mumble somehow?

any1 experience with this in css/hl2:dm?

the best of it all is, mumble is open source... however if we can figure out how ts3's positional audio can be used, maybe it would be good to provide variety...

unless csp intends to work on a better in-game voice system that already supports a positional sound options... I do think they should not try to re-invent the wheel however.

In any case, mumble gives you the option to dissable positional sound.

Lordearon
01-28-2010, 12:01 PM
wow, mumble positional audio is quite powerful, it supports contexts, so if the game tells mumble 2 players are in a different context, they can't hear each other. This could be used to prevent dead players interfering... it could also prevent ppl on different teams to hear each other on mumble.

I feel however that it should be possible to control this with a serverside cvar for instance... so if players have mumble with positional audio enabled you could have set your server to force players in a different team to be in a different context (by having their csp client send difference in context) and thus unable to hear each other...

kind of useless if they disable positional audio in mumble (I assume that's possible) and can hear each other anyway, but maybe that could be regulated and checked somehow in league play... anyway, really like this feature of mumble.
some interesting discussion about contexts on mumble forum:
http://sourceforge.net/projects/mumble/ ... ic/3528394 (http://sourceforge.net/projects/mumble/forums/forum/492606/topic/3528394)

puddin1
01-28-2010, 09:43 PM
to bad mumble didn't invest their time in better sound quality....that would have been really cool.



Just so you know mumble is the ONLY VOIP program I have ever used that gives terrible feedback that ends up in loud screeches. worthless program imo, vent is much better.

Lordearon
01-28-2010, 09:51 PM
they have a new codec in version 1.2, CELT. Most ppl say voice quality is better then TS3??

maybe you had a prob with noise cancelling or something?

SpikeMeister
01-28-2010, 11:01 PM
You can change the variation of the volume over distance in the options of Mumble. I've just started using it but the positional audio doesn't seem to work in CSS :\ I'm probably doing it wrong. Otherwise it's really great! Better than Vent anyway, not just in quality but in features as well. I think you must have had a configuration problem puddin.

Lordearon
01-28-2010, 11:26 PM
I think the css PA plugin is based on memory scans, they just read the client position using 'hack' methods and interface this to mumble... if there's a small update to css that changes some memory allocation or whatever and the plugin isn't very flexible the whole thing fails. besides I believe there's a risk of some AC to detect this memory scanning as a hack...

What I'm proposing here is having csp support this out of the box as the devs have full control of this info anyway, this ensures mumble can find the stuff it needs exactly where csp told it it would be and this agreement will never change. I haven't played in a long time and thus haven't tried mumble yet, but I'm sure intending to put some hours into csp when it's out.

n69ky
01-29-2010, 02:01 AM
I WANT THE MOVING MOUTH WHEN TALK INGAME ;:S

Lordearon
01-29-2010, 02:28 AM
well, that's not really possible if you have 3rd party voice app... but I don't think csp team should re-invent the wheel to have voice in game.

As mumble is open source they could look into making the link-plugin code 2-way, or put in a feature request at mumble... I think how this works is by having the 'frequency/amplitude' of the sound in a players mic pushed into the memory for the csp client to read, then the client sends it together with its other data to the server where the server sends it to all relevant csp clients...

similar to having the x,y,z + context of the csp player in memory for mumble to read, where mumble sends it together with the voice data to the other clients so they can render the talking in a 3D way...

haGisson
01-29-2010, 02:31 AM
I WANT THE MOVING MOUTH WHEN TALK INGAME ;:S

it looks so damn funny ^^

Chris
01-29-2010, 02:33 AM
You can change the variation of the volume over distance in the options of Mumble. I've just started using it but the positional audio doesn't seem to work in CSS :\ I'm probably doing it wrong. Otherwise it's really great! Better than Vent anyway, not just in quality but in features as well. I think you must have had a configuration problem puddin.

I remember using it a year ago on css and it was working fine. If I remember correctly you can also adjust the quality of the voice, but I guess even then it won't be as good as ventrilo.

Lordearon
01-29-2010, 02:35 AM
might be interesting to try it again as they support serveral new and novel codecs... I can't believe vent would still be on top...

note in this video that mumble has less transition delay:
[youtube:1vs55uwp]qMfF36NvoJc[/youtube:1vs55uwp]

more positive feedback on mumble here: http://www.cadred.org/Forums/Thread/31739/
- Mumble is still being developped.
- Mumble license is FREE.
- Mumble got "noise remover" feature.
- Mumble is working for Linux/Win/Mac
http://mumble.sourceforge.net/Upcoming

Lordearon
02-06-2010, 07:54 PM
bump!

Lordearon
02-18-2010, 10:24 AM
Still no dev reply on this :(

Lordearon
02-19-2010, 11:32 PM
Somewhere in your game initalization, add these lines of code:

struct LinkedMem {
#ifdef WIN32
UINT32 uiVersion;
DWORD uiTick;
#else
uint32_t uiVersion;
uint32_t uiTick;
#endif
float fAvatarPosition[3];
float fAvatarFront[3];
float fAvatarTop[3];
wchar_t name[256];
float fCameraPosition[3];
float fCameraFront[3];
float fCameraTop[3];
wchar_t identity[256];
#ifdef WIN32
UINT32 context_len;
#else
uint32_t context_len;
#endif
unsigned char context[256];
wchar_t description[2048];
};

LinkedMem *lm = NULL;


void initMumble() {

#ifdef WIN32
HANDLE hMapObject = OpenFileMappingW(FILE_MAP_ALL_ACCESS, FALSE, L"MumbleLink");
if (hMapObject == NULL)
return;

lm = (LinkedMem *) MapViewOfFile(hMapObject, FILE_MAP_ALL_ACCESS, 0, 0, sizeof(LinkedMem));
if (lm == NULL) {
CloseHandle(hMapObject);
hMapObject = NULL;
return;
}
#else
char memname[256];
snprintf(memname, 256, "/MumbleLink.%d", getuid());

int shmfd = shm_open(memname, O_RDWR, S_IRUSR | S_IWUSR);

if (shmfd < 0) {
return;
}

lm = (LinkedMem *)(mmap(NULL, sizeof(struct LinkedMem), PROT_READ | PROT_WRITE, MAP_SHARED, shmfd,0));

if (lm == (void *)(-1)) {
lm = NULL;
return;
}
#endif
}

Then, for each frame, do the following:

void updateMumble() {
if (! lm)
return;

if(lm->uiVersion != 2) {
wcsncpy(lm->name, L"TestLink", 256);
wcsncpy(lm->description, L"TestLink is a test of the Link plugin.", 2048);
lm->uiVersion = 2;
}
lm->uiTick++;

// Left handed coordinate system.
// X positive towards "left".
// Y positive towards "up".
// Z positive towards "into screen".
//
// 1 unit = 1 meter

// Unit vector pointing out of the avatars eyes (here Front looks into scene).
lm->fAvatarFront[0] = 0.0f;
lm->fAvatarFront[1] = 0.0f;
lm->fAvatarFront[2] = 1.0f;

// Unit vector pointing out of the top of the avatars head (here Top looks straight up).
lm->fAvatarTop[0] = 0.0f;
lm->fAvatarTop[1] = 1.0f;
lm->fAvatarTop[2] = 0.0f;

// Position of the avatar (here standing slightly off the origin)
lm->fAvatarPosition[0] += 0.001f;
lm->fAvatarPosition[1] = 0.0f;
lm->fAvatarPosition[2] = 0.5f;

// Same as avatar but for the camera.
lm->fCameraPosition[0] = 0.0f;
lm->fCameraPosition[1] = 0.0f;
lm->fCameraPosition[2] = 0.0f;

lm->fCameraFront[0] = 0.0f;
lm->fCameraFront[1] = 0.0f;
lm->fCameraFront[2] = 1.0f;

lm->fCameraTop[0] = 0.0f;
lm->fCameraTop[1] = 1.0f;
lm->fCameraTop[2] = 0.0f;

// Identifier which uniquely identifies a certain player in a context (e.g. the ingame Name).
wcsncpy(lm->identity, L"Unique ID", 256);
// Context should be equal for players which should be able to hear each other positional and
// differ for those who shouldn't (e.g. it could contain the server+port and team)
memcpy(lm->context, "ContextBlob\x00\x01\x02\x03\x04", 16);
lm->context_len = 16;
}
Any confirmation from the devs this is going to be added?

Lordearon
12-19-2010, 09:36 PM
still no reply :D

bayAREAeskAe
12-19-2010, 11:29 PM
it looks so damn funny ^^

very essential part of cs.

n3krO
12-20-2010, 01:25 AM
No no and no, so when u death u can't speak with teammates and u lose the porpuse of those programs..

Lordearon
12-20-2010, 01:58 AM
I'm sad to say n3kr0 fails reading comprehension,

and ghosting is not 'the purpose of those programs'

n3krO
12-20-2010, 12:37 PM
I'm sad to say n3kr0 fails reading comprehension,

and ghosting is not 'the purpose of those programs'

Well, i only use those progams when the game hasnt voice incorpurated or in CS cuz when i'm death i can give cruciall information to my mates.....

I don't know for what u use them in CS but for me that's the porpuse... and i've only read the first Post and didn't read the replies....

Lordearon
12-21-2010, 01:04 AM
... and i've only read the first Post and didn't read the replies....

don't bother reply-ing then?

shumped
12-21-2010, 01:02 PM
Wouldn't this affect your communication, say if you were at B on Dust2 and a team member at A was calling wouldn't this stop you from hearing him?

3D hearing does not equal to simulating realistic hearing. you'd hear from which direction he's calling from and sound level would not change

n3krO
12-21-2010, 01:13 PM
And if your friend is death how will u hear him? from nowhere?

smilesger
12-21-2010, 02:07 PM
I WANT THE MOVING MOUTH WHEN TALK INGAME ;:S

On some servers, there is a mod with some special models, wich makes the mouth animating, when talking :D
(btw I`ve only seen this on CS1.6 ^^)

tiger
12-21-2010, 02:13 PM
It ain't no mod, it's a default animation in 1.6 xD

Lordearon
12-21-2010, 09:39 PM
And if your friend is death how will u hear him? from nowhere?
depends on what the devs is passing through as the position.

Can put through the same position, so the dead friend seems to be right next to you. He can put through a different context as well. So if you want it, you can control in mumble if you want to hear your dead team m8s or not. it's up to you!

theseppo
01-02-2011, 09:45 AM
Me and my team and friends use ventrilo or teamspeak. This prevents the enemy team from hearing you and everyone can give information