Need help getting I2S audio to work
-
Can you run
aplay -l aplay -L
and post the output ?
-
@mitu Here is what I got
pi@retropie:~ $ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: sndrpihifiberry [snd_rpi_hifiberry_dac], device 0: HifiBerry DAC HiFi pcm5102a-hifi-0 [HifiBerry DAC HiFi pcm5102a-hifi-0] Subdevices: 0/1 Subdevice #0: subdevice #0
pi@retropie:~ $ aplay -L null Discard all samples (playback) or generate zero samples (capture) speakerbonnet dmixer softvol default output sysdefault:CARD=sndrpihifiberry snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0 Default Audio Device dmix:CARD=sndrpihifiberry,DEV=0 snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0 Direct sample mixing device dsnoop:CARD=sndrpihifiberry,DEV=0 snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0 Direct sample snooping device hw:CARD=sndrpihifiberry,DEV=0 snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0 Direct hardware device without any conversions plughw:CARD=sndrpihifiberry,DEV=0 snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0 Hardware device with all software conversions
-
The output looks ok, seems the configuration is applied. Can you run
amixer scontents
and post the output ? Make sure you don't have any
$HOME/.asoundrc
file present, if it's there then delete it. -
@mitu said in Need help getting I2S audio to work:
amixer scontents
Ok, got rid of the file and ran the command.
pi@retropie:~ $ amixer scontents 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%]
-
The output seems correct, does
alsamixer
still throws an error ? -
@mitu Now it does work and the audio is at 100. The sound card is set to default and the speaker test says it's doing something but I don't hear anything
pi@retropie:~ $ speaker-test speaker-test 1.1.8 Playback device is default Stream parameters are 48000Hz, S16_LE, 1 channels Using 16 octaves of pink noise Rate set to 48000Hz (requested 48000Hz) Buffer size range from 2229 to 8916 Period size range from 1114 to 1115 Using max buffer size 8916 Periods = 4 was set period_size = 1114 was set buffer_size = 8916 0 - Front Left Time per period = 2.834187 0 - Front Left Time per period = 2.995269 0 - Front Left Time per period = 2.995473 0 - Front Left
and it keeps on doing that. Maybe my speaker itself is bad? Here are the specs of it
Size: 20x30x7mm
Impedance:8ohm
Rate Input Power: 1.5W
Max Input Power: 2.0W
Wire Length: 10cm -
speaker-test
would output just some white-noise, but at 100% volume it should be audible.
As for the speaker - if it works with other sources, then it should be ok. Don't have experience with the I2S hardware, so can't help here I'm afraid. As far as the software configuration is concerned, you're fine. -
@mitu When I used this speaker before I had another audio module that worked with an audio jack and it worked. So this is a hardware problem? If it is then I don't know what I'm doing wrong because everything looks fine
-
@Jackslayerr said in Need help getting I2S audio to work:
So this is a hardware problem?
Could be, as I said everything else on the Pi side looks fine.
You can try an audio-oriented distro like Volumio, which has an easier to cofigure UI for all kind of models of I2S chips. Flash the image on your sdcard and set-it up, then test to see if it's working.
EDIT: it could be that the configuration is correct, but the AMP needs a different overlay configuration - without
hifiberry-dac
. The doc is dated 2017 and could be dated. -
@mitu How would I give the AMP a different overlay configuration?
-
@Jackslayerr There's an overlay called
max98357
which might be of help. See here.
On the other hand, you say you have a _ raspberry pi model b_ - is this a Pi1 ? -
@mitu Pi4 and I’ll check it out
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.