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
| |-+  Hardware
| | |-+  Fuze and Griffin Dock line out
« previous next »
  • Print
Pages: [1] 2 3 ... 5

Author Topic: Fuze and Griffin Dock line out  (Read 33770 times)

Offline Avalon

  • Member
  • *
  • Posts: 88
Fuze and Griffin Dock line out
« on: October 15, 2009, 11:44:13 AM »
Hi,

I have an 8Gb Fuze V1 with 4Gb microsd installed and Rockboz is working great on it for mp3s.

I also have a Griffin dock with a line out that works great when in the sansa OS mode.  When I switch to Rockbox OS, I do not get an output on the line out.

Is there a setting to correct this, or does this require a firmware modification? 
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8966
Re: Fuze and Griffin Dock line out
« Reply #1 on: October 15, 2009, 11:52:49 AM »
You will need to add support for line out to the AMS audio driver.
Logged

Offline Avalon

  • Member
  • *
  • Posts: 88
Re: Fuze and Griffin Dock line out
« Reply #2 on: November 01, 2009, 10:48:34 PM »
I wish that I could write the code. 

When in the Fuze is connected to the dock, it automatically turns on in Sansa OS with the line out enabled.  If I hold the select button while inserting the Fuze in the dock, it stays in Rockbox mode, but the line out is not enabled.

This is not a selection in the OS, but looks like the line out is enabled when voltage is applied to the appropriate connector pins.  For those of us who connect the Fuze to stereo systems, etc, the use of the dock capability would be a great feature to have.

Is there any chance that this would be built into the Rockbox OS or Fuze build? 
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8966
Re: Fuze and Griffin Dock line out
« Reply #3 on: November 01, 2009, 11:02:14 PM »
I'm sure someone will figure it out eventually.  In the mean time if you want to make that more likely you could check the debug menu's "View IO Ports screen" and see if any of the GPIO pins change values when you plug/unplug the dock.  If they do, maybe whatever pin the dock flips is a GPIO pin.
Logged

Offline Avalon

  • Member
  • *
  • Posts: 88
Re: Fuze and Griffin Dock line out
« Reply #4 on: November 03, 2009, 04:18:29 PM »
First of all, thankyou very much for getting back to me.

I checked the View IO Ports Screen and found that the following changed:

Fuze not in dock:
GPIOA  = E2
DBOP_DIN=8843

FUZE docked:
GPIOA = EA (bit 4 change)
DBOP_DIN=8A43

Nothing else changed and this is consistently repeatable.

Does this mean that there is hope?

My guess is that in the FUZE OS, the line out is always enabled but requires the voltage to be applied for it to work.

If that is the case, then if the correct register is written to in the Rockbox startup to enable the line out, then the dock would work when the Fuze is attached.

I hope that this helps and thanks again for the response.
Logged

Offline mc2739

  • Developer
  • Member
  • *
  • Posts: 262
Re: Fuze and Griffin Dock line out
« Reply #5 on: November 03, 2009, 06:25:29 PM »
Quote from: Avalon on November 03, 2009, 04:18:29 PM
Fuze not in dock:
GPIOA  = E2
DBOP_DIN=8843

FUZE docked:
GPIOA = EA (bit 4 change)
DBOP_DIN=8A43

The GPIOA change is actually bit 3 and is the bit we currently use to detect the attachment of the USB cable.  The DBOP_DIN bit is probably the one we need to look into further.  That bit does not change upon attachment of the USB cable (at least on the e200v2 - most likely the Fuze is the same).
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8966
Re: Fuze and Griffin Dock line out
« Reply #6 on: November 03, 2009, 06:48:14 PM »
Quote from: Avalon on November 03, 2009, 04:18:29 PM
First of all, thankyou very much for getting back to me.

I checked the View IO Ports Screen and found that the following changed:

Fuze not in dock:
GPIOA  = E2
DBOP_DIN=8843

FUZE docked:
GPIOA = EA (bit 4 change)
DBOP_DIN=8A43

Nothing else changed and this is consistently repeatable.

http://www.rockbox.org/wiki/SansaAMSHardwareMappings

According to that, GPIOA[3] is USB inserted.  Does your dock also have USB?  Does the pin change even when the USB cable isn't hooked up to a computer?


Quote from: Avalon on November 03, 2009, 04:18:29 PM
My guess is that in the FUZE OS, the line out is always enabled but requires the voltage to be applied for it to work.

If that is the case, then if the correct register is written to in the Rockbox startup to enable the line out, then the dock would work when the Fuze is attached.


Its disabled by default.  We can enable it, but without a way to detect that the dock is in theres no way to know when to enable it.

DBOP_DIN9 is unassigned currently.  Maybe thats how you tell if theres a USB or USB + dock. 
Logged

