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:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Feature Ideas
| | |-+  FS#10199 - Dynamic Range Compression
« previous next »
  • Print
Pages: 1 2 [3] 4

Author Topic: FS#10199 - Dynamic Range Compression  (Read 17497 times)

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: FS#5455 - Dynamic Range Compression
« Reply #30 on: July 07, 2009, 12:08:55 AM »
That patch doesn't actually work.  I'm not sure why he posted it before actually implementing compression. 
Logged

Offline Chronon

  • Rockbox Expert
  • Member
  • *
  • Posts: 4379
Re: FS#5455 - Dynamic Range Compression
« Reply #31 on: July 07, 2009, 12:14:58 AM »
Oops.  I missed this: "This is a cleaned up version of the interface test. Functionality is still forthcoming."


====

It looks like some functionality has now been added.  Also, I updated the topic title to refer to the current patch rather than the obsolete feature request.

(clarify my edit)
« Last Edit: July 12, 2009, 12:21:18 AM by Chronon »
Logged
Sansa e280, Gigabeat F40, Gigabeat S60, Sansa Clip+, iPod Mini 2g

Offline Blue Dude

  • Member
  • *
  • Posts: 19
Re: FS#10199 - Dynamic Range Compression
« Reply #32 on: July 11, 2009, 02:25:34 PM »
I just posted a first attempt at FS#10199.  It does work, but it's not ready for prime time yet.  I've loaded it on my Sansa E280 and it behaves itself so far.
Logged

Offline CCCMikey

  • Member
  • *
  • Posts: 5
Re: FS#10199 - Dynamic Range Compression
« Reply #33 on: July 11, 2009, 10:13:40 PM »
Excellent :) Would you like any of us to trial it and provide feedback yet?

Just converted to RockBox last week and loving it :)
Logged

Offline Blue Dude

  • Member
  • *
  • Posts: 19
Re: FS#10199 - Dynamic Range Compression
« Reply #34 on: July 11, 2009, 11:11:47 PM »
I'm working on bugfixes right now.  I'll post something tomorrow that should work better.

I've got it running on my Sansa E280 at the moment, but I've found several issues that I'm addressing.  I'll post here when a better version is out.

Update: an improved version is posted.  This one has smoother output and most bugs worked out.  Give it a try and leave feedback here please.
« Last Edit: July 13, 2009, 02:15:50 PM by Blue Dude »
Logged

Offline CCCMikey

  • Member
  • *
  • Posts: 5
Re: FS#10199 - Dynamic Range Compression
« Reply #35 on: July 15, 2009, 06:29:27 AM »
Just saw this post - since I read it before it was edited, I didn't get the reply notification - will go see if I can figure out how to install it now :)

Edit: n00b alert: This exceeds my knowledge. I assume the file is at http://www.rockbox.org/tracker/task/10199?getfile=20037 - which yields a text file starting with
Code: [Select]
Index: apps/pcmbuf.c
===================================================================
--- apps/pcmbuf.c (revision 21841)
+++ apps/pcmbuf.c (working copy)

I'm guessing this file doesn't go into RockBox utility, but is either copied to the device or is 'built' somehow? Feel free to ignore this post if I'm too far below a reasonable knowledge to proceed.

If you'd like an example of a loud 'n' quiet file that would test this, you could try http://mpegmedia.abc.net.au/local/sydney/200907/r397504_1862526.mp3
« Last Edit: July 15, 2009, 06:39:57 AM by CCCMikey »
Logged

Offline soap

  • Member
  • *
  • Posts: 1678
  • Creature of habit.
Re: FS#10199 - Dynamic Range Compression
« Reply #36 on: July 15, 2009, 08:36:22 AM »
CCCMikey:
Flyspray contains (for the most part) Patches
Logged
Rockbox Forum Guidelines
The Rockbox Manual
How to Ask Questions the Smart Way

Offline nerdrunner

  • Member
  • *
  • Posts: 33
Re: FS#10199 - Dynamic Range Compression
« Reply #37 on: July 22, 2009, 09:32:44 PM »
As I said in another post, a really good way to implement this would be to utilize the _microphone_ to sample the background sound & adjust the volume & dynamic range compression to match this noise floor.  This is an analogy to a program that you used to be able to get for the Palm Treo that utilized the Treo's builtin camera to sample the amount of ambient light & use this info to set the brightness & contrast on the Treo's display.  Similar ideas are used in some TV's to adjust brightness & contrast.
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: FS#10199 - Dynamic Range Compression
« Reply #38 on: July 22, 2009, 10:27:55 PM »
Adjust volume based on background noise is just a recipe for hearing damage. Compression might make sense though.
Logged

Offline nerdrunner

  • Member
  • *
  • Posts: 33
Re: FS#10199 - Dynamic Range Compression
« Reply #39 on: July 24, 2009, 01:34:36 AM »
Here's a high level description of how a microphone closed loop dynamic range compression system could work.

1.  Implement a simple system to sample the microphone & compute a crude dB number for the ambient background noise.

2.  Implement a system to compute the current dB number from the playing track; this should already be available from the VU meter.

3.  Provide an exponential decay with a time constant sigma1 to filter the background noise.

4.  Provide an exponential decay with a time constant sigma2 to filter the playing track.

5.  Instead of using the volume control to set the absolute dB, utilize the volume control to set the _difference_ between the filtered playback dB and the filtered background noise dB.

6.  Yes, different players, different earphones & different microphones will all affect these numbers, but you can utilize the "volume" control to provide enough headroom above the background noise to hear the podcast and/or music.

7.  If your ears are getting blasted by the earphones with such an algorithm, then you should probably leave the environment, because the earphones are only a few dB ahead of the background dB.  When I'm riding on the subway and/or riding my bike in traffic, the earphones may well have to kick up pretty loud to still be understandable.

8.  The settings of sigma1 & sigma2 should be user controllable.
Logged

Offline soap

  • Member
  • *
  • Posts: 1678
  • Creature of habit.
Re: FS#10199 - Dynamic Range Compression
« Reply #40 on: July 24, 2009, 06:25:25 AM »
Quote from: nerdrunner on July 24, 2009, 01:34:36 AM
7.  If your ears are getting blasted by the earphones with such an algorithm, then you should probably leave the environment, because the earphones are only a few dB ahead of the background dB.  When I'm riding on the subway and/or riding my bike in traffic, the earphones may well have to kick up pretty loud to still be understandable.

The appropriate response from a hearing protection point of view is to always be listening to the same, safe, volume level and to control the background noise be it though passive or active noise reduction.  A few (3) dB over 80ish traffic noise is twice as damaging!

« Last Edit: July 24, 2009, 06:28:54 AM by soap »
Logged
Rockbox Forum Guidelines
The Rockbox Manual
How to Ask Questions the Smart Way

Offline CCCMikey

  • Member
  • *
  • Posts: 5
Re: FS#10199 - Dynamic Range Compression
« Reply #41 on: July 24, 2009, 08:22:00 AM »
Dynamic Range Compression and Ambient noise-based volume adjusting are two rather different things.

Compression is (would be) most useful for those podcasts which are recorded raw and thus have the laughter much louder than the sick joke that caused it :) While this would be particularly useful for cars, etc, where there's a high amount of background noise so you end up getting deafened when someone laughs!

Ambient noise-based volume would also be useful in cars, etc but for a different purpose. Also, I wonder how many devices actually have micrphones out of the box.

Testing patches is currently out of my league at this stage I think, being a Windows guy.



« Last Edit: July 24, 2009, 08:24:45 AM by CCCMikey »
Logged

Offline Chronon

  • Rockbox Expert
  • Member
  • *
  • Posts: 4379
Re: FS#10199 - Dynamic Range Compression
« Reply #42 on: July 24, 2009, 04:58:18 PM »
CCCMikey, you can build just fine on Windows.  You just need to set up a build environment as described in the docs index.

nerdrunner: I also don't like the idea of changing volume level according to sound pressure at a microphone.  I sometimes use IEMs and the volume difference between sound out there and sound "in here" can be quite dramatic (20 to 35 dB).  How is the algorithm supposed to know how loud to drive the phones when it doesn't know the actual sound pressure in my ear canal? 
Logged
Sansa e280, Gigabeat F40, Gigabeat S60, Sansa Clip+, iPod Mini 2g

Offline Blue Dude

  • Member
  • *
  • Posts: 19
Re: FS#10199 - Dynamic Range Compression
« Reply #43 on: August 13, 2009, 11:48:51 PM »
A stable patch is posted at FS#10199.  I'm interested in feedback from users of all kinds of targets.  Sansa E200 works great but I'd like to hear from everyone.
Logged

Offline fredwbauer

  • Member
  • *
  • Posts: 10
Re: FS#10199 - Dynamic Range Compression
« Reply #44 on: October 05, 2009, 01:03:10 PM »
I just updated my Sansa Fuze to version 22895 and I saw the compressor option. It's GREAT. Thank you! Thank you! (Now I can hear the other half of my music over the road noise.) This really makes my Fuze more useful.
Logged

  • Print
Pages: 1 2 [3] 4
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Feature Ideas
| | |-+  FS#10199 - Dynamic Range Compression
 

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

Page created in 0.119 seconds with 14 queries.