Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Problem: MPD Error starting Moode (ALSA equal)
#21
(03-26-2019, 07:01 PM)Tim Curtis Wrote: I ran a quick test with a Pi-2B and HiFiBerry DAC+ board and no issues.

1. Audio Config, set I2S audio device = HiFiBerry DAC+, SET
2. Reboot
3. MPD Config, verify Device type = "I2S audio device",  set to Hardware volume, SAVE
4. Play music
5. Reboot
6. Print updated moode.log (below)

Code:
pi@rp2:~ $ moodeutl -l
20190326 145313 worker: - Start
20190326 145313 worker: Successfully daemonized
20190326 145313 worker: Integrity check (warning: worker.php)
20190326 145313 worker: Integrity check (warning: playerlib.php)
20190326 145313 worker: Integrity check (passed with warnings)
20190326 145313 worker: ALSA volume (0%)
20190326 145314 worker: Session loaded
20190326 145314 worker: Debug logging (off)
20190326 145314 worker: - Platform
20190326 145317 worker: Rel  (Moode 5.0-RC0-53 2019-MM-DD)
20190326 145317 worker: Upd  (None)
20190326 145317 worker: Rasp (9.6)
20190326 145317 worker: Kern (4.19.30-v7+)
20190326 145317 worker: MPD  (0.21.6)
20190326 145317 worker: Host (rp2)
20190326 145317 worker: Hdwr (Pi-2B 1GB v1.1)
20190326 145317 worker: Arch (armv7l)
20190326 145317 worker: Gov  (performance)
20190326 145317 worker: USB boot not enabled yet
20190326 145317 worker: File system not expanded yet
20190326 145317 worker: HDMI port off
20190326 145317 worker: File check ok
20190326 145317 worker: - Network
20190326 145318 worker: eth0 exists
20190326 145318 worker: eth0 address not assigned
20190326 145318 worker: wlan0 exists
20190326 145318 worker: wifi country (US)
20190326 145318 worker: wlan0 trying SSID (AirnetN2)
20190326 145318 worker: wlan0 (192.168.1.169)
20190326 145318 worker: - Audio
20190326 145319 worker: ALSA outputs unmuted
20190326 145319 worker: ALSA card number (0)
20190326 145319 worker: Audio output (I2S audio device)
20190326 145319 worker: Audio device (HiFiBerry DAC+)
20190326 145319 worker: ALSA mixer name (Digital)
20190326 145319 worker: MPD volume control (hardware)
20190326 145319 worker: Hdwr volume controller exists
20190326 145319 worker: Chip options (Burr Brown PCM5122)
20190326 145319 worker: - Services
20190326 145319 worker: Reset renderer active state
20190326 145319 worker: MPD conf updated
20190326 145319 worker: MPD started
20190326 145320 worker: MPD accepting connections
20190326 145320 worker: Configure MPD outputs
20190326 145320 worker: MPD output 1 ALSA default (on)
20190326 145320 worker: MPD output 2 ALSA crossfeed (off)
20190326 145320 worker: MPD output 3 ALSA parametric eq (off)
20190326 145320 worker: MPD output 4 ALSA graphic eq (off)
20190326 145320 worker: MPD output 5 ALSA polarity inversion (off)
20190326 145320 worker: MPD output 6 ALSA bluetooth (off)
20190326 145320 worker: MPD output 7 HTTP stream (off)
20190326 145320 worker: MPD crossfade (off)
20190326 145320 worker: Airplay receiver started
20190326 145320 worker: Bluetooth pairing agent started
20190326 145320 worker: - Music sources
20190326 145320 worker: USB sources (none attached)
20190326 145321 worker: NAS sources (mountall initiated)
20190326 145321 worker: - Miscellaneous
20190326 145321 worker: Volume level (0) restored
20190326 145321 worker: Maintenance interval (21600)
20190326 145321 worker: Screen saver activation (Never)
20190326 145321 worker: Watchdog started
20190326 145321 worker: Ready
pi@rp2:~ $

-Tim

Thanks Tim for test.. i just try, same error (alsa equal) and ALSA volume in log file is "invalid card number".

Please, see below the results of this cmd, do you see something wrong? Maybe "failed to attach to hw"..

