0

Pigrrl zero and Adafruit MAX98357 I2S Class-D Mono Amp
Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Please be positive and constructive with your questions and comments.

Re: Pigrrl zero and Adafruit MAX98357 I2S Class-D Mono Amp

by jpete24 on Tue Jun 21, 2016 10:54 am

Its cool. Let me know, I'm going to give this a try tonight.

jpete24
 
Posts: 71
Joined: Tue May 17, 2016 2:58 pm

Re: Pigrrl zero and Adafruit MAX98357 I2S Class-D Mono Amp

by tronicgr on Tue Jun 21, 2016 12:06 pm

jpete24 wrote:Its cool. Let me know, I'm going to give this a try tonight.


Try this link:
https://1drv.ms/u/s!AnCVLuZAuu8OcGzhwqFJflp1qw4

Its from my MS drive that looks it uploaded there, but my phone reports it's only 2gb... if it doesn't work, I'm also uploading it in smaller pieces in another host right now.

Thanks
Thanos

tronicgr
 
Posts: 76
Joined: Wed Feb 03, 2016 1:48 pm

Re: Pigrrl zero and Adafruit MAX98357 I2S Class-D Mono Amp

by jpete24 on Tue Jun 21, 2016 9:15 pm

Doesn't want to extract on my mac.....weird.

jpete24
 
Posts: 71
Joined: Tue May 17, 2016 2:58 pm

Re: Pigrrl zero and Adafruit MAX98357 I2S Class-D Mono Amp

by tronicgr on Tue Jun 21, 2016 9:28 pm

jpete24 wrote:Doesn't want to extract on my mac.....weird.


Hmm, maybe was partially uploaded then (2gb limit for file size).

Try downloading it from here, that is in smaller pieces (7-zip ):

https://mega.nz/#F!gthVGZ5S!ETTRXWXzraNZ2UgGyAz29A

Thanks
Thanos

tronicgr
 
Posts: 76
Joined: Wed Feb 03, 2016 1:48 pm

Re: Pigrrl zero and Adafruit MAX98357 I2S Class-D Mono Amp

by jpete24 on Tue Jun 21, 2016 10:08 pm

I got it extracted. Wiring is all changed around to the picture you gave me. Fingers crossed once I get this SD card going with your image file. Thanks for posting that by the way. Do you care if I get it hosted some where once I'm all finished and provide it on my Thingiverse?

jpete24
 
Posts: 71
Joined: Tue May 17, 2016 2:58 pm

Re: Pigrrl zero and Adafruit MAX98357 I2S Class-D Mono Amp

by jpete24 on Tue Jun 21, 2016 10:43 pm

Its alive! Works great. I have the SD connected directly to 5V which makes it only transmit out left channel, does that matter? Did you set it up balanced? Also how did you change the volume in Retropie? The mixer options don't see to work like they use to.

jpete24
 
Posts: 71
Joined: Tue May 17, 2016 2:58 pm

Re: Pigrrl zero and Adafruit MAX98357 I2S Class-D Mono Amp

by tronicgr on Tue Jun 21, 2016 11:17 pm

jpete24 wrote:Its alive! Works great. I have the SD connected directly to 5V which makes it only transmit out left channel, does that matter? Did you set it up balanced? Also how did you change the volume in Retropie? The mixer options don't see to work like they use to.



I haven't had the chance to get the mixer working with the i2s. You need to recompile the whole retropie as it was mentioned in the first page of this thread.

So I connect the SD to ground via a switch to turn off the sound if I need to.

Yes you can re-host the image, no problem.

Thanks
Thanos

tronicgr
 
Posts: 76
Joined: Wed Feb 03, 2016 1:48 pm

Re: Pigrrl zero and Adafruit MAX98357 I2S Class-D Mono Amp

by tronicgr on Wed Jun 22, 2016 10:29 am

Hi,

I succeed to fix the volume issues in retropie without having to re-complile the Emulation Station!!!!!


