Rockbox mail archiveSubject: 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
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
#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)
#if defined(HAVE_WM8975) || defined(HAVE_WM8758) \
|| (defined(HAVE_WM8751) && !defined(MROBE_100)) \
|| defined(HAVE_TSC2100) || defined(HAVE_WM8985)
#elif defined(HAVE_TLV320) || defined(HAVE_WM8978) || defined(HAVE_WM8985)
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)
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 )...
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.
Received on 2008-07-02