Write -1 to AIC_DR to initialize the "last sample"
to -1 in order to prevent power-on clicks.
It appears necessary to completely fill the FIFO,
otherwise I was able to get a click out of it, however
uncommon it was.
Not only does this prevent a click when first
playing a song after power-on, but it also seems to prevent
any click at all when powering on - previously, a small
click may have been heard when first booting.
Change-Id: I2b81c2fa6af9809ef1c354d7a08ca8f9893a7690
Previously it used the last sample, which turns out to be broken.
The AIC appears to send out a random non-zero sample continously
after boot -- probably because the last sample is uninitialized by
the hardware. Disabling playback is supposed to make it send zero
samples irregardless of the LSMP bit according to the docs, but it
doesn't seem to work this way.
- Change eliminates the white noise heard on the M3K after boot.
- Change has no adverse effects on the Q1.
- Leave Eros Q on the old setting since sending zeros exacerbates
clicking due to DAC's automute feature.
Change-Id: I9996793fc34f4475b19700d076b11505353b3836
Adjust the battery scale to be a little better. I've set
the 100% (discharge) point to be where the battery sags to
when it is done charging but still plugged in.
Not quite sure how best to set the charge scale, it's just
equal to the discharge scale for now.
Change-Id: I9a2730c0b2051300af9eeddb4f67164f38a29002
IMHO the current name is somewhat misleading:
- usb_drv_send() is blocking and we have usb_drv_send_nonblocking()
for the non-blocking case. This inconsistent naming can only
promote confusion. (And what would we call a blocking receive?)
- Other hardware abstraction APIs in Rockbox are usually blocking:
storage, LCD, backlight, audio... in other words, blocking is the
default expected behavior, with non-blocking calls being a rarity.
Change-Id: I05b41088d09eab582697674f4f06fdca0c8950af
Fixes backlight not turning on after booting (tested on an iPod Mini 2G).
backlight_hw_init() copied from iPod 4G.
Change-Id: I9c32ca5ecd3dc74ea997e6cb843da79d303b0615
It has only a couple GB of onboard flash storage with no storage
driver in Rockbox. It hasn't seen any meaningful development since
its initial commit, it's not on the build farm, and the bootloader
build is broken by other refactoring.
Change-Id: Idd9e3c46fac9b96f416ce444182f97a50770e747
Similar to the native port, the hosted port benefits from
adding a -1 dc bias to the PCM data. This prevents almost
all clicking artifacts.
Change-Id: Ic6378716774b6d88df23c476e2ef54d49f33dc72
According to backtrace(3) man page, the string returned from
backtrace_symbols() contains the return address so we shouldn't
need to print it ourselves.
Change-Id: Ia779207285c9ea0052b9aee3d84ee8380bf46d82
What works:
- LCD: 16-bit RGB565
- all buttons, including scrollwheel
- SD Card
- Battery level and charging/not charging status
- USB
- audio
- sample rate switching
- HP / LO detect, with "safe" fixed LO volume -
LO volume will only be put to user-defined max volume
if headphones are not present.
- rtc
- Plugins build, tried a couple and they seem OK
- Bootloader, installable to nand via usbboot
What doesn't work:
- Dual Boot
- power on/off has intermittent, low volume audio click
(sometimes it's completely silent, sometimes there's
a click)
- Audio uses 16-bit volume scaling, so clicking/popping
is pretty bad at lower volumes - need 32 bit volume
scaling, 24 bit I2S data
- USB HID keys not yet defined
- no jztool support
Unknowns:
- Stereo Switch pins: Direction select, AC_DC
(probably not even hooked up)
- What is the actual purpose of the Stereo Swtich?
- How does the bluetooth module connect?
"Someday" stuff:
- get LCD working at higher bit depth
- Bluetooth
Change-Id: I70dda8fc092c6e3f4352f2245e4164193f803c33
- Audio playback works
- Touchscreen and buttons work
- Bootloader works and is capable of dual boot
- Plugins are working
- Cabbiev2 theme has been ported
- Stable for general usage
Thanks to Marc Aarts for porting Cabbiev2 and plugin bitmaps.
There's a few minor known issues:
- Bootloader must be installed manually using 'usbboot' as there is
no support in jztool yet.
- Keymaps may be lacking, need further testing and feedback.
- Some plugins may not be fully adapted to the screen size and could
benefit from further tweaking.
- LCD shows abnormal effects under some circumstances: for example,
after viewing a mostly black screen an afterimage appears briefly
when going back to a brightly-lit screen. Sudden power-off without
proper shutdown of the backlight causes a "dissolving" effect.
- CW2015 battery reporting driver is buggy, and disabled for now.
Battery reporting is currently voltage-based using the AXP192.
Change-Id: I635e83f02a880192c5a82cb0861ad3a61c137c3a
Debounce logic now handles both removal and insertion and verifies
the detection is stable for 100ms before taking any action.
This solves the bootloader "file not found" issue on the Shanling Q1.
It seems a false removal event was generated, causing the filesystem
to be automatically unmounted. Probably this is due to some transient
noise at boot. Delays didn't solve the problem, probably because the
bogus hotplug event was queued, and normal mdelay() would simply delay
event delivery.
Change-Id: I8b03fb3550309f5a7ab4be0be7465a3dab2d3450
Atmel AT88SC6416C CryptoMemory is almost I2C compatible. The device
is connected to bitbanged I2C bus shared with compliant I2C devices.
Change-Id: Iec54702db1bdfb93c01291eef18ec60391c63b16
Do not introduce any change for M:Robe 500 as it uses the two LCD frames
in non-obvious way.
Sansa Connect and Creative ZVM use only single front framebuffer.
Place TTB at DRAM end to minimize memory loss due to alignment.
Reserve as little as possible memory for the LCD frames.
On Sansa Connect this change extends audio buffer by 858 KiB.
Change-Id: I21bdeec4cfba86d71803a39acd651a87e73767e6
This streamlines the boot code a bit and reduces target specific
boilerplate. The clock init hack used by the bootloader has been
"standardized" and works for the main Rockbox binary now, so you
can boot rockbox.bin over USB without special hacks.
Change-Id: I7c1fac37df5a45873583ce6818eaedb9f71a782b
Reducing number of fake RX buffers saves a bit more than 127 KiB RAM.
Fix compilation with CPPI logging enabled.
Change-Id: If1ad3a6fc251e284caaac78c2406a58f3d6547bb
AVR interrupt signal can remain active if the state has changed during
state read. In such case, there won't be intterupt and the interface
would appear unresponsive until AVR thread received event (e.g. USB
connection/disconnect). Solve the issue by not waiting for event if AVR
interrupt signal is active prior to event wait.
Change-Id: I86e388c7cd6da76e3abe7bf7114940f331e4c308
Make it possible for target to provide voltage, percentage and time to
empty values. The voltage measurement is nice to have in debug menu even
if the actions are taken only based on percentage. Perform battery level
estimation based on voltage only if percentage is not available.
Use time to empty based on actual power consumption. This makes the
estimated runtime displayed in Rockbox Info to react to backlight
setting. The bq27000 updates time to empty estimate every 5.12 seconds
so it is possible to see the estimate with backlight off on the screen
if user enters Rockbox Info, activates hold switch, waits 11 seconds and
releases the hold switch.
Change-Id: Iafe3fa0fb334e3428e3a0ad05b2c020d208dc934
Prevent startup screen flash by properly using AVR LCM functions. Power
off LCD when not needed to improve battery runtime.
Change-Id: I76e3c5c0208774f189fbc6f7d7b3c9e22c062285
Queue power off requests because power_off() can be called within tick
context that must not acquire mutex.
Change-Id: I6f1a8f81d15518876cd03556118fc9eb37b8175f
Import non-free firmware image from linux-firmware package.
Firmware loading works but is disabled at compile time because just
loading firmware without configuring device results in higher power
consumption without any benefit to end user.
Change-Id: I8fd252c49385ede1ea4e0f9b1e29adeb331ab8ae
This new design saves on binary size and stack usage. The API is
also block- and page-based, requiring awareness of the chip layout
to use properly. Out-of-band areas are also exposed for reading
and writing.
The byte-oriented routines are kept for compatibility with the
existing installer and SPL.
Change-Id: Iaacc694d2f651ab74d45330e0434ee778a0d91bc
Waiting 10 us between selecting slave and transmitting data on SPI
resolves spurious startup glitches.
Cache last read monotime value as it can differ from the first one.
Change-Id: Ia6ac5696f6ee2bc3c6a8be27e33aaddd9ff4ce2a
Read monotime twice in a row and only accept the value if it matches or
the two reads are 1 second apart.
Change-Id: Ibd289103a20404dd1b2bbd131fdfa8905852c788
AVR requires bigger delays between retries. Read state instead of
version for synchronization purposes as it shifts more bytes.
Change-Id: Ib7fa980496d3bc7744a086b45e1865861ef58b88
If the commands repeatedly fail it is likely that the AVR is not
programmed. In such case simply continue normal operation. This is
especially important in bootloader as it makes it possible to load new
rockbox build using bootloader USB mode. Otherwise, the only recovery
option would be to use I2C serial.
Change-Id: I4b0999833e9a906ec6353bdfdd5b68211f07ac81
Use 32-bit monotime AVR counter for time tracking. Set the time by
adding fixed offset to the counter value. Store the offset in rockbox
directory to make it persistent between reboots.
Do not implement alarm functionality as wakeup is only possible from
sleep and not from complete power off.
Change-Id: I615c7eb4df8ab0619dcbfcff107bc7051a15aace
Keep Slave Select active during command transmission. This relaxes
timing requirements on the AVR side.
Change-Id: Ia1a6cf45aba3c11f6aeaa7441c6793807ca827f0
Add defines for all commands handled by AVR, including the unknown
opcodes (0xC5, 0xD3, 0xD4, 0xD5, 0xD6).
Properly synchronize with AVR and keep repeating command until it looks
like AVR has accepted it.
Change-Id: I3d42e973f135e33092c71c9887421906a900ab58
This uses an equivalent algorithm but with a different initial value
than we normally use (all bits off vs all bits on). Use the new crc_32r
to replace the original MI4 crc32 implementation.
This frees up some extra space on mi4 targets which gives us more
room on a few very space constrained targets (sansa c200/e200, etc).
Change-Id: Iaaac3ae353b30566156b1404cbf31ca32926203d