Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#11189 - separate mas35xx lowlevel stuff

Attached to Project: Rockbox
Opened by Marcin Bukat (MarcinBukat) - Wednesday, 07 April 2010, 23:08 GMT+2
Last edited by Marcin Bukat (MarcinBukat) - Sunday, 05 June 2011, 12:51 GMT+2
Task Type Patches
Category Drivers
Status Unconfirmed
Assigned To No-one
Player Type All players
Severity Low
Priority Normal
Reported Version Release 3.4
Due in Version Undecided
Due Date Undecided
Percent Complete 80%
Private No

Details

I did my best to separate mas lowlevel stuff from sound.c. I made various cleanups to handle mas code in more consistent way. I do not have any Archos device so this is not tested at all (although it compiles cleanly).
   cleanup.diff (60.4 KiB)
 apps/codecs.c                               |    2 
 apps/recorder/radio.c                       |    2 
 apps/recorder/recording.c                   |    2 
 apps/recorder/peakmeter.c                   |    2 
 apps/menus/recording_menu.c                 |    2 
 apps/mpeg.c                                 |    4 
 apps/plugin.h                               |    2 
 apps/debug_menu.c                           |    5 
 firmware/export/mascodec.h                  |   43 ++
 firmware/export/mas.h                       |  184 ----------
 firmware/export/mas35xx.h                   |  164 ++++++++-
 firmware/export/audiohw.h                   |    3 
 firmware/export/dac3550a.h                  |   47 ++
 firmware/mp3_playback.c                     |    4 
 firmware/sound.c                            |   89 +----
 firmware/test/i2c/main.c                    |    4 
 firmware/SOURCES                            |   15 
 firmware/target/sh/archos/mascodec-archos.c |  485 ++++++++++++++++++++++++++++
 firmware/drivers/audio/dac3550a.c           |  124 +++++++
 firmware/drivers/audio/mas35xx.c            |   99 +++++
 firmware/drivers/dac.c                      |  119 ------
 firmware/drivers/dac.h                      |   48 --
 firmware/drivers/tuner/s1a0903x01.c         |    2 
 firmware/drivers/mas.c                      |  485 ----------------------------
 24 files changed, 988 insertions(+), 948 deletions(-)

This task depends upon

Comment by Marcin Bukat (MarcinBukat) - Sunday, 11 April 2010, 14:08 GMT+2
Here I will spot some additional places where the MAS cleanup work is needed:
firmware/mp3_playback.c - contains SH specific code so should be moved to target specyfic file (at leas part of it)
apps/mpeg.c - contains a lot of code specific to MAS. This should be reviewed.

apps/plugin.h - exports a lot of MAS specific functions to be used in plugins

apps/plugins/starfield.c
apps/plugins/oscilloscope.c
apps/plugins/vu_meter.c
apps/plugins/splitedit.c - this plugins contain call to rb->mas_codec_readreg(0x0C) and rb->mas_codec_readreg(0x0D) to obtain peak value

apps/plugins/wavrecord.c
apps/plugins/wavplay.c - MAS specyfic

