Giter VIP home page Giter VIP logo

merus-audio-amp-hat-zw's Introduction

MERUS™ Audio Amp piHAT ZW Linux Drivers - Source code

Linux ALSA SoC driver of Infineon's MERUS™ Audio Amp HAT ZW for Raspberry pi Zero W.

Summary

The MERUS™ Audio Amp is a Hardware at the Top (HAT) audio power amplifier board which brings the Infineon proprietary multi-level technology to Raspberry pi users and makers. It is intended for loudspeaker building and wireless music streaming with minimum size and consumption, state of the art power efficiency and HD audio quality. The MERUSTM Audio Amp is equipped with the MA12070P Class D multi-level amplifier which can provide up to 40W instantaneous peak power from the official Raspberry pi supply and up to 48KHz/24bit music playback. Furthermore, there is no need for extra power supplies, the MERUS™ Audio Amp is powered directly from the same supply the Raspberry pi Zero W is running from. It is compatible with the most popular audio streaming applications for Raspberry pi such as Volumio, Max2Play, Justboom player, and it can be also used in Raspbian as an Airplay client or Bluetooth audio receiver.

Key Features and Benefits

  • Equipped with MERUSTM MA12070P MERUS™ MA12070P. proprietary multi-level amplifier.
  • Compatible with Raspberry pi Zero, Raspberry pi Zero Wireless, Raspberry pi 3 and Raspberry pi 4.
  • Compatibility with major streaming applications for Raspberry pi (Volumio, Justboom Player, Max2play)
  • Power input: 5V/2.5A (sourced from the same single supply as the Raspberry pi)
  • No need for external or extra power supplies
  • Up to 40W instantaneous peak output power with the Raspberry pi official 5V/2.5A supply
  • Up to 48KHz of sample rate and 24 bit of music playback.
  • THD+N: 0.077% @ 7W/4ohm/1Khz
  • Full Hardware control, customization, and error monitoring trough linux alsamixer.
  • Built-in boost converter from 5V to 20V to supply the MA12070P device.
  • I2S digital audio input
  • I2C communication for full register map control
  • Automatic enable control for booster and amplifier for secure boot-up and shutdown sequences.
  • Digital limiter for loudspeaker protection.
  • 2xBTL Channel (Bridge Tied Loaded) default configuration
  • Optional 1xPBTL (Parallel Bridge Tied Loaded) configuration for higher power True wireless Stereo applications

Target Applications:

  • Wireless speakers
  • Hifi audio systems
  • Smart Speakers
  • Multiroom audio

Installation

The MERUS™ Audio Amp piHAT ZW drivers are now suported on the offical release of Raspberry Pi OS, moOde Audio Player and Volumio. We are continuously working to have support in more distributions and audio players.

For detailed description on how to install, set-up and use the MERUS™ Audio Amp HAT ZW board, please follow the quick start guide or the user's manual.

Additionally (for advanced users working on linux host machines), different installation scripts and procedures of the MA120x0P linux audio driver are covered in this repository. This is specially useful if the board and/or any MA120x0P device needs to be used with other Raspberry pi versions and other linux distributions. Also, it allows to easily modify, compile and build the driver according to the target application if this is also a requirement:

  • merus_linux_audio_driver: Raspbian distribution on Raspberry pi Zero W
  • merus_linux_audio_driver_pi3: Raspbian distribution on Raspberry pi 3
  • merus_linux_audio_driver_volumio: Volumio distribution on Raspberry pi zero W
  • merus_linux_audio_driver_volumio_pi3: Volumio distribution on Raspberry pi 3

It is recommended to follow the Kernel and Driver building app note if the previous installation scripts are going to be used.

Board Information, Datasheet and Additional Information

merus-audio-amp-hat-zw's People

Contributors

amuszkat avatar ederjc avatar thenicolaibulow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

merus-audio-amp-hat-zw's Issues

The sound card disconnects when the volume is raised by 70% or more

Hello.

If you turn up the volume while playing music, there will be no sound when it exceeds 70%, and alsamixer will be disconnected from the sound card. I'm not sure what's going on with the sound SoC.

