• Status Closed
  • Percent Complete
  • Task Type Patches
  • Category Operating System/Drivers
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Version 3.1
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by kugel. - 2009-02-20
Last edited by funman - 2010-03-05

FS#9933 - Sansa Fuze & e200v2: Unify drivers

This patch unifies much of the now duplicated code for e200v2 and fuze in several new files (dbop-e200v2-fuze.c, lcd-e200v2-fuze.c, button-e200v2-fuze.c).

As far as my experience goes, this two targets have too much in common to have the code split and duplicated.

Needs testing on the e200v2. Also, I’m wondering if this good at all, since the other ams sansas are still split, and most functions cannot be static anymore.

Closed by  funman
2010-03-05 23:55
Reason for closing:  Out of Date

Ok, this one is properly diff’d against r20067

Well it functions on my e280 but not well. The buttons work fine. The scrolling action is a step backward but we’ve had this discussion before. Scrolling does work as long as you turn the wheel rather slowly. If you turn the wheel quickly it starts to skip and even goes backwards at times. It also “wraps” the menus instead of stopping at the top and bottom. I understand that it works well on the fuze but I really think the e200v1 scroll code works better for the e200v2, especially after using it for the past week…. I couldn’t get music playing no matter how hard I tried. Radio was not a problem though and plugins with the scrollwheel were similar to the menu action.

Can you please try if changing “QUEUE_SKIP_COUNTER” in firmware/target/arm/as3525/sansa-e200v2/button-target.h to other values helps?

I tried 0,1,2,4,6 and they all displayed pretty much the same behavior just the smaller numbers moved things quicker which I thought was to be expected. Playing music was not a problem but keeping it playing is not as consistent. The music not playing part of my previous comment was not related to this patch it seems, something else was wrong. The hold button behavior is back to normal with this patch also.

Ok, another approach. I base this on this one on the e200v2 scrollwheel driver. It doesn’t contain much changes. I just implemented the repeat from the Fuze (repeat is particulary needed, so that it doesn’t wrap on the end at lists, the fuze has it and it works there). I also implemented a preliminary acceleration, as to turn on wheel fast mode, if repeat is high enough.

I really want to unify the driver, and I hope going from the e200v2 side, it could work.

The menus still wrap but aside from that I would call the scroll action acceptable. No reversal or stall at high spin rates, not really jumpy. The wrap is a bit annoying though once you get used to no wrap. I tried to relate another patch to this one with the dbop delay removed and the gpio delay reduced to 2 from 50 but I couldn’t figure out how. I think this patch you’re working on would be the real target for that though.

I don’t understand how the wrapping is not working for you. It should only wrap, if you slightly touch the wheel, when you are already at the end of the list.

You probably understood the code: If you repeatedly turn the wheel, say every tick task, then BUTTON_REPEAT is generated. And when BUTTON_REPEAT is true, then you don’t wrap, else you wrap.

But in my code, it is just *highly unlikely to not have BUTTON_REPEAT*, since already two tick tasks in a row with scroll action will have the repeat.

So I ask you again, just to make sure: Does it always wrap or only if you’re turning it slowly towards end of the list?

It wraps most of the time. It occasionally hesitates.

It throws me off that this is working so differently on the e200v2 and fuze. My approach of generating BUTTON_REPEAT should be very generic (it generates it if there was wheel action in two consecutive tick tasks).

Another question, am I correct that the current e200v2 driver (in svn) does *never* wrap? If yes, that would certainly wrong, as other targets don’t do that.

That is correct as far as my e280v2 goes. With the current svn driver there is no way I can make the menu wrap. I’ve tried scrolling fast and slow. I’ve tried stopping at the end and then starting again, quickly, slowly and any other way I possibly could. I cannot get it to wrap at all. Remember, there is some kind of difference with the wheels on the e200’s and fuze as you had good scrollwheel action on the fuze even before the red pixel workaround.

That’d be super annoying if you ask me.

I have an unusal problem that you may be able to help me with. Maybe not, but its worth a try. I have a Sansa Fuze 4GB that is perfectly normal, except for some bizarre reason the screen doesn’t work. Everything else is factory-standard. And my music is already on it of course. I remember all the interfaces to the point that I can find any song myself, but I am planning on giving it to a friend and would like to install voice commands, which Rockbox is said to have. Pretend she’s blind. The normal install can’t find the device, and for some reason the zip file for manual installation doesn’t appear on the list ( If there is a solution, please email me at, and thank you.


Available keyboard shortcuts


Task Details

Task Editing