apps/recorder/radio.c - contains call to mas_codec_writereg(6, 0x4000);
apps/recorder/peakmeter.c - contains call to mas_codec_readreg(pm_src_left) and mas_codec_readreg(pm_src_right)
Comment by Marcin Bukat (MarcinBukat) - Sunday, 11 April 2010, 21:59 GMT+2
Removed warnings when compiling targets other than archos. This is only minor change to the initial patch.
   mas-cleanup.diff (59.6 KiB)
 b/apps/codecs.c                               |    1 
 b/apps/debug_menu.c                           |    2 
 b/apps/menus/recording_menu.c                 |    1 
 b/apps/mpeg.c                                 |    4 
 b/apps/plugin.h                               |    2 
 b/apps/recorder/peakmeter.c                   |    2 
 b/apps/recorder/radio.c                       |    1 
 b/apps/recorder/recording.c                   |    1 
 b/firmware/SOURCES                            |   15 
 b/firmware/drivers/audio/dac3550a.c           |  124 ++++++
 b/firmware/drivers/audio/mas35xx.c            |   99 +++++
 a/firmware/drivers/dac.c                      |  119 ------
 a/firmware/drivers/dac.h                      |   48 --
 a/firmware/drivers/mas.c                      |  485 --------------------------
 b/firmware/drivers/tuner/s1a0903x01.c         |    2 
 b/firmware/export/audiohw.h                   |    3 
 b/firmware/export/dac3550a.h                  |   47 ++
 a/firmware/export/mas.h                       |  184 ---------
 b/firmware/export/mas35xx.h                   |  164 ++++++++
 b/firmware/export/mascodec.h                  |   43 ++
 b/firmware/mp3_playback.c                     |    4 
 b/firmware/sound.c                            |   89 +---
 b/firmware/target/sh/archos/mascodec-archos.c |  485 ++++++++++++++++++++++++++
 b/firmware/test/i2c/main.c                    |    4 
 24 files changed, 981 insertions(+), 948 deletions(-)

Comment by Marcin Bukat (MarcinBukat) - Wednesday, 09 June 2010, 09:26 GMT+2
sync to r26704 and some further cleanups. As pointed by amiconn commitable version has to preserve files history so final patch will be functionally identical but prepared in slightly different way.
   MAS-cleanup.diff (90.8 KiB)
 b/apps/codecs.c                               |    1 
 b/apps/debug_menu.c                           |    1 
 b/apps/menus/recording_menu.c                 |    1 
 b/apps/mpeg.c                                 |    4 
 b/apps/plugin.h                               |    2 
 b/apps/radio/radio.c                          |    1 
 b/apps/recorder/peakmeter.c                   |    1 
 b/apps/recorder/peakmeter.h                   |    1 
 b/apps/recorder/recording.c                   |    1 
 b/firmware/SOURCES                            |   22 
 b/firmware/drivers/audio/dac3550a.c           |  124 +++++
 b/firmware/drivers/audio/mas35xx.c            |   99 +++-
 a/firmware/drivers/dac.c                      |  119 -----
 a/firmware/drivers/dac.h                      |   48 --
 a/firmware/drivers/mas.c                      |  485 --------------------
 b/firmware/drivers/tuner/s1a0903x01.c         |    2 
 b/firmware/export/audiohw.h                   |    3 
 b/firmware/export/dac3550a.h                  |   47 +
 a/firmware/export/mas.h                       |  184 -------
 b/firmware/export/mas35xx.h                   |  162 ++++++
 b/firmware/export/mascodec.h                  |   43 +
 a/firmware/mp3_playback.c                     |  618 --------------------------
 b/firmware/sound.c                            |   84 ---
 b/firmware/target/sh/archos/audio-archos.c    |  616 +++++++++++++++++++++++++
 b/firmware/target/sh/archos/mascodec-archos.c |  485 ++++++++++++++++++++
 b/firmware/test/i2c/main.c                    |    4 
 26 files changed, 1597 insertions(+), 1561 deletions(-)

