Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Audio Playback, Database and Playlists
| | |-+  Moving the volume control to software codec for iriver h120?
« previous next »
  • Print
Pages: [1]

Author Topic: Moving the volume control to software codec for iriver h120?  (Read 1638 times)

Offline s3t

  • Member
  • *
  • Posts: 9
Moving the volume control to software codec for iriver h120?
« on: April 20, 2010, 05:44:51 PM »
Hi,

I use iriver h120 player connected to external DAC via spdif.
The volume doesn't change on spdif output while the headphones/line out do change the volume according the volume setting.

I think it's due to use of external hardware codec capabilities instead of software audio stream modification.

All i'm trying to do is bypass the HW and enable the SW volume processing.

I've tried defining the HAVE_SW_VOLUME_CONTROL in firmware\export\config\iriverh120.h as follows:
#define HAVE_SW_VOLUME_CONTROL
#define SW_VOLUME_MIN   -73
#define SW_VOLUME_MAX   0

with not much success.

Can anyone suggest where should i look next?

I have compiling environment up and running.
Thanks!



UPD:
Does "PRESCALER" capability of the hardware mean it's ability to control volume, i.e. "prescale" the audio output?

UPD2:
Yes, prescaler is the one. The volume now changes, yet only when i change EQ settings and other sound settings too.

UPD3:
Ok, the volume works in playback screen too, yet there is some delay between the value displayed on screen (and stored in global_settings.volume) and actual volume change.
My guess is it's due the playback buffer.
Yet, this could be a bug introduced by my iterations of source code.
Can someone confirm this is normal for software-based volume controlled players? Is there anything to do with it?

Many thanks!
« Last Edit: April 20, 2010, 08:45:39 PM by s3t »
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: Moving the volume control to software codec for iriver h120?
« Reply #1 on: April 20, 2010, 11:04:53 PM »
Quote from: s3t on April 20, 2010, 05:44:51 PM
Ok, the volume works in playback screen too, yet there is some delay between the value displayed on screen (and stored in global_settings.volume) and actual volume change.
My guess is it's due the playback buffer.

Correct.  Software volume controls won't take effect until the altered samples are actually played.  You can decrease the size of the PCM buffer, but you may get skips, particularly on a HD player.
Logged

Offline s3t

  • Member
  • *
  • Posts: 9
Re: Moving the volume control to software codec for iriver h120?
« Reply #2 on: April 21, 2010, 03:49:10 AM »
Could i move the volume prescaler to the output of i2s stream?

I can take the global_settings.volume and shift the bits on the output frames according to volume settings. This would give me a 3db steps, yet it should be simple to implement and wouldn't take much cpu time.

As long as the frames are sent out from the PCM buffer on frame-by-frame basis...


UPD:
The playback process seems way complicated - couldn't figure out where the DMA stream is actually written to i2s port.

As a though: i could swap the hard drive for a bigger CF flash card = better overall timings...


UPD2:
Still unable to find the place PCM buffer is going out of the CPU. Does the CPU itself manages the stream and it's flow to the i2s port? The main problem is that when it comes to DMA, the different parts of source don't relate to each other - they run in separate threads each of which doing the thing it's supposed to do. I've found interrups of pcm buffer chunks sequencing, but nothing more. :(
Could anyone point me to the right file/function name/something to look for?
Thanks!
« Last Edit: April 22, 2010, 03:48:20 PM by s3t »
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Audio Playback, Database and Playlists
| | |-+  Moving the volume control to software codec for iriver h120?
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.063 seconds with 15 queries.