From: Miguel F. <mfr...@gm...> - 2005-01-14 12:46:56
|
hey Bastien, On Fri, 14 Jan 2005 00:21:25 +0000, Bastien Nocera <ha...@ha...> wrote: > That wasn't exactly the problem. I use the amp in Totem rather than the > soundcard's real volume so that one can change the volume of the movie > without modifying that of the whole desktop. i understand that, although i prefer to use sound card's amp myself. software volume will probably always decrease quality imho. if you increase volume, you risk saturating the signal by the largest integer, therefore you add a lot of undesired harmonics. if you decrease volume, you are effectively reducing the useful dynamic range of the sound cards' DAC. still i understand your point, some people might prefer a worse quality sound than having to change the desktop volume... lazy people :-) (not to mention the fact that if the sound card volume is low, it doesn't matter how much the user increases volume on xine he will never be able to make it louder) > The current problem with the amp is that it takes a bit too much CPU for > my liking, that it sounds bad on some streams, and that it doesn't > handle 24-bit samples. > > If there was a good library/project to steal this mixer from, I'd be > happy to implement the xine bits. I won't do it myself, because I have > no clue how to do it right myself, and I don't like maths ;) ok, current code seems to do software volume with a floating point factor which might not be a good solution cpu wise (except for floating point samples). despite of that, software volume should be trivial math - it is just a linear operation. we might reduce cpu usage by multiplying by an integer factor and then performing a fixed number of >> to divide it again. adding support for 24 (integer) and 32 bits (float) is also just a matter of new if cases, probably much simpler than looking for another project to borrow code... another possibility is coding software volume with mmx since it does saturation arithmetic pretty easy. Miguel |