Offline kugel.

  • Developer
  • Member
  • *
  • Posts: 271
Re: Fuze and Griffin Dock line out
« Reply #7 on: November 03, 2009, 06:56:13 PM »
Interesting find. I'd like to know what the DBOP pin means exactly.


Just for the line out/Dock, I assume checking the GPIOA pin would be sufficient for enabling line out. Unless we cannot have headphones and lineout at the same time (?).
Logged
 

Offline Avalon

  • Member
  • *
  • Posts: 88
Re: Fuze and Griffin Dock line out
« Reply #8 on: November 03, 2009, 10:47:38 PM »
The griffin dock I have has a line out (to stereo) and a mini usb connector.  You can connect the usb to a computer or to a usb charger.

The description I gave of the pin change when connecting the Fuze was with the usb connected to a charger (120V to usb). 

When using the Sansa OS, when the Fuze is plugged into the dock, the Fuze turns on and the line out is enabled.  If the Fuze is already on in Sansa mode, when it is plugged into the dock, it stays powered up and again the line out works.  If the Fuze is in Rockbox mode and is plugged into the dock with the select button depressed, the Fuze stays in Rockbox mode, but the line out is not enabled.

It appears that the USB voltage is sensed and used to both turn on the Fuze in Sansa mode and enable the line out.

In Rockbox mode, the requirement would seem to be to sense the USB voltage and turn on the line out.  When the usb voltage is removed, to turn off the line out.  Perhaps, just permanently enabling it would be fine if that did not drain the battery.  The usb voltage I am referring to in this case is used for charging the Fuze.

I believe that this is the pinout for the Fuze connector:
1 - power
2 - power
3 - ground
4 - usb d+
5 - usb d-
6 - ground
7 - power via 47k resistor
13 - ground
18 - ground
20 - ground
27 - audio out right
28 - audio out left
29 - audio common

When pin 7 is pulled to +5V by the dock, the audio out lines are activated.  I understand that the external power source is required to drive the line outs.

Based on forum discussions, the Rockboxed E200 either activates the audio outs when inserted in the dock or the audi outs are permanently enabled.  I haven't confirmed this because I do not own an E200, but the dock pinout is compatible with Fuze and E200.

As a final note, the dock does not allow headphone use and line out at the same time since both connectors are on the bottom of the Fuze.  You cannot physically attach the Fuze to the dock with a headphone connector attached. 
« Last Edit: November 03, 2009, 10:56:15 PM by Avalon »
Logged

Offline skinsman

  • Member
  • *
  • Posts: 2
Re: Fuze and Griffin Dock line out
« Reply #9 on: November 16, 2009, 12:42:27 AM »
Quote
"Based on forum discussions, the Rockboxed E200 either activates the audio outs when inserted in the dock or the audi outs are permanently enabled.  I haven't confirmed this because I do not own an E200, but the dock pinout is compatible with Fuze and E200."

I've got an e200v1 and an e200v2 (AMS) along with a couple of Griffin PowerDocks.  I've been using RockBox on the e200v1 for a while successfully with the dock - audio through the dock is active but is affected by the volume control.  Interestingly the audio works whether power is applied to the dock or not.  This is different to the original firmware which had audio unaffected by the volume control AND the audio works only when power is applied to the dock.

I've just tried RockBox on my e200v2 (AMS) and found audio through the dock doesn't work.  I guess that's to be expected given what you're seeing with the Fuze.  I hope a patch for this will be available soon!  Let me know if I can help with testing or whatever.
Logged

Offline Avalon

  • Member
  • *
  • Posts: 88
Re: Fuze and Griffin Dock line out
« Reply #10 on: November 16, 2009, 09:42:22 AM »
That is interesting and thankyou for the E200 input.

With the Sansa OS, the dock outputs constant levels unaffected by the Fuze volume control.  The level iappears to be much better than the Fuze headphone output for feeding into amplifiers, etc. and maintains the charge at 100%.

It looks as if the E200V2 and FuzeV1 behave similarly when connected to the dock.  Since the Sansa OS allows the dock to work, the hardware is there....a firmware mod is required.

If anyone has the coding ability to do it and has a look, there is a change that would be an improvement over the Sansa OS:

If the line out is enabled for the E200V2 and FuzeV1 via the Griffin Dock, it would be an improvement over the Sansa firmware if there is a selection for volume control via the Fuze/E200V2 or just constant line out.

If this was provided, the dock could be used for
1. constant level out for input to amplifiers, etc and
2. for headphone output with volume control if selected.

Both would allow charging while playing and provide the required output for both applications.  The latter would be great for using the dock in the office or any fixed setting.

I really hope that someone does pick this up and has a go at the code.

Thks
Logged

Offline Avalon

  • Member
  • *
  • Posts: 88