Comment by Marcin Bukat (MarcinBukat) - Friday, 11 June 2010, 20:54 GMT+2
created with git diff -M should preserve history
   MAS-cleanup.diff (32 KiB)
 b/apps/codecs.c                               |    1 
 b/apps/debug_menu.c                           |    1 
 b/apps/menus/recording_menu.c                 |    1 
 b/apps/mpeg.c                                 |    4 
 b/apps/plugin.h                               |    2 
 b/apps/radio/radio.c                          |    1 
 b/apps/recorder/peakmeter.c                   |    1 
 b/apps/recorder/peakmeter.h                   |    1 
 b/apps/recorder/recording.c                   |    1 
 b/firmware/SOURCES                            |   22 +--
 b/firmware/drivers/audio/dac3550a.c           |   15 +-
 b/firmware/drivers/audio/mas35xx.c            |   99 +++++++++++++
 b/firmware/drivers/tuner/s1a0903x01.c         |    2 
 b/firmware/export/audiohw.h                   |    3 
 b/firmware/export/dac3550a.h                  |   13 -
 a/firmware/export/mas.h                       |  184 --------------------------
 b/firmware/export/mas35xx.h                   |  162 ++++++++++++++++++++--
 b/firmware/export/mascodec.h                  |   45 ++----
 b/firmware/sound.c                            |   84 ++---------
 b/firmware/target/sh/archos/audio-archos.c    |    4 
 b/firmware/target/sh/archos/mascodec-archos.c |    4 
 b/firmware/test/i2c/main.c                    |    4 
 22 files changed, 321 insertions(+), 333 deletions(-)

Comment by Marcin Bukat (MarcinBukat) - Saturday, 12 June 2010, 22:50 GMT+2
Finally tracked down what cause rejects. This is the same as above patch but with offending hunks removed by hand.
   MAS-cleanup.diff (30.7 KiB)
 b/apps/codecs.c                               |    1 
 b/apps/debug_menu.c                           |    1 
 b/apps/menus/recording_menu.c                 |    1 
 b/apps/mpeg.c                                 |    4 
 b/apps/plugin.h                               |    2 
 b/apps/radio/radio.c                          |    1 
 b/apps/recorder/peakmeter.c                   |    1 
 b/apps/recorder/peakmeter.h                   |    1 
 b/apps/recorder/recording.c                   |    1 
 b/firmware/SOURCES                            |   22 +--
 b/firmware/drivers/audio/dac3550a.c           |   13 +
 b/firmware/drivers/audio/mas35xx.c            |   99 +++++++++++++
 b/firmware/drivers/tuner/s1a0903x01.c         |    2 
 b/firmware/export/audiohw.h                   |    3 
 b/firmware/export/dac3550a.h                  |   11 -
 a/firmware/export/mas.h                       |  184 --------------------------
 b/firmware/export/mas35xx.h                   |  162 ++++++++++++++++++++--
 b/firmware/export/mascodec.h                  |   43 ++----
 b/firmware/sound.c                            |   84 ++---------
 b/firmware/target/sh/archos/audio-archos.c    |    4 
 b/firmware/target/sh/archos/mascodec-archos.c |    2 
 b/firmware/test/i2c/main.c                    |    4 
 22 files changed, 317 insertions(+), 329 deletions(-)

Comment by Marcin Bukat (MarcinBukat) - Monday, 14 June 2010, 23:04 GMT+2
last patch produced reject (patch --dry-run does not reveal this unfortunately). This is one *tested* to not produce rejects with current svn
   MAS-cleanup_v3.diff (91 KiB)
 b/apps/codecs.c                               |    1 
 b/apps/debug_menu.c                           |    1 
 b/apps/menus/recording_menu.c                 |    1 
 b/apps/mpeg.c                                 |    4 
 b/apps/plugin.h                               |    2 
 b/apps/radio/radio.c                          |    1 
 b/apps/recorder/peakmeter.c                   |    1 
 b/apps/recorder/peakmeter.h                   |    1 
 b/apps/recorder/recording.c                   |    1 
 b/firmware/SOURCES                            |   22 
 b/firmware/drivers/audio/dac3550a.c           |  124 +++++
 b/firmware/drivers/audio/mas35xx.c            |   99 +++-
 a/firmware/drivers/dac.c                      |  119 -----
 a/firmware/drivers/dac.h                      |   48 --
 a/firmware/drivers/mas.c                      |  485 --------------------
 b/firmware/drivers/tuner/s1a0903x01.c         |    2 
 b/firmware/export/audiohw.h                   |    3 
 b/firmware/export/dac3550a.h                  |   47 +
 a/firmware/export/mas.h                       |  184 -------
 b/firmware/export/mas35xx.h                   |  162 ++++++
 b/firmware/export/mascodec.h                  |   43 +
 a/firmware/mp3_playback.c                     |  618 --------------------------
 b/firmware/sound.c                            |   84 ---
 b/firmware/target/sh/archos/audio-archos.c    |  616 +++++++++++++++++++++++++
 b/firmware/target/sh/archos/mascodec-archos.c |  485 ++++++++++++++++++++
 b/firmware/test/i2c/main.c                    |    4 
 26 files changed, 1597 insertions(+), 1561 deletions(-)

