• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Trigle

XAudio2 - Pretty poor huh?

5 posts in this topic

Hi guys,

 

During my time at university I created an application using DirectX 10.

 

I needed audio support for the following:

 

1. Background music

2. Ambient repeating samples

3. Effect samples (play once)

 

 

I followed all the Microsoft examples in order to achieve this and it runs on a separate thread to the application real-time logic.

 

1. The background music doesn't impact on performance (great!)

2. If I use anything thats not in xwma format the voices only play for around 30 seconds. The application thinks its still playing sound, no errors are returned or logged by the XAudio2 debug dll.

3. Playing lots of short samples (Play once) sequentially results in a similar behaviour, the sound just cuts out.

 

I have tried this using the release and debug versions of the dll, and the behaviour is the same. I also appear to have no memory leaks.

Originally I thought it was because I was using a submix voice, so I removed it from the chain and send directly to the master voice.

 

Is XAudio2 just a poor library?

 

Any suggestions as to a replacement?

Edited by Trigle
0

Share this post


Link to post
Share on other sites

I haven't started on audio for my current project yet, but i have a feeling its not going to be fun. 

 

when i started my project in jan 2012, Microsoft. as usual was "between versions"  for directx. Xaudio2 was the new API at that time as i recall.

 

The last project i did be fore this one was based on directsound from directx 8.0b. the only thing i had to do was write a 50 channel real time mixer, and write a few simple wrapper routines for play, loop, is_playing, and stop. the directsound API was pretty straighforward by then. 

 

i've heard that xaudio2 is not so hot, although i have get to get into it.

 

one thing, have you made sure you're not exceeding the max number of samples xaudio2 can mix at once? 

 

this is what forced me to write a 50 channel mixer for directsound. it could only mix something like 16 channels. and i'd have more than 16 samples at once sometimes, resulting in "stepping": the oldest sample is stopped prematurely, and a newly staring sample takes its channel over.  so some samples get cut off, and don't play to completion.

0

Share this post


Link to post
Share on other sites

I have yet to see a decent xaudio2 tutorial. If you find one please let me know. I'd love to see a simple wrapper for it. init(), createsound(pSound, format, pData), playsound(pSound, position, loop), stopsound(pSound). don't need anything else... :)

 


"DirectX is like a belt fed machine gun, where every texture change is like hand loading in a new belt of ammo. worse, every mesh (vb) is a new belt of ammo, and a texture is like breaking the gun down, and setting it up again elsewhere, then loading it, then spraying triangles again. so you want to setup the gun once, string all your belts together, load it once, then just spray."
 
Norm Barrows

Do you have a DX9 tutorial I can read on this? :D I got too many draw calls and texture changes, I need to start looking into batching.

0

Share this post


Link to post
Share on other sites



Norman Barrows, on 27 Jul 2013 - 12:56 PM, said:

"DirectX is like a belt fed machine gun, where every texture change is like hand loading in a new belt of ammo. worse, every mesh (vb) is a new belt of ammo, and a texture is like breaking the gun down, and setting it up again elsewhere, then loading it, then spraying triangles again. so you want to setup the gun once, string all your belts together, load it once, then just spray."
 
Norm Barrows
Do you have a DX9 tutorial I can read on this? I got too many draw calls and texture changes, I need to start looking into batching.

 

the closest thing i have is what i call "Norm's directx tips", a text file with a collection of answers to common and uncommon problems in directx. things i've had to research in the past. it has a fair amount of useful stuff, but is in very rough shape. 

 

i personally have had great success with drawing scenes in order based on texture. 9000+ draw calls with no instancing, no LOD, fixed function DX9. see the CAVEMAN screenshots in my gallery for examples.

 

directx is very fast at some things and slow at others. so you want to do the slow stuff (like changing textures) as little as possible.

 

when starting on the graphics engine for CAVEMAN, i came up with  what i call a drawlist. the game throws meshes and textures at the drawlist in any old order, and it figures everything out (basically sorts on texture) and draws it in optimal order. it tracks current texture, mesh, cull state , and alpha test state while drawing, and only changes them as needed.

 

for terrain, a "chunk" is the drawlist for a 300x300 area, already sorted into a list of textures, and for each texture, a list of the meshes that use it and their transforms. 

 

individual ground quads are grouped by texture into a single 300x300 static ground mesh for each texture. this is as close as i get to batching. ground quads were originally dawn one at a time with a dynamic vb and ib.

0

Share this post


Link to post
Share on other sites


Is XAudio2 just a poor library?
No. It's good and probably the best around (for free use). You're doing something very wrong. FYI, I only use Vorbis, and I never had a problem like you describe.
0

Share this post


Link to post
Share on other sites

I use XAct. I find it very easy to use and has many powerful features. I'll post some code if anyone is interested.

1

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
Sign in to follow this  
Followers 0