Re: Fuze and Griffin Dock line out
« Reply #11 on: January 13, 2010, 06:06:42 AM »
Regarding the questions regarding whether line out and headphone connectors can be enabled at the same time:

1.  When the Fuze is connected to a dock or computer USB, It is being charged and powered by an external source.  For that reason, there should be no drain on the battery and power consumption should not be a concern if both outputs are enabled. 

2.  It is my understanding that the line out and headphone out are two separate outputs.   If so, they do not affect each other if both are enabled.

For these reasons, it would seem logical that if the Fuze is connected to a USB or other power source, then both outputs could be enabled.  If not connected to an external power source, then only the headphone out would be enabled.

I am making this suggestion to hopefully reduce the complexity of any code changes.  if anyone knows of any reason why this would not work, please indicate.

In my case, when I use the Griffin dock, the headphone output is not accessible since it is located on the bottom of the Fuze and blocked by the base.  Therefore, if headphone out is enabled with the line out, there is no issue anyway.  However, if both outputs were accessible and enabled, I do not believe that it presents any problems since an external power source is applied anyway.
Logged

Offline gglul

  • Member
  • *
  • Posts: 3
Re: Fuze and Griffin Dock line out
« Reply #12 on: March 03, 2010, 09:24:54 AM »
Hi,

I have a Sansa E200v2. I tried to enable the Audio Line Out and the Speaker Out in the AS3525 by the firmware, but nothing appeared on pins 27, 28 & 29 of the dock connector.

I assume, we need to enable some GPIO / DBOP in order to activate some HW outside the AS3525 which will then make the audio towards the dock connector...

 :'(

Does anybody have a schematic of the sansa showing how the components are connected to each other and to the external interfaces?


Many Thanks,
Gglul
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8966
Re: Fuze and Griffin Dock line out
« Reply #13 on: March 03, 2010, 01:45:23 PM »
Quote from: gglul on March 03, 2010, 09:24:54 AM
I assume, we need to enable some GPIO / DBOP in order to activate some HW outside the AS3525 which will then make the audio towards the dock connector...

I don't think theres anything else to activate.  Can you post a diff of what you enabled?

Quote from: gglul on March 03, 2010, 09:24:54 AM
Does anybody have a schematic of the sansa showing how the components are connected to each other and to the external interfaces?

I guess you could take apart the player and use a DMM to figure out where the dock pins go, but I don't think anyone has.


Many Thanks,
Gglul
[/quote]
Logged

Offline gglul

  • Member
  • *
  • Posts: 3
Re: Fuze and Griffin Dock line out
« Reply #14 on: March 03, 2010, 05:53:24 PM »
Hi,

I found my mistake in my code which I put into the procedure:
Code: [Select]
void audiohw_mute(bool mute)When the Line Out is muted then I need to clear the LINE_OUT_L_LO_SES_DM_SE_ST bits and when it is not muted then I need to set them. However, I put this in the other way, so the Line Out was always muted...

Code: [Select]
void audiohw_mute(bool mute)
{
    if (mute) {
        as3514_set(AS3514_HPH_OUT_L, HPH_OUT_L_HP_MUTE);
        as3514_clear(AS3514_LINE_OUT_L, LINE_OUT_L_LO_SES_DM_SE_ST);
    } else {
        as3514_clear(AS3514_HPH_OUT_L, HPH_OUT_L_HP_MUTE);
        as3514_set(AS3514_LINE_OUT_L, LINE_OUT_L_LO_SES_DM_SE_ST);
    }
}

After correcting this in Patch-1 the Line Out just works fine!  ;)



Many Thanks,
Glgul


==========================

Hi,

I'm not so much an expert in patching, but here is what I have done.

The settings and register details of the Audio Line Out / Speaker Out can be found on page (129-130) / (134-137) & 148-149 of the technical description of the AS3525.

I downloaded the source code from SVN (R24777) and I identified the /firmware/drivers/audio/as3514.c as containing the procedures & functions to handle the audio settings (audio driver).

Here are the patches that I tried:

Patch-1:

Code: [Select]
Index: as3514.c
===================================================================
--- as3514.c (revision 24777)
+++ as3514.c (working copy)
@@ -151,8 +151,8 @@
 
     /* Set ADC off, mixer on, DAC on, line out off, line in off, mic off */
 