Comment by Marcin Bukat (MarcinBukat) - Thursday, 30 September 2010, 10:15 GMT+2
synced to r28187, tested on Archos Studio (thanks to b0hoon for lending me the device)
   MAS-cleanup_30092010.diff (91.1 KiB)
 b/apps/codecs.c                               |    1 
 b/apps/debug_menu.c                           |    1 
 b/apps/menus/recording_menu.c                 |    1 
 b/apps/mpeg.c                                 |    4 
 b/apps/plugin.h                               |    2 
 b/apps/radio/radio.c                          |    1 
 b/apps/recorder/peakmeter.c                   |    1 
 b/apps/recorder/peakmeter.h                   |    1 
 b/apps/recorder/recording.c                   |    1 
 b/firmware/SOURCES                            |   22 
 b/firmware/drivers/audio/dac3550a.c           |  124 +++++
 b/firmware/drivers/audio/mas35xx.c            |   99 +++-
 a/firmware/drivers/dac.c                      |  119 -----
 a/firmware/drivers/dac.h                      |   48 --
 a/firmware/drivers/mas.c                      |  485 --------------------
 b/firmware/drivers/tuner/s1a0903x01.c         |    2 
 b/firmware/export/audiohw.h                   |    3 
 b/firmware/export/dac3550a.h                  |   47 +
 a/firmware/export/mas.h                       |  184 -------
 b/firmware/export/mas35xx.h                   |  162 ++++++
 b/firmware/export/mascodec.h                  |   43 +
 a/firmware/mp3_playback.c                     |  618 --------------------------
 b/firmware/sound.c                            |   85 ---
 b/firmware/target/sh/archos/audio-archos.c    |  616 +++++++++++++++++++++++++
 b/firmware/target/sh/archos/mascodec-archos.c |  485 ++++++++++++++++++++
 b/firmware/test/i2c/main.c                    |    4 
 26 files changed, 1597 insertions(+), 1562 deletions(-)

Comment by Marianne Arnold (pixelma) - Wednesday, 20 October 2010, 01:19 GMT+2
I tested the patch on my OndioFM which has a different MAS than the Studio thus having some more sound settings, wav playback and recording (also wav recording).

Sound settings all seem to work correctly. I went through the complete sound settings menu and listened to the difference when changing the setting as well as comparing the ranges to a build without the patch.

Available recording settings are all the same if I saw correctly. Two short test recordings (one with the internal mic, one from radio) worked. I was just testing the standards though - e.g. the resulting average bitrate looked correct (respecting the quality setting)