Nothing is written in syslog either.

The music can be played again when the system is restarted.

Is there a way to see what's going on?
Is there any improvement other than rebooting the system?

Thank you.

Support for the Raspberry Pi Model B+ ?

Have you looked for an answer?

Yes, unfortunately nothing found.

Question/Issue:

Is the Raspberry Pi Model B+ V1.2 currently supported by the current driver?

Context

I am currently trying to set up the Merus board with a raspi Model B+, currently without success. It worked very good however with a raspi Zero W.

Where did you expect to find the answer?

Hier at GitHub, in the README file.

THANKS!

Smoked board at first powerup.

I submitted a support request on your web site, but I figured I making a comment here. Working on adding support to piCorePlayer, so I ordered a board.

  1. 4MM spacers is not a common spacer size, you could have saved on the fancy box and included the needed spacers. I had to root around to find something that would work.
  2. At first power up, this chip smoked.
    IMG_3312

Alsamixer not working, dmesg showing error "ma120x0p 1-0020: ASoC: error at soc_component_read_no_lock on ma120x0p.1-0020: -121"

Hi,

I freshly installed Raspbian 10 Buster Lite and did a full "apt full-upgrade".

cat /etc/*-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

aplay -lL" outputs:

null
Discard all samples (playback) or generate zero samples (capture)
default:CARD=sndrpimerusamp
snd_rpi_merus_amp, Merus Audio Amp ma120x0p-amp-0
Default Audio Device
sysdefault:CARD=sndrpimerusamp
snd_rpi_merus_amp, Merus Audio Amp ma120x0p-amp-0
Default Audio Device
dmix:CARD=sndrpimerusamp,DEV=0
snd_rpi_merus_amp, Merus Audio Amp ma120x0p-amp-0
Direct sample mixing device
dsnoop:CARD=sndrpimerusamp,DEV=0
snd_rpi_merus_amp, Merus Audio Amp ma120x0p-amp-0
Direct sample snooping device
hw:CARD=sndrpimerusamp,DEV=0
snd_rpi_merus_amp, Merus Audio Amp ma120x0p-amp-0
Direct hardware device without any conversions
plughw:CARD=sndrpimerusamp,DEV=0
snd_rpi_merus_amp, Merus Audio Amp ma120x0p-amp-0
Hardware device with all software conversions
**** List of PLAYBACK Hardware Devices ****
card 0: sndrpimerusamp [snd_rpi_merus_amp], device 0: Merus Audio Amp ma120x0p-amp-0 [Merus Audio Amp ma120x0p-amp-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
`

BUT after starting Alsamixer, I am getting following error on dmesg:

[ 1179.134492] ma120x0p 1-0020: ASoC: error at soc_component_read_no_lock on ma120x0p.1-0020: -121
[ 1179.135458] ma120x0p 1-0020: ASoC: error at snd_soc_component_update_bits on ma120x0p.1-0020: -121

Alsamixer shows the controls of the snd_rpi_merus_amp but when I want to set the volume, limit etc, the values will be locked to huge values /maximum values and I cannot change them at all.
See alsa/asaound.state:

state.sndrpimerusamp {
control.1 {
iface MIXER
name 'A.Mstr Vol Volume'
value 67
comment {
access 'read write'
type INTEGER
count 1
range '0 - 50'
dbmin -5000
dbmax 0
dbvalue.0 1700
}
}
control.2 {
iface MIXER
name 'B.L Vol Volume'
value 67
comment {
access 'read write'
type INTEGER
count 1
range '0 - 50'
dbmin -5000
dbmax 0
dbvalue.0 1700
}
}
control.3 {
iface MIXER
name 'C.R Vol Volume'
value 67
comment {
access 'read write'
type INTEGER
count 1
range '0 - 50'
dbmin -5000
dbmax 0
dbvalue.0 1700
}
}
control.4 {
iface MIXER
name 'D.Lim thresh Volume'
value.0 67
value.1 67
comment {
access 'read write'
type INTEGER
count 2
range '0 - 60'
dbmin -5000
dbmax 1000
dbvalue.0 1700
dbvalue.1 1700
}
}
control.5 {
iface MIXER
name 'F.Limiter Enable'
value Enabled
comment {
access 'read write'
type ENUMERATED
count 1
item.0 Bypassed
item.1 Enabled
}
}
control.6 {
iface MIXER
name 'G.Limiter Attck'
value Fast
comment {
access 'read write'
type ENUMERATED
count 1
item.0 Slow
item.1 Normal
item.2 Fast
}
}
control.7 {
iface MIXER
name 'H.Limiter Rls'
value Slow
comment {
access 'read write'
type ENUMERATED
count 1
item.0 Slow
item.1 Normal
item.2 Fast
}
}
control.8 {
iface MIXER
name 'I.Err flycap'
value 3
comment {
access read
type ENUMERATED
count 1
item.0 Ok
item.1 Error
item.2 Slow
}
}
control.9 {
iface MIXER
name 'J.Err overcurr'
value 3
comment {
access read
type ENUMERATED
count 1
item.0 Ok
item.1 Error
item.2 Ok
}
}
control.10 {
iface MIXER
name 'K.Err pllerr'
value Error
comment {
access read
type ENUMERATED
count 1
item.0 Ok
item.1 Error
item.2 Ok
}
}
control.11 {
iface MIXER
name 'L.Err pvddunder'
value Ok
comment {
access read
type ENUMERATED
count 1
item.0 Ok
item.1 Error
item.2 Ok
}
}
control.12 {
iface MIXER
name 'M.Err overtempw'
value Ok
comment {
access read
type ENUMERATED
count 1
item.0 Ok
item.1 Error
item.2 Ok
}
}
control.13 {
iface MIXER
name 'N.Err overtempe'
value Ok
comment {
access read
type ENUMERATED
count 1
item.0 Ok
item.1 Error
item.2 Ok
}
}
control.14 {
iface MIXER
name 'O.Err pinlowimp'
value Ok
comment {
access read
type ENUMERATED
count 1
item.0 Ok
item.1 Error
item.2 Ok
}
}
control.15 {
iface MIXER
name 'P.Err dcprot'
value 3
comment {
access read
type ENUMERATED
count 1
item.0 Ok
item.1 Error
item.2 Ok
}
}
control.16 {
iface MIXER
name 'Q.PM Prof'
value 7
comment {
access 'read write'
type ENUMERATED
count 1
item.0 PMF0
item.1 PMF1
item.2 PMF2
item.3 PMF3
item.4 PMF4
}
}
control.17 {
iface MIXER
name 'R.Power Mode'
value 'Dynamic power mode'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 'Dynamic power mode'
item.1 'Power mode 1'
item.2 'Power mode 2'
item.3 'Power mode 3'
}
}
}

Sound is also not playing.

Do you have any solution? Thank you very much.

Support in piCorePlayer

Have quite a few users that would like to use this card with piCorePlayer. Being a minimal OS, we only load what we have to. I’m getting no sound. Kernel is 4.19.122. Driver loads fine according to dmesg and lsmod. aplay -l reports the card is seen by Alsa, and all of the mixers are shown in Alsa mixer. All of the error mixers report OK.

So there must be some soft dependency somewhere? @AMuszkat Any thoughts?

I did test the board with the latest Raspberry OS, and it does work, so hardware is okay.

Could not build modules for Rasp Zero W

Prerequisites

Can you reproduce the problem reliably?

Yes.

Did you check current release notes for known issues?

Yes.

Description:

make crossmodules fails for kernel 5.10.74+

Steps to Reproduce:

  1. Follow the instructions in https://github.com/Infineon/merus-audio-amp-hat-zw/blob/master/merus_linux_audio_driver/README.md up to step 10.

  2. Run make pcodecs1 pcodecs2 pbcm1 pbcm2 poverlay crosscfg enablemodule

  3. Run make crossmodules

Expected Result:

Well, I expect it to build without problem.

Actual Result:

sound/soc/bcm/merus-amp.c: In function ‘snd_rpi_merus_amp_hw_params’:                                                                                                                                                                                                          
sound/soc/bcm/merus-amp.c:43:35: error: ‘struct snd_soc_pcm_runtime’ has no member named ‘cpu_dai’                                                                                                                                                                             
   43 |  struct snd_soc_dai *cpu_dai = rtd->cpu_dai;                                                                                                                                                                                                                           
      |                                   ^~                                                                                                                                                                                                                                   
sound/soc/bcm/merus-amp.c: At top level:                                                                                                                                                                                                                                       
sound/soc/bcm/merus-amp.c:63:3: error: ‘struct snd_soc_dai_link’ has no member named ‘cpu_dai_name’                                                                                                                                                                            
   63 |  .cpu_dai_name = "bcm2708-i2s.0",                                                                                                                                                                                                                                      
      |   ^~~~~~~~~~~~                                                                                                                                                                                                                                                         
sound/soc/bcm/merus-amp.c:63:18: error: initialization of ‘struct snd_soc_dai_link_component *’ from incompatible pointer type ‘char *’ [-Werror=incompatible-pointer-types]                                                                                                   
   63 |  .cpu_dai_name = "bcm2708-i2s.0",                                                                                                                                                                                                                                      
      |                  ^~~~~~~~~~~~~~~    
sound/soc/bcm/merus-amp.c:63:18: note: (near initialization for ‘snd_rpi_merus_amp_dai[0].cpus’)
sound/soc/bcm/merus-amp.c:64:3: error: ‘struct snd_soc_dai_link’ has no member named ‘codec_dai_name’
   64 |  .codec_dai_name = "ma120x0p-amp",
      |   ^~~~~~~~~~~~~~                
sound/soc/bcm/merus-amp.c:64:20: warning: initialization of ‘unsigned int’ from ‘char *’ makes integer from pointer without a cast [-Wint-conversion]
   64 |  .codec_dai_name = "ma120x0p-amp",
      |                    ^~~~~~~~~~~~~~     
sound/soc/bcm/merus-amp.c:64:20: note: (near initialization for ‘snd_rpi_merus_amp_dai[0].num_cpus’)
sound/soc/bcm/merus-amp.c:65:3: error: ‘struct snd_soc_dai_link’ has no member named ‘platform_name’; did you mean ‘platforms’?
   65 |  .platform_name = "bcm2708-i2s.0",              
      |   ^~~~~~~~~~~~~                                        
      |   platforms          
sound/soc/bcm/merus-amp.c:65:19: error: initialization of ‘struct snd_soc_dai_link_component *’ from incompatible pointer type ‘char *’ [-Werror=incompatible-pointer-types]
   65 |  .platform_name = "bcm2708-i2s.0",
      |                   ^~~~~~~~~~~~~~~
sound/soc/bcm/merus-amp.c:65:19: note: (near initialization for ‘snd_rpi_merus_amp_dai[0].codecs’)
sound/soc/bcm/merus-amp.c:66:3: error: ‘struct snd_soc_dai_link’ has no member named ‘codec_name’
   66 |  .codec_name = "ma120x0p.1-0020",          
      |   ^~~~~~~~~~                                
sound/soc/bcm/merus-amp.c:66:16: warning: initialization of ‘unsigned int’ from ‘char *’ makes integer from pointer without a cast [-Wint-conversion]
   66 |  .codec_name = "ma120x0p.1-0020",
      |                ^~~~~~~~~~~~~~~~~
sound/soc/bcm/merus-amp.c:66:16: note: (near initialization for ‘snd_rpi_merus_amp_dai[0].num_codecs’)
sound/soc/bcm/merus-amp.c: In function ‘snd_rpi_merus_amp_probe’:
sound/soc/bcm/merus-amp.c:100:12: error: ‘struct snd_soc_dai_link’ has no member named ‘cpu_dai_name’
  100 |         dai->cpu_dai_name = NULL;                                                                                                                                                                                                                                      
      |            ^~                                                                                                                                                                                                                                                          
sound/soc/bcm/merus-amp.c:101:9: error: ‘struct snd_soc_dai_link’ has no member named ‘cpu_of_node’
  101 |      dai->cpu_of_node = i2s_node;
      |         ^~                
sound/soc/bcm/merus-amp.c:102:12: error: ‘struct snd_soc_dai_link’ has no member named ‘platform_name’; did you mean ‘platforms’?
  102 |       dai->platform_name = NULL;   
      |            ^~~~~~~~~~~~~   
      |            platforms                                                                                                           
sound/soc/bcm/merus-amp.c:103:9: error: ‘struct snd_soc_dai_link’ has no member named ‘platform_of_node’              
  103 |      dai->platform_of_node = i2s_node;           
      |         ^~             
  CC [M]  net/sched/sch_cbq.o              
cc1: some warnings being treated as errors    
make[4]: *** [scripts/Makefile.build:280: sound/soc/bcm/merus-amp.o] Error 1
make[3]: *** [scripts/Makefile.build:497: sound/soc/bcm] Error 2
make[2]: *** [scripts/Makefile.build:497: sound/soc] Error 2
make[1]: *** [Makefile:1825: sound] Error 2
make[1]: *** Waiting for unfinished jobs....                                                                                     

Frequency (1/1, 1/50, 1/100):

1/1

Build/Commit:

I followed Infineon-KIT_40W_AMP_HAT_ZW-ApplicationNotes-v01_00-EN.pdf so I clone the the repo and I am on master branch. Latest commit at the moment: e982e5a

Target:

RaspberryPi Zero W

Host OS and Version:

Linux, 5.4.0-89-generic
(in a VM, but I could reproduce on bare metal as well)

Compiler:

gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)

Environment

I am in a VM but it should not be a problem at this stage.

MSEL0 and MSEL1 pin handling and schematic errors

Following on from this issue on the raspberrypi/linux repo raspberrypi/linux#4027

In the schematic for this board you have got MSEL0 tied to pin 23...however, you have the pinout for the Pi 40 pin header the wrong way round - i.e. you are calling 3V3 pin 2 - not pin 1 which I believe would be correct. So presumably this is tied to physical pin 24 / GPIO8 - can you confirm this?

As Phil has said over on the raspberry pi thread - GPIO8 pulls high by standard, so this is correctly enabling the 2 channels bridge tied load (BTL) on the MA12070P, however this is perhaps not the best way to do it?

@AMuszkat perhaps you could answer the following questions:

  1. is MSEL0 tied to pin 24 / GPIO8? Or is it tied to pin 23 / GPIO11?
  2. was the use of GPIO8 / pin 24 intentional because it pulls high by default? Or was this just a happy coincidence?
  3. would it be beneficial to have MSEL0 and MSEL1 both tied to configurable GPIOs so you can toggle the Input/Output config programmatically and we can use a single overlay for anyone using ma12070p. If so - is there a preference / standard GPIO you will tie these pins to on your next version of the PCB that you mentioned?
  4. does it make sense to have the /ERROR, /MUTE, /ENABLE, /CLIP, BST_EN as configurable pins in the overlay? So that different designs using the same chip can be configured with different pins to suit the design?
  5. any other considerations?

Out of Date Volumio and fragile install

Hi, I got my Merus Hat Amp running with you distro after a bit of fiddling. I found that if you don't get the initial setup with the snd_merus_amp selected there is no way to recover and you have to reburn the SD card and start over. The solution is to get the drivers in the standard distro (e.g. raspbian, etc.) ASAP. I also would like to see support for PicorePlayer.

I installed the SqueezeLite plugin and cannot get it to work no matter what soundcard is selected (HW or Default, etc.). I want to use this with Roon but need SqueezeLite to work. Although I did get Airplay (Sharesync) to work via Roon.

Also, tried Spotify Connect and could not get it working either.

Please up ate the your distro with newest Volumio or as I said please get the drivers into the main fork. If the drivers aren't there this device will not see up take which is ashame because the hardware is quite good and amazing.

Also tried to update to the latest version of Volumio which then broke the install and no sound.

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.