-    /* Turn on SUM, DAC */
-    as3514_write(AS3514_AUDIOSET1, AUDIOSET1_DAC_on | AUDIOSET1_SUM_on);
+    /* Turn on line out, DAC, SUM */
+    as3514_write(AS3514_AUDIOSET1, AUDIOSET1_LOUT_on | AUDIOSET1_DAC_on | AUDIOSET1_SUM_on);
 
     /* Set BIAS on, DITH on, AGC on, IBR_DAC max, LSP_LP on, IBR_LSP min */
     as3514_write(AS3514_AUDIOSET2,
@@ -250,6 +250,8 @@
 #endif
     as3514_write_masked(AS3514_HPH_OUT_R, hph_r, AS3514_VOL_MASK);
     as3514_write_masked(AS3514_HPH_OUT_L, hph_l, AS3514_VOL_MASK);
+    as3514_write_masked(AS3514_LINE_OUT_R, hph_r, AS3514_VOL_MASK);
+    as3514_write_masked(AS3514_LINE_OUT_L, hph_l, AS3514_VOL_MASK);
 }
 
 void audiohw_set_lineout_vol(int vol_l, int vol_r)
@@ -262,8 +264,10 @@
 {
     if (mute) {
         as3514_set(AS3514_HPH_OUT_L, HPH_OUT_L_HP_MUTE);
+        as3514_set(AS3514_LINE_OUT_L, LINE_OUT_L_LO_SES_DM_SE_ST);
     } else {
         as3514_clear(AS3514_HPH_OUT_L, HPH_OUT_L_HP_MUTE);
+        as3514_clear(AS3514_LINE_OUT_L, LINE_OUT_L_LO_SES_DM_SE_ST);
     }
 }
 

Patch-2:


Code: [Select]
Index: as3514.c
===================================================================
--- as3514.c (revision 24777)
+++ as3514.c (working copy)
@@ -151,8 +151,8 @@
 
     /* Set ADC off, mixer on, DAC on, line out off, line in off, mic off */
 
-    /* Turn on SUM, DAC */
-    as3514_write(AS3514_AUDIOSET1, AUDIOSET1_DAC_on | AUDIOSET1_SUM_on);
+    /* Turn on line out, DAC, SUM */
+    as3514_write(AS3514_AUDIOSET1, AUDIOSET1_LOUT_on | AUDIOSET1_DAC_on | AUDIOSET1_SUM_on);
 
     /* Set BIAS on, DITH on, AGC on, IBR_DAC max, LSP_LP on, IBR_LSP min */
     as3514_write(AS3514_AUDIOSET2,
@@ -170,9 +170,9 @@
     as3514_write(AS3514_AUDIOSET3, AUDIOSET3_HPCM_off);
 #endif
 
-    /* Mute and disable speaker */
+    /* Power up speaker stage & mute speaker */
     as3514_write(AS3514_LSP_OUT_R, LSP_OUT_R_SP_OVC_TO_256MS | 0x00);
-    as3514_write(AS3514_LSP_OUT_L, LSP_OUT_L_SP_MUTE | 0x00);
+    as3514_write(AS3514_LSP_OUT_L, LSP_OUT_L_SP_MUTE | LSP_OUT_L_SP_ON | 0x00);
 
     /* Set headphone over-current to 0, Min volume */
     as3514_write(AS3514_HPH_OUT_R,
@@ -250,6 +250,11 @@
 #endif
     as3514_write_masked(AS3514_HPH_OUT_R, hph_r, AS3514_VOL_MASK);
     as3514_write_masked(AS3514_HPH_OUT_L, hph_l, AS3514_VOL_MASK);
+//    as3514_write_masked(AS3514_LINE_OUT_R, hph_r, AS3514_VOL_MASK);
+//    as3514_write_masked(AS3514_LINE_OUT_L, hph_l, AS3514_VOL_MASK);
+    as3514_write_masked(AS3514_LSP_OUT_R, hph_r, AS3514_VOL_MASK);
+    as3514_write_masked(AS3514_LSP_OUT_L, hph_l, AS3514_VOL_MASK);
+
 }
 
 void audiohw_set_lineout_vol(int vol_l, int vol_r)
@@ -262,8 +267,12 @@
 {
     if (mute) {
         as3514_set(AS3514_HPH_OUT_L, HPH_OUT_L_HP_MUTE);
+//        as3514_set(AS3514_LINE_OUT_L, LINE_OUT_L_LO_SES_DM_SE_ST);
+ as3514_set(AS3514_LSP_OUT_L, LSP_OUT_L_SP_MUTE);
     } else {
         as3514_clear(AS3514_HPH_OUT_L, HPH_OUT_L_HP_MUTE);
+//        as3514_clear(AS3514_LINE_OUT_L, LINE_OUT_L_LO_SES_DM_SE_ST);
+        as3514_clear(AS3514_LSP_OUT_L, LSP_OUT_L_SP_MUTE);
     }
 }
 

Please, I would appreciate your feedback.

Many Thanks,
Gglul
« Last Edit: March 04, 2010, 01:33:30 PM by gglul »
Logged

  • Print
Pages: [1] 2 3 ... 5
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Hardware
| | |-+  Fuze and Griffin Dock line out
 

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

Page created in 0.154 seconds with 21 queries.