I just added a mixer value for the I2S sound following the instructions of the HiFiberry page:
https://support.hifiberry.com/hc/en-us/ ... me-control

I edited the /etc/asound.conf adding:

Code: Select all | TOGGLE FULL SIZE
pcm.hifiberry {
    type softvol
    slave.pcm "plughw:0"
    control.name "PCM"
    control.card 0
}

pcm.!default {
    type plug
    slave.pcm  "hifiberry"
}

ctl.!default {
 type hw
 card 0
}


After a reboot, I can now access the volume via the alsamixer fine without having to recompile the Emulation Station!!!

You can check with the commands:
amixer
aplay -l


Code: Select all | TOGGLE FULL SIZE
pi@retropie:~ $ amixer
Simple mixer control 'Master',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 255
  Front Left: 255 [100%]
  Front Right: 255 [100%]
Simple mixer control 'PCM',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 255
  Front Left: 255 [100%]
  Front Right: 255 [100%]
pi@retropie:~ $


pi@retropie:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sndrpihifiberry [snd_rpi_hifiberry_dac], device 0: HifiBerry DAC HiFi pcm5102a-hifi-0 []
  Subdevices: 0/1
  Subdevice #0: subdevice #0
pi@retropie:~ $



Thanks
Thanos

tronicgr
 
Posts: 76
Joined: Wed Feb 03, 2016 1:48 pm

Re: Pigrrl zero and Adafruit MAX98357 I2S Class-D Mono Amp

by FDyllick on Wed Jun 22, 2016 11:21 am

I got the Adafruit PIGRRL 2 kit and want to order the 3D printed case from 3DHubs.com. I have two questions:
1. How many 'washer' and 'washer B' do I need to get printed?
2. Living in Germany I wonder what are the metric dimensions of the
#4-40 3/8 machine screws and the
#2-56 3/8 machine screws?
Thank you

FDyllick
 
Posts: 1
Joined: Wed Jun 22, 2016 11:11 am

Re: Pigrrl zero and Adafruit MAX98357 I2S Class-D Mono Amp

by tronicgr on Wed Jun 22, 2016 11:32 am

FDyllick wrote:I got the Adafruit PIGRRL 2 kit and want to order the 3D printed case from 3DHubs.com. I have two questions:
1. How many 'washer' and 'washer B' do I need to get printed?
2. Living in Germany I wonder what are the metric dimensions of the
#4-40 3/8 machine screws and the
#2-56 3/8 machine screws?
Thank you



Hmm, I didn't use any washers. I just used shorter screws.

I'm not sure about the equivalent of these in metric screws.

If you want to add the I2S amplifier like I did, you should use the 2.1 version stl files here:
http://www.thingiverse.com/thing:1621907
It adds a little extra size and place to mount the speaker and the I2S amplifier.

Also for Pigrrl Zero, you need this pad PCB: https://learn.adafruit.com/pigrrl-zero/gamepad
The pad/buttons PCB from the Pigrrl2 project wont fit.


Thanks
Thanos

tronicgr
 
Posts: 76
Joined: Wed Feb 03, 2016 1:48 pm

Re: Pigrrl zero and Adafruit MAX98357 I2S Class-D Mono Amp

by jpete24 on Wed Jun 22, 2016 12:41 pm

FDyllick wrote:I got the Adafruit PIGRRL 2 kit and want to order the 3D printed case from 3DHubs.com. I have two questions:
1. How many 'washer' and 'washer B' do I need to get printed?
2. Living in Germany I wonder what are the metric dimensions of the
#4-40 3/8 machine screws and the
#2-56 3/8 machine screws?
Thank you


Don't order a case from 3DHubs, or at least the original case. I have revisions that work far better than the original one. Shoot me an email and I can put something together for you from the modifications I've made on Thingiverse. jpete24 at gmail.com

I'm going to compile a tutorial (with help of Thanos) for how to complete a speaker installation, so be on the lookout for that. I have to find time this week to do it however......

jpete24
 
Posts: 71
Joined: Tue May 17, 2016 2:58 pm

Re: Pigrrl zero and Adafruit MAX98357 I2S Class-D Mono Amp

by jpete24 on Wed Jun 22, 2016 12:42 pm

tronicgr wrote:Hi,

I succeed to fix the volume issues in retropie without having to re-complile the Emulation Station!!!!!


I just added a mixer value for the I2S sound following the instructions of the HiFiberry page:
https://support.hifiberry.com/hc/en-us/ ... me-control

I edited the /etc/asound.conf adding:

Code: Select all | TOGGLE FULL SIZE
pcm.hifiberry {
    type softvol
    slave.pcm "plughw:0"
    control.name "PCM"
    control.card 0
}

pcm.!default {
    type plug
    slave.pcm  "hifiberry"
}

ctl.!default {
 type hw
 card 0
}


After a reboot, I can now access the volume via the alsamixer fine without having to recompile the Emulation Station!!!

You can check with the commands:
amixer
aplay -l


Code: Select all | TOGGLE FULL SIZE
pi@retropie:~ $ amixer
Simple mixer control 'Master',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 255
  Front Left: 255 [100%]
  Front Right: 255 [100%]
Simple mixer control 'PCM',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 255
  Front Left: 255 [100%]
  Front Right: 255 [100%]
pi@retropie:~ $


pi@retropie:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sndrpihifiberry [snd_rpi_hifiberry_dac], device 0: HifiBerry DAC HiFi pcm5102a-hifi-0 []
  Subdevices: 0/1
  Subdevice #0: subdevice #0
pi@retropie:~ $



Thanks
Thanos


This is fantastic! I'll give it a shot tonight or this week. Did you end up getting the audio to be louder?

jpete24
 
Posts: 71
Joined: Tue May 17, 2016 2:58 pm

Re: Pigrrl zero and Adafruit MAX98357 I2S Class-D Mono Amp

by tronicgr on Wed Jun 22, 2016 12:53 pm

I have the I2S amplifier unmodified as it comes from Adafruit, so it should be only 9 dB I think you have to change a resistor or connect the SD directly to VCC to get the max 15 dB out of it.

At least having the volume working in retropie, I can turn it down without external potentiometer, which I'm not sure if you can add in this i2s amplifier anyway...

So I just use a switch that connects SD to Ground to place the I2S amplifier in "shutdown" mode if I don't want to have any sound and thus save on battery if needed.



Thanks
Thanos

tronicgr
 
Posts: 76
Joined: Wed Feb 03, 2016 1:48 pm

Re: Pigrrl zero and Adafruit MAX98357 I2S Class-D Mono Amp

by jpete24 on Wed Jun 22, 2016 2:11 pm

tronicgr wrote:I have the I2S amplifier unmodified as it comes from Adafruit, so it should be only 9 dB I think you have to change a resistor or connect the SD directly to VCC to get the max 15 dB out of it.

At least having the volume working in retropie, I can turn it down without external potentiometer, which I'm not sure if you can add in this i2s amplifier anyway...

So I just use a switch that connects SD to Ground to place the I2S amplifier in "shutdown" mode if I don't want to have any sound and thus save on battery if needed.



Thanks
Thanos


Did you ever have any trouble with certain emulators not properly working with buttons? Maybe I have some grounding issues, but my UP button and A button both seem to be causing me fits.

jpete24
 
Posts: 71
Joined: Tue May 17, 2016 2:58 pm

Re: Pigrrl zero and Adafruit MAX98357 I2S Class-D Mono Amp

by tronicgr on Wed Jun 22, 2016 3:48 pm


tronicgr
 
Posts: 76
Joined: Wed Feb 03, 2016 1:48 pm

Please be positive and constructive with your questions and comments.