A wav recording worked correctly and I could play back the file with wavplay which sounded correctly too.
Comment by Marcin Bukat (MarcinBukat) - Thursday, 21 October 2010, 22:06 GMT+2
Fix sim build for hwcodec targets.
   MAS_cleanup_21102010.diff (61.1 KiB)
 b/apps/codecs.c                       |    1 
 b/apps/debug_menu.c                   |    1 
 b/apps/menus/recording_menu.c         |    1 
 b/apps/mpeg.c                         |    4 
 b/apps/plugin.h                       |    2 
 b/apps/radio/radio.c                  |    1 
 b/apps/recorder/peakmeter.c           |    1 
 b/apps/recorder/peakmeter.h           |    1 
 b/apps/recorder/recording.c           |    1 
 b/firmware/SOURCES                    |   22 -
 b/firmware/drivers/audio/mas35xx.c    |   99 +++++
 b/firmware/drivers/audio/sdl.c        |   22 -
 a/firmware/drivers/dac.c              |  119 ------
 a/firmware/drivers/dac.h              |   48 --
 a/firmware/drivers/mas.c              |  485 --------------------------
 b/firmware/drivers/tuner/s1a0903x01.c |    2 
 b/firmware/export/audiohw.h           |    3 
 a/firmware/export/mas.h               |  184 ----------
 b/firmware/export/mas35xx.h           |  162 ++++++++
 a/firmware/mp3_playback.c             |  618 ----------------------------------
 b/firmware/sound.c                    |   93 +----
 b/firmware/test/i2c/main.c            |    4 
 b/uisimulator/common/stubs.c          |  108 +++++
 23 files changed, 392 insertions(+), 1590 deletions(-)

Comment by Marcin Bukat (MarcinBukat) - Saturday, 23 October 2010, 19:18 GMT+2
Previous patch was screwed up for unknown reason. This one *should* be the correct one.
   MAS-cleanup_23102010.diff (92.5 KiB)
 b/apps/codecs.c                               |    1 
 b/apps/debug_menu.c                           |    1 
 b/apps/menus/recording_menu.c                 |    1 
 b/apps/mpeg.c                                 |    4 
 b/apps/plugin.h                               |    2 
 b/apps/radio/radio.c                          |    1 
 b/apps/recorder/peakmeter.c                   |    1 
 b/apps/recorder/peakmeter.h                   |    1 
 b/apps/recorder/recording.c                   |    1 
 b/firmware/SOURCES                            |   22 
 b/firmware/drivers/audio/dac3550a.c           |  124 +++++
 b/firmware/drivers/audio/mas35xx.c            |   99 +++-
 a/firmware/drivers/dac.c                      |  119 -----
 a/firmware/drivers/dac.h                      |   48 --
 a/firmware/drivers/mas.c                      |  485 --------------------
 b/firmware/drivers/tuner/s1a0903x01.c         |    2 
 b/firmware/export/audiohw.h                   |    3 
 b/firmware/export/dac3550a.h                  |   47 +
 a/firmware/export/mas.h                       |  184 -------
 b/firmware/export/mas35xx.h                   |  162 ++++++
 b/firmware/export/mascodec.h                  |   43 +
 a/firmware/mp3_playback.c                     |  618 --------------------------
 b/firmware/sound.c                            |   85 ---
 b/firmware/target/sh/archos/audio-archos.c    |  563 +++++++++++++++++++++++
 b/firmware/target/sh/archos/mascodec-archos.c |  485 ++++++++++++++++++++
 b/firmware/test/i2c/main.c                    |    4 
 b/uisimulator/common/stubs.c                  |  108 ++++
 27 files changed, 1651 insertions(+), 1563 deletions(-)

Comment by Marcin Bukat (MarcinBukat) - Sunday, 31 October 2010, 22:36 GMT+2
The patch was commited as r28425 and r28426. There are still some mas specific bits which will need review:
apps/mpeg.c

apps/plugins/starfield.c
apps/plugins/oscilloscope.c
apps/plugins/vu_meter.c
apps/plugins/splitedit.c - this plugins contain call to rb->mas_codec_readreg(0x0C) and rb->mas_codec_readreg(0x0D) to obtain peak value

apps/plugins/wavrecord.c
apps/plugins/wavplay.c - MAS specific (this can be left alone I think)

apps/recorder/radio.c - contains call to mas_codec_writereg(6, 0x4000);
apps/recorder/peakmeter.c - contains call to mas_codec_readreg(pm_src_left) and mas_codec_readreg(pm_src_right)


Loading...