pi@moode:~ $ tail -f /var/log/mpd/log
Mar 26 16:16 : player: played "http://ice1.somafm.com/u80s-128-aac"
Mar 26 16:30 : exception: Failed to set mixer for 'ALSA graphic eq': failed to attach to hw:0: No such file or directory                                            
ALSA lib pcm_hw.c:1713: (_snd_pcm_hw_open) Invalid value for card
Mar 26 16:30 : exception: Failed to open "ALSA graphic eq" (alsa)
Mar 26 16:30 : exception: Failed to open ALSA device "alsaequal": No such file or directory                                                                                        
Mar 26 16:30 : exception: Failed to open "ALSA graphic eq" (alsa)
Mar 26 16:30 : exception: nested: Failed to open ALSA device "alsaequal": No such file or directory                                                                                        
Mar 26 16:30 : player: problems opening audio device while playing "http://ice1.                                                                                        somafm.com/u80s-128-aac"
Mar 26 16:30 : player: played "http://ice1.somafm.com/u80s-128-aac"
Mar 26 16:31 : exception: Failed to set mixer for 'ALSA graphic eq': failed to attach to hw:0: No such file or directory
Reply
#22
(03-26-2019, 06:54 PM)DRONE7 Wrote:
(03-26-2019, 06:43 PM)Blixa Wrote: It's strange that with a simply OFF>ON all works

About 50% of the time that had  mine working as well. The frustration of the other times caused me to investigate further.
I'm suspicious that your getting this on 2 hats though.

I note you've tried 2 hats and other cards/images... were they all on the same Pi ? with the same power supply ?

No, actually they are in 2 different ends (2 rooms of my home): the DIGI hat is on RPi 2B and have a linear power supply; the DAC on a RPi 3B with a 2.5A switching.
I've tested both RPi also inverting power supplies, same issue..crazy..
Probably it's not important but the DIGI is a PiFi Digi+, i select the Hifiberry Digi+ on the I2S config.
Reply
#23
(03-26-2019, 08:49 PM)Blixa Wrote:
(03-26-2019, 07:01 PM)Tim Curtis Wrote: I ran a quick test with a Pi-2B and HiFiBerry DAC+ board and no issues.

1. Audio Config, set I2S audio device = HiFiBerry DAC+, SET
2. Reboot
3. MPD Config, verify Device type = "I2S audio device",  set to Hardware volume, SAVE
4. Play music
5. Reboot
6. Print updated moode.log (below)

Code:
pi@rp2:~ $ moodeutl -l
20190326 145313 worker: - Start
20190326 145313 worker: Successfully daemonized
20190326 145313 worker: Integrity check (warning: worker.php)
20190326 145313 worker: Integrity check (warning: playerlib.php)
20190326 145313 worker: Integrity check (passed with warnings)
20190326 145313 worker: ALSA volume (0%)
20190326 145314 worker: Session loaded
20190326 145314 worker: Debug logging (off)
20190326 145314 worker: - Platform
20190326 145317 worker: Rel  (Moode 5.0-RC0-53 2019-MM-DD)
20190326 145317 worker: Upd  (None)
20190326 145317 worker: Rasp (9.6)
20190326 145317 worker: Kern (4.19.30-v7+)
20190326 145317 worker: MPD  (0.21.6)
20190326 145317 worker: Host (rp2)
20190326 145317 worker: Hdwr (Pi-2B 1GB v1.1)
20190326 145317 worker: Arch (armv7l)
20190326 145317 worker: Gov  (performance)
20190326 145317 worker: USB boot not enabled yet
20190326 145317 worker: File system not expanded yet
20190326 145317 worker: HDMI port off
20190326 145317 worker: File check ok
20190326 145317 worker: - Network
20190326 145318 worker: eth0 exists
20190326 145318 worker: eth0 address not assigned
20190326 145318 worker: wlan0 exists
20190326 145318 worker: wifi country (US)
20190326 145318 worker: wlan0 trying SSID (AirnetN2)
20190326 145318 worker: wlan0 (192.168.1.169)
20190326 145318 worker: - Audio
20190326 145319 worker: ALSA outputs unmuted
20190326 145319 worker: ALSA card number (0)
20190326 145319 worker: Audio output (I2S audio device)
20190326 145319 worker: Audio device (HiFiBerry DAC+)
20190326 145319 worker: ALSA mixer name (Digital)
20190326 145319 worker: MPD volume control (hardware)
20190326 145319 worker: Hdwr volume controller exists
20190326 145319 worker: Chip options (Burr Brown PCM5122)
20190326 145319 worker: - Services
20190326 145319 worker: Reset renderer active state
20190326 145319 worker: MPD conf updated
20190326 145319 worker: MPD started
20190326 145320 worker: MPD accepting connections
20190326 145320 worker: Configure MPD outputs
20190326 145320 worker: MPD output 1 ALSA default (on)
20190326 145320 worker: MPD output 2 ALSA crossfeed (off)
20190326 145320 worker: MPD output 3 ALSA parametric eq (off)
20190326 145320 worker: MPD output 4 ALSA graphic eq (off)
20190326 145320 worker: MPD output 5 ALSA polarity inversion (off)
20190326 145320 worker: MPD output 6 ALSA bluetooth (off)
20190326 145320 worker: MPD output 7 HTTP stream (off)
20190326 145320 worker: MPD crossfade (off)
20190326 145320 worker: Airplay receiver started
20190326 145320 worker: Bluetooth pairing agent started
20190326 145320 worker: - Music sources
20190326 145320 worker: USB sources (none attached)
20190326 145321 worker: NAS sources (mountall initiated)
20190326 145321 worker: - Miscellaneous
20190326 145321 worker: Volume level (0) restored
20190326 145321 worker: Maintenance interval (21600)
20190326 145321 worker: Screen saver activation (Never)
20190326 145321 worker: Watchdog started
20190326 145321 worker: Ready
pi@rp2:~ $

