List Info

Thread: CN-Client: Changing Volume Control to not touch system volume; Software Volume Control (#2)




CN-Client: Changing Volume Control to not touch system volume; Software Volume Control (#2)
user name
2006-10-26 22:49:50
Thanks Greg.

This is now checked into (Core) 150Cay branch. I'll check it
into HEAD 
branch later.


-- 
Daniel Yek


At 02:46 PM 10/25/2006, you wrote:
>So, the core part for this (one) CR is done. I'll commit
this after my 
>other CR is committed (easier for me).
>
>Comment inline.
>
>At 11:47 AM 10/24/2006, Greg Wright wrote:
>>+        free(m_pGaintoolBuffer);
>>+        m_pGaintoolBuffer = NULL;
>>
>>You may find it easier to do
HX_FREE(m_pGaintoolBuffer). If you are in
>>the habit of using the HX_* macros, it is much
harder to forget to
>>NULL a member var out.
>
>Thanks. I changed it to use HX_FREE().
>
>
>>If HELIX_FEATURE_GAINTOOL is not defined, do we
revert to the old
>>behavior? Some mobile builds will not include
HELIX_FEATURE_GAINTOOL
>>but will use ALSA.
>
>Yes.
>
>
>>+                free(pOrig);
>>+                m_nGaintoolBufferLength = 0;
>>
>>It is always good practice to NULL out a free'ed var
(pOrig=NULL).
>
>pOrig is a local variable. The original member variable
is NULL-ed in this 
>case when realloc() returned NULL.
>
>
>>+HXBOOL gainIsSteadyState(GAIN_STATE* g);
>>+
>>
>>you cold make that inline....
>
>I would agree except that in this case, GAIN_STATE is a
hidden struct 
>defined in gain.c, so gain.h doesn't know the fields in
the struct.


Modified by: dyekreal.com
Date: 10/26/2006
Project: Helix Player
Reviewed by: gwrightreal.com and bobclarkreal.com


Synopsis: Helix Player was changing the System/PCM/Device
Volume and users
expressed desire for application volume control to not
influence system
volume. This is another fix.

Overview:
   This is the previous CR.
   http://lists.helixcommunity.org/p
ipermail/player-dev/2006-September/002491.html

   We have changed the approach used to address this
problem.
   In this patch, we are sticking to volume control
interface returned by:
     3. Audio device volume control =
IHXAudioPlayer::GetDeviceVolume()

   GetDeviceVolume() was used in the released players.
   Until now, this volume control has been the:
     system audio device volume control
   which is ALSA's PCM device.

   This patch turns this device Volume Control into:
     Helix audio device volume control
   This one being software volume control.

   This patch utilizes Helix Gaintool to attenuate the
volume. (Despite
   the name.)
   Gaintool changes the audio volume smoothly, without
introducing abrupt
   changes.

   Also, by implementing the software volume control in
Helix's ALSA device
   code, the response delay is capped to about 0.3 second
with smooth changes
   extends slightly beyond 0.6 second.
   In other words, this is a much better implementation than
I was originally
   set to work on. (The delay is capped and Gaintool is
utilized.)

   When the player volume is set to 100, and when Gaintool
has came to the
   steady state, audio data is then sent directly to the
system audio device by
   passing Gaintool processing.
   That means that the user always get the best audio
quality when the volume
   is set to 100, (which means 100% of the current system
volume,) and then the
   system-provided volume control is used to set the desired
volume control,
   because no change of audio data occurs -- Gaintool not
processing it.

   Volume saving and restoring is implemented using the
"volume" preference.

   This fix only implement software volume control in
Helix's ALSA device code,
   not in OSS. When the volume control preference is set to
OSS, the volume
   control still changes system volume.


Files Modified:
audio/device/platform/unix/audlinux_alsa.cpp  - Implement
Software Volume
     Control and Gaintool interface code.
audio/device/platform/unix/audlinux_alsa.h    - Member
variables, macros.

player/hxclientkit/src/CHXClientPlayer.cpp    -
"volume" preference.
player/hxclientkit/src/CHXClientPlayer.h      - Member
variable for engine 
callback.

audio/device/auddevlib_linux2.pcf - Added gain.h include
path.
audio/gaintool/gain.c       - Added gainIsSteadyState().
audio/gaintool/pub/gain.h   - Added gainIsSteadyState().
client/audiosvc/pub/mixengine.h - Move static utility member
functions to 
public.


Platforms and Profiles Affected:
Linux

Platforms and Profiles Build Verified:
Profile: helix_client_all_define
Platform: Fedora Core 5

Platforms and Profiles Functionality verified:
Profile: helix_client_all_define
Platform: Fedora Core 5

Branch: (Core) 150Cay.

Copyright assignment: I am a RealNetworks employee.







_______________________________________________
Audio-dev mailing list
Audio-devhelixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/audio
-dev
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )