bartgrefte
Posts: 22
Joined: Wed Aug 19, 2015 11:31 am

I2S DAC, alsamixer: device does not have any controls

Thu Apr 20, 2017 4:58 pm

Tl;dr: See title, that pretty much sums it up.

To get a bit more detailed: I have an Adafruit speaker bonnet (I2S DAC) on a RPi Zero W running Raspbian Jessie Lite.

After executing

Code: Select all

curl -sS https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/i2samp.sh | bash
a couple of times with reboots in between, the DAC and speakers started working.

Now there's just one small issue: I cannot control the volume, which is quite loud. The error I'm getting in alsamixer is "This sound device does not have any controls".

Does anyone happen to know how to solve this? Google isn't showing anything helpful when Googling that error and I2S....

FM81
Posts: 518
Joined: Wed Apr 17, 2013 4:33 pm

Re: I2S DAC, alsamixer: device does not have any controls

Fri Apr 21, 2017 5:26 am

You have to add a software-volume-regulation!
See here: viewtopic.php?p=1128700#p1128700 (the theme of this thread was a little bit different, but it should be declared)

Best regards, FM_81
A: What does the command 'cat /dev/urandom', can you tell me please?
B: Yeah, that's very simple: It feeds your cat with radioactive material!

bartgrefte
Posts: 22
Joined: Wed Aug 19, 2015 11:31 am

Re: I2S DAC, alsamixer: device does not have any controls

Fri Apr 21, 2017 8:55 am

FM81 wrote:You have to add a software-volume-regulation!
See here: viewtopic.php?p=1128700#p1128700 (the theme of this thread was a little bit different, but it should be declared)

Best regards, FM_81
Thanks :), but that info was already in Adafruit's tutorial, see the "Reducing popping" section at https://learn.adafruit.com/adafruit-spe ... ry-pi-test , which seems about the same (unless I overlooked something). But it's not fixing the popping here and there's still no volume control in alsamixer.

edit: Hold on, just tried something. If I play an mp3 using mpg123 -vC *pathtomp3file* I can use the minus key to lower the volume (didn't work before, I guess -vC is required), but the volume keeps reverting back to 100% when restarting mpg123.

edit2: Just found https://sourceforge.net/p/mpg123/feature-requests/35/ , the -f option, followed by a number changes the volume immediately :D

Still leaves that loud pop when starting mpg123.

FM81
Posts: 518
Joined: Wed Apr 17, 2013 4:33 pm

Re: I2S DAC, alsamixer: device does not have any controls

Fri Apr 21, 2017 10:56 am

See example 2 from the link above:

Code: Select all

pcm.softvol {
 type softvol
 slave {
   pcm "plughw"
 }
  control {
   name "SoftMaster"
   card 0
 }
}

pcm.!default {
 type plug
 slave.pcm "softvol"
}
This gives you a software-volume regulation with the name "SoftMaster", but auf course you can also use every name you want, also the standard-name "PCM" instead!?

Greetings, FM_81
A: What does the command 'cat /dev/urandom', can you tell me please?
B: Yeah, that's very simple: It feeds your cat with radioactive material!

bartgrefte
Posts: 22
Joined: Wed Aug 19, 2015 11:31 am

Re: I2S DAC, alsamixer: device does not have any controls

Fri Apr 21, 2017 4:11 pm

I just wanted to try that, only to find out I can already suddenly change the volume using alsamixer and I have no idea how that happened :?

Maybe some changes require multiple reboots to work? But which change....
Current settings:

Code: Select all

pcm.!default {
    type            plug
    slave.pcm       "softvol"   #make use of softvol
}

pcm.softvol {
    type            softvol
    slave {
        pcm         "dmix"      #redirect the output to dmix (instead of "hw:0,$
    }
    control {
        name        "PCM"       #override the PCM slider to set the softvol vol$
        card        0
    }
}
Oh well, at least that works :D . Now for the popping, which always happens once and always at the same time audio starts coming out of the speakers.

Next up: Finding a way to receive FM (and maybe AM) radio with RDS and have the audio routed through Adafruits DAC. Since it doesn't seem to have an audio input, I don't think that's gonna be easy since most FM-receiver breakouts have a 3.5mm jack as output which also (when cable/headphones plugged in) functions as an antenna.

Maybe https://www.sparkfun.com/products/11083 will work, but I don't see any details about hooking it up to a RPi in the hookup guide. Or maybe a RTL-SDR dongle will do, but I do not know if a Pi Zero W has the cpu-power for that.

Passiday
Posts: 15
Joined: Wed Dec 26, 2012 7:26 pm

Re: I2S DAC, alsamixer: device does not have any controls

Mon Dec 17, 2018 12:04 pm

Hello,

My project is a media player, hidden in a kids toy (pimped-up vintage dial phone).

I have set up my Pi Zero with MAX98357A amp, and used the asound.conf example from this thread to get the software volume control.

I have installed vlc-nox package that includes vlc headless player, to play mp3 files and youtube urls. It all works wonderfully, but there's that loud pop at start of the playback.

I have found here this fix: play a "silence" sound in the background all the time:

Code: Select all

$ aplay -t raw -r 48000 -c 2 -f S16_LE /dev/zero &
But I fear it might not be the most appropriate solution, it feels kind of hacky. In the process information I see that aplay now consumes 4.2% of CPU all the time in the background.

Return to “Graphics, sound and multimedia”