-Tim

Thanks Tim for test.. i just try, same error (alsa equal) and ALSA volume in log file is "invalid card number".

Please, see below the results of this cmd, do you see something wrong? Maybe "failed to attach to hw"..

pi@moode:~ $ tail -f /var/log/mpd/log
Mar 26 16:16 : player: played "http://ice1.somafm.com/u80s-128-aac"
Mar 26 16:30 : exception: Failed to set mixer for 'ALSA graphic eq': failed to attach to hw:0: No such file or directory                                            
ALSA lib pcm_hw.c:1713: (_snd_pcm_hw_open) Invalid value for card
Mar 26 16:30 : exception: Failed to open "ALSA graphic eq" (alsa)
Mar 26 16:30 : exception: Failed to open ALSA device "alsaequal": No such file or directory                                                                                        
Mar 26 16:30 : exception: Failed to open "ALSA graphic eq" (alsa)
Mar 26 16:30 : exception: nested: Failed to open ALSA device "alsaequal": No such file or directory                                                                                        
Mar 26 16:30 : player: problems opening audio device while playing "http://ice1.                                                                                        somafm.com/u80s-128-aac"
Mar 26 16:30 : player: played "http://ice1.somafm.com/u80s-128-aac"
Mar 26 16:31 : exception: Failed to set mixer for 'ALSA graphic eq': failed to attach to hw:0: No such file or directory

Hi,

Earlier in the thread the cmd below returned "file or directory not found" error indicating that Linux was not able to configure the I2S device. This process occurs before moOde loads and thus would suggest either a hardware issue or possibly wrong I2S driver selected in Audio config.

Code:
cat /proc/asound/card0/id


Have a look in .boot/config.txt. The HiFiberry Dac+ driver line would be like below

Code:
pi@rp3:~ $ cat /boot/config.txt
disable_splash=1
hdmi_drive=2
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=audio=off
dtoverlay=hifiberry-dacplus
#dtoverlay=pi3-disable-wifi
#dtoverlay=pi3-disable-bt
pi@rp3:~ $
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#24
@Tim Curtis 

I pulled a HiFiBerry DAC+ out of the drawer and slapped it on an RPi3B+. Booted into moOde r50rc0.

Set I2S audio device to HiFiBerry DAC+ and rebooted. Only volume settings available are "Disabled" and "Software".

Checked the audio portion of moode.log and got output which differs from yours: ALSA Card number (1) and Hdwr volume controller not detected.

Ran "aplay -l". Oh, sure, my Creative W2 USB-Audio BT adapter was still plugged in so ALSA counts two cards. That must be mucking up the works.

Code:
pi@moode50rc0:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sndrpihifiberry [snd_rpi_hifiberry_dacplus], device 0: HiFiBerry DAC+ HiFi pcm512x-hifi-0 []
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 1: W2 [Creative Bluetooth Audio W2], device 0: USB Audio [USB Audio]
 Subdevices: 1/1
 Subdevice #0: subdevice #0

So, I pulled the W2 and rebooted.

Hmmm. Now I can choose Hardware volume in Audio config. Not surprising, given the moode.log output:

Code:
20190326 222924 worker: ALSA card number (1)
20190326 222924 worker: Audio output (I2S audio device)
20190326 222924 worker: Audio device (HiFiBerry DAC+)
20190326 222924 worker: ALSA mixer name (Digital)
20190326 222924 worker: MPD volume control (software)
20190326 222924 worker: Hdwr volume controller exists

Wait, what, it's still card number (1)?  But ALSA now counts only one card

Code:
pi@moode50rc0:/var/www/command $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sndrpihifiberry [snd_rpi_hifiberry_dacplus], device 0: HiFiBerry DAC+ HiFi pcm512x-hifi-0 []
 Subdevices: 1/1
 Subdevice #0: subdevice #0

Something in moOde is "persisting" the old card number. (And I don't understand ALSA!)

And sure enough, if I choose an equalizer and try to play a track, I get errors not quite like those seen by @Blixa, but similar 

Code:
pi@moode50rc0:~ $ more /var/log/mpd/log
ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
Mar 26 22:35 : exception: Failed to open "ALSA crossfeed" (alsa)
Mar 26 22:35 : exception: nested: Failed to open ALSA device "crossfeed": No such file or directory
Mar 26 22:35 : exception: Failed to open "ALSA crossfeed" (alsa)
Mar 26 22:35 : exception: nested: Failed to open ALSA device "crossfeed": No such file or directory
Mar 26 22:35 : player: problems opening audio device while playing "http://198.27.68.65:8553/stream"


If I start again with a fresh copy of moOde r50rc0 and only the HiFiBerry DAC+ attached, I get the same result as you

Code:
...
20190326 232506 worker: ALSA card number (0)
20190326 232506 worker: Audio output (I2S audio device)
20190326 232506 worker: Audio device (HiFiBerry DAC+)
20190326 232506 worker: ALSA mixer name (Digital)
20190326 232506 worker: MPD volume control (software)
20190326 232507 worker: Hdwr volume controller exists
...

I can select Hardware volume, I can set an equalizer, and play a track successfully.


I wonder if something like this could be happening to @Blixa?

Regards,
Kent
Reply
#25
(03-26-2019, 10:07 PM)Tim Curtis Wrote: Have a look in .boot/config.txt. The HiFiberry Dac+ driver line would be like below

Code:
pi@rp3:~ $ cat /boot/config.txt
disable_splash=1
hdmi_drive=2
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=audio=off
dtoverlay=hifiberry-dacplus
#dtoverlay=pi3-disable-wifi
#dtoverlay=pi3-disable-bt
pi@rp3:~ $

Hi everybody, maybe i solved with DAC.
i following Tim's suggestion with .boot/config.txt and the text is as above, but the Alsa error persist;
So i tried to use a different I2S software device, based on dac's chip (ES9023) and load Audiophonics ES 9023 DAC: reboot and finally it works but in boot/config the dtoverlay is Hifiberry dac:

Code:
pi@moode:~ $ cat /boot/config.txt
disable_splash=1
hdmi_drive=2
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=audio=off
dtoverlay=hifiberry-dac
#dtoverlay=pi3-disable-wifi
#dtoverlay=pi3-disable-bt
pi@moode:~ $

Seems so strange and i repeated all another time, same results.
In the datasheet of my DAC it's indicated Hifiberry DAC+ the 12S software to load, maybe an error of seller?

So, is it a possible same cause the alsa error on PiFi Digi+?
Datasheet indicate HIFI DIGI+ or Hifiberry Digi+ compatible I2S software (infact works both when i power off>on), the chip mounted on hat is Wolfson WM8804G.

Thanks!
Reply
#26
(03-27-2019, 03:31 AM)TheOldPresbyope Wrote: @Tim Curtis 

I pulled a HiFiBerry DAC+ out of the drawer and slapped it on an RPi3B+. Booted into moOde r50rc0.

Set I2S audio device to HiFiBerry DAC+ and rebooted. Only volume settings available are "Disabled" and "Software".

Checked the audio portion of moode.log and got output which differs from yours: ALSA Card number (1) and Hdwr volume controller not detected.

Ran "aplay -l". Oh, sure, my Creative W2 USB-Audio BT adapter was still plugged in so ALSA counts two cards. That must be mucking up the works.

Code:
pi@moode50rc0:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sndrpihifiberry [snd_rpi_hifiberry_dacplus], device 0: HiFiBerry DAC+ HiFi pcm512x-hifi-0 []
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 1: W2 [Creative Bluetooth Audio W2], device 0: USB Audio [USB Audio]
 Subdevices: 1/1
 Subdevice #0: subdevice #0

For sure having an I2S and USB audio device connected at the same time will really mess up the configuration. Currently the code assumes that only one of either an I2S device or USB device is connected.

Its certainly possible to modify the code to support I2S and USB connected at same time and with a mechanism to switch between the two but there would need to be a demand for this capability since its a significant work effort.

After disconnecting the USB device it will prolly take two reboots to completely reset the config back to I2S.

-Tim
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#27
Quote:After disconnecting the USB device it will prolly take two reboots to completely reset the config back to I2S.


Ah, the old "boot it 'til works" trick  Rolleyes

I remember we'd discussed the dueling devices issue before and agree it's too much an edge case to bother with. What I didn't remember or never knew was the persistence effect.

Regards,
Kent
Reply


Forum Jump: