Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Question about audiohw_set_xxx_vol

Question about audiohw_set_xxx_vol

From: Christian Gmeiner <christian.gmeiner_at_gmail.com>
Date: Wed, 2 Jul 2008 07:52:52 +0000

Hi all,

as the term at university is over I have some time to work more on
sound.c and affected files :)
At the moment I am looking at set_prescaled_volume in sound.c... the
big ifdef suff at the end of
this method.

#if CONFIG_CODEC == MAS3507D
    dac_volume(tenthdb2reg(l), tenthdb2reg(r), false);
#elif defined(HAVE_UDA1380) || defined(HAVE_WM8975) || defined(HAVE_WM8758) \
   || defined(HAVE_WM8731) || defined(HAVE_WM8721) || defined(HAVE_WM8751) \
   || defined(HAVE_AS3514) || defined(HAVE_TSC2100)
    audiohw_set_master_vol(tenthdb2master(l), tenthdb2master(r));
#if defined(HAVE_WM8975) || defined(HAVE_WM8758) \
   || (defined(HAVE_WM8751) && !defined(MROBE_100)) \
   || defined(HAVE_TSC2100) || defined(HAVE_WM8985)
    audiohw_set_lineout_vol(tenthdb2master(0), tenthdb2master(0));
#endif

#elif defined(HAVE_TLV320) || defined(HAVE_WM8978) || defined(HAVE_WM8985)
    audiohw_set_headphone_vol(tenthdb2master(l), tenthdb2master(r));
#endif


My goal is it to get rid of it... but there are - I think - two ways to do it.

1) Introduce an #define in each audio driver header... something like
#define audiohw_set_volume(l, r)
audiohw_set_master_vol(tenthdb2master(l), tenthdb2master(r))

Then I would use audiohw_set_volume in sound.c

2) Extend the current audiohw api with methods like
void audiohw_set_master_vol(int l, int r)
void audiohw_set_lineout_vol(int l, int r)

and use master for setting volume for headphones and lineout for
changing vol at lineout.
BUT as far as I can see lineout is not used in rockbox at the moment
(called from /apps )...

....hmmm....

How do we want to handle lineout? Do we really need it?

I would go for 2), as it seems for me the cleanest solution.

thanks,
Christian
Received on 2008-07-02

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy