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:

Rockbox Ports are now being developed for various digital audio players!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Hardware
| | |-+  Modifying Rockbox to control an external digital potentiometer via iPod 5.5g
« previous next »
  • Print
Pages: [1]

Author Topic: Modifying Rockbox to control an external digital potentiometer via iPod 5.5g  (Read 3498 times)

Offline axismundi

  • Member
  • *
  • Posts: 6
Modifying Rockbox to control an external digital potentiometer via iPod 5.5g
« on: March 08, 2011, 06:28:33 PM »
Hi everyone,

I recently purchased an iPod 5.5g for which I plan to build a separate headphone amp stage. I am currently testing some prototypes and I am quite happy about the improvements I can hear and measure.

Taking the input signal from line out rather than headphone out results in a better sound (no surprises here) and using Rockbox partially helps in that it allows software control over the line out volume. However, the lack of hardware control over the line out means that the lower the listening levels, the worse the signal-to-noise ratio.

The solution I am contemplating is to use a digital potentiometer controlled by the processor in iPod. This will allow an overall "hardware" adjustment of the line out volume, maintaining the signal-to-noise ratio relatively constant regardless of the volume.

There are quite many I2C controlled digital potentiometers available (such as Maxim MAX5387http://www.maxim-ic.com/datasheet/index.mvp/id/6412, Maxim DS1881 http://www.maxim-ic.com/datasheet/index.mvp/id/4661/t/al, Analog Devices AD5243 http://www.analog.com/en/digital-to-analog-converters/digital-potentiometers/ad5243/products/product.html etc.). The good part is that the Wolfson DAC in the iPod has an integrated digital potentiometer controlled via an I2C interface so in theory one should be able to use this. The bad part that I foresee is related to the fact that I do not expect the I2C instructions used to control the DAC to coincide with the ones required by the third party digital potentiometers, so this is why this post.

The limitations I am facing are that I am not that familiar with digital electronics and I2C protocol, not to mention that I have limited programming knowledge. Is there anyone fairly familiar with the subject that could let me know if my assumptions/plan are reasonable? If so, how difficult it would be to use such a potentiometer and having it controlled by Rockbox via the iPod? Any feedback, advice, help/tutorials would be greatly appreciated.

LE: There is of course the alternative of using a traditional potentiometer, but due to the project restrictions this is not a solution.

Thanks!
« Last Edit: March 08, 2011, 06:34:22 PM by axismundi »
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: Modifying Rockbox to control an external digital potentiometer via iPod 5.5g
« Reply #1 on: March 08, 2011, 06:37:53 PM »
Quote from: axismundi on March 08, 2011, 06:28:33 PM
Taking the input signal from line out rather than headphone out results in a better sound (no surprises here) and using Rockbox partially helps in that it allows software control over the line out volume. However, the lack of hardware control over the line out means that the lower the listening levels, the worse the signal-to-noise ratio.

The line out has hardware volume control IIRC.  Have you tried just using that?

Edit:  This looks like the commit you want:

http://svn.rockbox.org/viewvc.cgi?view=rev&revision=9181

The wmcodec_set_lineout_vol function should let you adjust the volume. 
« Last Edit: March 08, 2011, 06:47:53 PM by saratoga »
Logged

Offline axismundi

  • Member
  • *
  • Posts: 6
Re: Modifying Rockbox to control an external digital potentiometer via iPod 5.5g
« Reply #2 on: March 08, 2011, 07:31:37 PM »
Thanks for the quick reply, saratoga!

I had the impression that only the HO out in WM8758 has hardware volume control... I will check again the datasheet and google about this. I really hope you're right, it would be the best solution.

I assume the "commit" linked is something which is not implemented in the standard build (bear with me, I am a very happy user of Rockbox but not much more), so I have to learn how to apply it. Anyway, it looks like I have some homework to do. Thanks again!
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: Modifying Rockbox to control an external digital potentiometer via iPod 5.5g
« Reply #3 on: March 08, 2011, 07:35:46 PM »
Quote from: axismundi on March 08, 2011, 07:31:37 PM
I had the impression that only the HO out in WM8758 has hardware volume control... I will check again the datasheet and google about this. I really hope you're right, it would be the best solution.

I didn't think there was a datasheet for the WM8758.

Quote from: axismundi on March 08, 2011, 07:31:37 PM
I assume the "commit" linked is something which is not implemented in the standard build (bear with me, I am a very happy user of Rockbox but not much more), so I have to learn how to apply it. Anyway, it looks like I have some homework to do. Thanks again!

Commits are changes to the rockbox source code.  If you click that link, you can see that it was committed on Mar 22, 2006 as well as a description of what it does (prevents the line out volume from changing when you adjust the volume).  Should be easily enough for you to change back.
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: Modifying Rockbox to control an external digital potentiometer via iPod 5.5g
« Reply #4 on: March 08, 2011, 07:49:55 PM »
Quote from: saratoga on March 08, 2011, 07:35:46 PM
Quote from: axismundi on March 08, 2011, 07:31:37 PM
I had the impression that only the HO out in WM8758 has hardware volume control... I will check again the datasheet and google about this. I really hope you're right, it would be the best solution.

I didn't think there was a datasheet for the WM8758.

Quote from: axismundi on March 08, 2011, 07:31:37 PM
I assume the "commit" linked is something which is not implemented in the standard build (bear with me, I am a very happy user of Rockbox but not much more), so I have to learn how to apply it. Anyway, it looks like I have some homework to do. Thanks again!

Commits are changes to the rockbox source code.  If you click that link, you can see that it was committed on Mar 22, 2006 as well as a description of what it does (prevents the line out volume from changing when you adjust the volume).  Should be easily enough for you to change back.

Just so this shows up . . .
Logged

Offline dreamlayers

  • Developer
  • Member
  • *
  • Posts: 425
  • Boris Gjenero
    • My Blog
Re: Modifying Rockbox to control an external digital potentiometer via iPod 5.5g
« Reply #5 on: March 09, 2011, 01:03:24 AM »
The WM8758 DAC has a volume control which affects line out.  I've never seen a WM8758 datasheet, but the WM8983 datasheet describes this.  Search for DACLVOL and DACRVOL.  It's an 8 bit value allowing values between 0dB and -127dB in 0.5dB steps.  It is used by FS#10082, which has been committed.  The full range isn't used, but the code should be easy to change if you need more range.
Logged

Offline axismundi

  • Member
  • *
  • Posts: 6
Re: Modifying Rockbox to control an external digital potentiometer via iPod 5.5g
« Reply #6 on: March 09, 2011, 04:39:42 AM »
Thanks everyone.

Indeed, the datasheet for WM8758 is not available, but apparently both WM8978 and WM8983 are almost equivalents, so I have been using the documentation available for these.

The chips have three stereo outputs, two of them being volume controlled (LOUT1/ROUT1, LOUT2/ROUT2) and one at fixed gain (OUT3/OUT4). I had assumed that the one used for line out is OUT3/OUT4 because this is what the datasheet implies (or sort of).

Finding out that I was wrong is very good news for me, I have high hopes on this. I'll work on it during the weekend, still need to do some reading and research to learn how to do it but I should be fine.
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Hardware
| | |-+  Modifying Rockbox to control an external digital potentiometer via iPod 5.5g
 

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

Page created in 0.08 seconds with 15 queries.