Thank you for your donation!


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


USB Sound Card Alsa Error
#1
Hello,

I've installed moodeaudio on a Pi4 with 4GB RAM. 

Installation was easy, everything (the built in test file, radio, squeezelite, airplay test so far) works using the Pi's headphones output into the amp. I am mighty impressed with moodeaudio, and now want to use my Onkyo SE-U55SX USB Soundcard as audio output. 

Soundcard plugged into USB port.

I go to Config -> Audio -> MPD Config and select the Onkyo which is the third option in the dropdown after Pi HDMI and Pi Headphones.

I leave everything else as it is.

Now when I try to play internet radio, squeezelite, airplay there is no sound, and the below error is displayed:



Code:
Failed to open "ALSA default" (alsa); Error opening ALSA device "hw:2,0"; snd_pcm_hw_params() failed: Input/output error

The stereo test file still works and plays over the Onkyo.

When I open Alsamixer and select the Onkyo, there is a message 
Code:
This sound device does not have any controls.

LSUSB shows:

Code:
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 0746:5512 Onkyo Corp.
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

aplay -L:


Code:
pi@moode:~ $ aplay -L
null
   Discard all samples (playback) or generate zero samples (capture)
btaplay_dmix
alsaequal
plug_alsaequal
btstream
crossfeed
plug_bs2b
eqfa4p
plug_eqfa4p
invpolarity
default:CARD=b1
   bcm2835 HDMI 1, bcm2835 HDMI 1
   Default Audio Device
sysdefault:CARD=b1
   bcm2835 HDMI 1, bcm2835 HDMI 1
   Default Audio Device
dmix:CARD=b1,DEV=0
   bcm2835 HDMI 1, bcm2835 HDMI 1
   Direct sample mixing device
dsnoop:CARD=b1,DEV=0
   bcm2835 HDMI 1, bcm2835 HDMI 1
   Direct sample snooping device
hw:CARD=b1,DEV=0
   bcm2835 HDMI 1, bcm2835 HDMI 1
   Direct hardware device without any conversions
plughw:CARD=b1,DEV=0
   bcm2835 HDMI 1, bcm2835 HDMI 1
   Hardware device with all software conversions
default:CARD=Headphones
   bcm2835 Headphones, bcm2835 Headphones
   Default Audio Device
sysdefault:CARD=Headphones
   bcm2835 Headphones, bcm2835 Headphones
   Default Audio Device
dmix:CARD=Headphones,DEV=0
   bcm2835 Headphones, bcm2835 Headphones
   Direct sample mixing device
dsnoop:CARD=Headphones,DEV=0
   bcm2835 Headphones, bcm2835 Headphones
   Direct sample snooping device
hw:CARD=Headphones,DEV=0
   bcm2835 Headphones, bcm2835 Headphones
   Direct hardware device without any conversions
plughw:CARD=Headphones,DEV=0
   bcm2835 Headphones, bcm2835 Headphones
   Hardware device with all software conversions
default:CARD=SEU55SX
   ONKYO SE-U55SX, USB Audio
   Default Audio Device
sysdefault:CARD=SEU55SX
   ONKYO SE-U55SX, USB Audio
   Default Audio Device
front:CARD=SEU55SX,DEV=0
   ONKYO SE-U55SX, USB Audio
   Front speakers
surround21:CARD=SEU55SX,DEV=0
   ONKYO SE-U55SX, USB Audio
   2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=SEU55SX,DEV=0
   ONKYO SE-U55SX, USB Audio
   4.0 Surround output to Front and Rear speakers
surround41:CARD=SEU55SX,DEV=0
   ONKYO SE-U55SX, USB Audio
   4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=SEU55SX,DEV=0
   ONKYO SE-U55SX, USB Audio
   5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=SEU55SX,DEV=0
   ONKYO SE-U55SX, USB Audio
   5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=SEU55SX,DEV=0
   ONKYO SE-U55SX, USB Audio
   7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=SEU55SX,DEV=0
   ONKYO SE-U55SX, USB Audio
   IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=SEU55SX,DEV=0
   ONKYO SE-U55SX, USB Audio
   Direct sample mixing device
dmix:CARD=SEU55SX,DEV=1
   ONKYO SE-U55SX, USB Audio #1
   Direct sample mixing device
dsnoop:CARD=SEU55SX,DEV=0
   ONKYO SE-U55SX, USB Audio
   Direct sample snooping device
dsnoop:CARD=SEU55SX,DEV=1
   ONKYO SE-U55SX, USB Audio #1
   Direct sample snooping device
hw:CARD=SEU55SX,DEV=0
   ONKYO SE-U55SX, USB Audio
   Direct hardware device without any conversions
hw:CARD=SEU55SX,DEV=1
   ONKYO SE-U55SX, USB Audio #1
   Direct hardware device without any conversions
plughw:CARD=SEU55SX,DEV=0
   ONKYO SE-U55SX, USB Audio
   Hardware device with all software conversions
plughw:CARD=SEU55SX,DEV=1
   ONKYO SE-U55SX, USB Audio #1
   Hardware device with all software conversions

moodeutl -l:


Code:
pi@moode:~ $ moodeutl -l
20200930 101636 worker: -- Start
20200930 101637 worker: Successfully daemonized
20200930 101637 worker: Integrity check (passed)
20200930 101637 worker: Session loaded
20200930 101637 worker: Debug logging (off)
20200930 101637 worker: Device raw: (0:b1|1:Headphones|2:SEU55SX|3:empty
20200930 101637 worker: Device i2s: (none)
20200930 101637 worker: Device mpd: (2:ONKYO SE-U55SX)
20200930 101637 worker: Device ses: (2|ONKYO SE-U55SX|Headphone|100%)
20200930 101637 worker: ALSA PCM volume set to (amixer: Unable to find simple control 'PCM',0)
20200930 101637 worker: -- System
20200930 101639 worker: Host     (moode)
20200930 101639 worker: moOde    (6.7.1 2020-07-22)
20200930 101639 worker: RaspiOS  (10.4)
20200930 101639 worker: Kernel   (5.4.51-v8+ #1325)
20200930 101639 worker: Platform (Pi-4B 4GB v1.2)
20200930 101639 worker: ARM arch (aarch64, 64-bit kernel)
20200930 101639 worker: MPD ver  (0.21.24)
20200930 101639 worker: CPU gov  (ondemand)
20200930 101639 worker: USB boot not available
20200930 101639 worker: File system not expanded yet
20200930 101639 worker: HDMI port on
20200930 101639 worker: File check (OK)
20200930 101639 worker: -- Network
20200930 101639 worker: eth0 exists
20200930 101639 worker: eth0 wait 0 for IP address
20200930 101642 worker: eth0 wait 1 for IP address
20200930 101645 worker: eth0 wait 2 for IP address
20200930 101649 worker: eth0 wait 3 for IP address
20200930 101652 worker: eth0 wait 4 for IP address
20200930 103540 worker: eth0 address not assigned
20200930 103540 worker: wlan0 exists
20200930 103540 worker: wifi country (AU)
20200930 103540 worker: wlan0 trying SSID (HOMEX)
20200930 103543 worker: IP addr (172.16.50.127)
20200930 103543 worker: Netmask (255.255.255.0)
20200930 103543 worker: Gateway (172.16.50.1)
20200930 103543 worker: Pri DNS (8.8.8.8)
20200930 103543 worker: Domain  (8.8.4.4)
20200930 103543 worker: -- Audio
20200930 103544 worker: MPD conf updated
20200930 103544 worker: ALSA outputs unmuted
20200930 103544 worker: ALSA card number (2)
20200930 103544 worker: Audio output (ONKYO SE-U55SX)
20200930 103545 worker: Audio formats (S16_LE, S24_3LE)
20200930 103545 worker: ALSA mixer name (PCM)
20200930 103545 worker: MPD volume control (software)
20200930 103545 worker: Hdwr volume controller not detected
20200930 103545 worker: Reset renderer active flags
20200930 103545 worker: -- MPD
20200930 103545 worker: MPD started
20200930 103545 worker: MPD accepting connections
20200930 103545 worker: Configure MPD outputs
20200930 103546 worker: MPD output 1 ALSA default (on)
20200930 103546 worker: MPD output 2 ALSA crossfeed (off)
20200930 103546 worker: MPD output 3 ALSA parametric eq (off)
20200930 103546 worker: MPD output 4 ALSA graphic eq (off)
20200930 103546 worker: MPD output 5 ALSA polarity inversion (off)
20200930 103546 worker: MPD output 6 ALSA bluetooth (off)
20200930 103546 worker: MPD output 7 HTTP stream (off)
20200930 103546 worker: MPD crossfade (off)
20200930 103546 worker: -- Feature availability
20200930 103546 worker: Source select (available)
20200930 103546 worker: Source select (source: MPD)
20200930 103546 worker: Source select (output: ONKYO SE-U55SX)
20200930 103546 worker: Bluetooth (available)
20200930 103546 worker: Airplay renderer (available)
20200930 103546 worker: Airplay renderer (started)
20200930 103546 worker: Spotify renderer (available)
20200930 103546 worker: Squeezelite renderer (available)
20200930 103546 worker: UPnP renderer (available)
20200930 103546 worker: DLNA server (available)
20200930 103546 worker: UPnP browser (available)
20200930 103546 worker: Audio scrobbler (available)
20200930 103546 worker: GPIO button handler (available)
20200930 103546 worker: -- Music sources
20200930 103546 worker: USB sources (none attached)
20200930 103547 worker: NAS and UPnP sources (mountall initiated)
20200930 103547 worker: -- Miscellaneous
20200930 103547 worker: USB volume knob (Off)
20200930 103547 worker: Shellinabox SSH started
20200930 103547 worker: USB auto-mounter (udisks-glue)
20200930 103547 worker: LED0 (On)
20200930 103547 worker: LED1 (On)
20200930 103547 worker: Saved MPD vol level (0)
20200930 103547 worker: Preamp volume level (0)
20200930 103547 worker: MPD volume level (0) restored
20200930 103547 worker: ALSA volume level (None)
20200930 103547 worker: Auto-play (Off)
20200930 103547 worker: Maintenance interval (3 hrs)
20200930 103547 worker: Screen saver activation (Never)
20200930 103547 worker: Session permissions (OK)
20200930 103547 worker: Watchdog started
20200930 103547 worker: Ready
20200930 112649 worker: Job mpdrestart
20200930 113847 worker: Job airplaysvc

Thinking it's a volume control issue I tried setting MPD volume control from Software to 0 (zero), which didn't change anything, so I set it back to Software.

Tried setting SOX resamplerate to 24/96 made no difference. Also set it back to Disabled.

I set logging to verbose, to see what comes through /cat/log/mpd/log. Here some snipped of error messages:


Code:
Sep 30 11:22 : client: [12] opened from 127.0.0.1:35596
Sep 30 11:22 : client: [12] process command "play"
Sep 30 11:22 : playlist: play 0:"http://subfm.radioca.st/Sub.FM"
Sep 30 11:22 : client: [12] command returned 0
Sep 30 11:22 : playlist: queue song 1:"http://stream.radioactive.fm"
Sep 30 11:22 : client: [12] process command "close"
Sep 30 11:22 : client: [12] command returned 3
Sep 30 11:22 : client: [12] closed
Sep 30 11:22 : curl: icy-metaint=8192
Sep 30 11:22 : decoder_thread: probing plugin mad
Sep 30 11:22 : decoder: audio_format=44100:24:2, seekable=false
Sep 30 11:22 : alsa_output: opened hw:2,0 type=HW
Sep 30 11:22 : alsa_output: buffer: size=90..174762 time=2040..3962858
Sep 30 11:22 : alsa_output: period: size=45..87381 time=1020..1981429
Sep 30 11:22 : alsa_output: default period_time = buffer_time/4 = 500000/4 = 125000
Sep 30 11:22 : exception: Failed to open "ALSA default" (alsa)
Sep 30 11:22 : exception: nested: Error opening ALSA device "hw:2,0"
Sep 30 11:22 : exception: snd_pcm_hw_params() failed: Input/output error
Sep 30 11:22 : exception: Failed to open "ALSA default" (alsa)
Sep 30 11:22 : exception: nested: Error opening ALSA device "hw:2,0"
Sep 30 11:22 : exception: snd_pcm_hw_params() failed: Input/output error
Sep 30 11:22 : player: problems opening audio device while playing "http://subfm.radioca.st/Sub.FM"

I've looked at previous similar threads and followed steps suggested there (bar re-installing the image), however I feel I must have missed something.

Any help is much appreciated!

Phil.
Reply
#2
Squeezelite renderer hogs the audio output if it's not turned off in LMS.

ETA: And LMS has to be running. If its not running when Squeezeit is started Squeezelite defaults to ON and hogs the audio output.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
Thanks for quick response, Tim!

Not sure I get what you're saying. The LMS is running on the network, nonstop. I've got some other clients playing successfully.

Output from the pi's headphones jack via the squeezelite renderer also no problem.

Since posting, I went ahead and flashed another SD card, so did a totally fresh install.

The only thing the Onkyo card will play is the stereo test file - but it does play that very nicely....Wink

Even if I never touch the squeezelite renderer, and attempt to play networked files, or radio, I get the alsa error.
Reply
#4
I'm a bit confused.

On a fresh install with no renderers turned on, Ethernet cable connected or WiFi successfully configured, USB audio device configured in MPD you should be able to play the Stereo Test file and any of the radio stations.

if radio stations don't play it would suggest a network issue.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#5
I noticed this from the moode log

20200930 103543 worker: IP addr (172.16.50.127)
20200930 103543 worker: Netmask (255.255.255.0)
20200930 103543 worker: Gateway (172.16.50.1)
20200930 103543 worker: Pri DNS (8.8.8.8)
20200930 103543 worker: Domain (8.8.4.4)

The Primary DNS should be same as the LAN address (Gateway) of your Router and not an external address. Your Router DHCP service should have assigned 172.16.50.1 as Pri DNS. The address segment 172.16.50 seems unusual. Are you using a typical residential WiFi Router?
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#6
(09-30-2020, 12:31 PM)Tim Curtis Wrote: I noticed this from the moode log

20200930 103543 worker: IP addr (172.16.50.127)
20200930 103543 worker: Netmask (255.255.255.0)
20200930 103543 worker: Gateway (172.16.50.1)
20200930 103543 worker: Pri DNS (8.8.8.8)
20200930 103543 worker: Domain  (8.8.4.4)

The Primary DNS should be same as the LAN address (Gateway) of your Router and not an external address. Your Router DHCP service should have assigned 172.16.50.1 as Pri DNS. The address segment 172.16.50 seems unusual. Are you using a typical residential WiFi Router?

I don't use the router to proxy DNS, I let all my machines hit the public server directly. Shouldn't be connected to the alsa issue though, should it?
Reply
#7
First would be to verify my post #4. If MPD can play SDCARD file to your DAC but not radio station there is some sort of network issue preventing access to Internet or it's a broken DNS config. If MPD can't play SDCARD file then there is some other issue.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#8
(09-30-2020, 02:09 PM)Tim Curtis Wrote: First would be to verify my post #4. If MPD can play SDCARD file to your DAC but not radio station there is some sort of network issue preventing access to Internet or it's a broken DNS config. If MPD can't play SDCARD file then there is some other issue.

Progress!

It seems it's related to the file format. I ripped some files as FLAC and tried those, they play. These files are in the same directory on the NAS that the mp3's are, just that the mp3's don't play. 

Not sure what format radio streams in, but some play, some don't.

This does not play:
Radio 1 88.6
as do many others

This plays:
Radio Paradise, Main Mix
as do many others

From the NAS:

This does not play:

Code:
file: NAS/itunes/Dub Incorporation/Dans Le Decor/01 Survie.mp3
Last-Modified: 2014-01-03T06:12:17Z
Format: 48000:24:2
Time: 282
duration: 282.120
Artist: Dub Incorporation
Title: Survie
Album: Dans Le Decor
Track: 1
Date: 2005
Genre: Reggae
Comment: 0
Comment: 00000E4A 00000D78 0000733F 00006410 000191A0 000191A0 00008106 00008020 0001BEB8 00007788
Comment: 00000000 00000210 000007F0 0000000000CE9780 00000000 00AC1340 00000000 00000000 00000000 00000000 00000000 00000000
Comment: 13+AA7BA29B666C9097A00DC3E8960914D5+6075318


This plays:

Code:
file: NAS/Flac/0PT1M0/Live_at_West_Runton_Pavilion/01.CD_4.flac
Last-Modified: 2014-01-03T05:21:13Z
Format: 44100:16:2
Time: 4045
duration: 4045.040
Artist: 0PT1M0
Album: Live at West Runton Pavilion
Title: CD 4
Date: 2002
Genre: Alternative
Track: 1
Reply
#9
here some log entries of radio stations that play and some that don't:


Code:
Sep 30 23:47 : player: played "NAS/itunes/Badawi/The Heretic Of Ether/02 Tired Soldiers.mp3"
Sep 30 23:47 : exception: Failed to decode /var/lib/mpd/music/NAS/itunes/Badawi/The Heretic Of Ether/02 Tired Soldiers.mp3
Sep 30 23:47 : exception: nested: Failed to open '/var/lib/mpd/music/NAS/itunes/Badawi/The Heretic Of Ether/02 Tired Soldiers.mp3': No such file or directory
Sep 30 23:47 : player: played "NAS/itunes/Badawi/The Heretic Of Ether/02 Tired Soldiers.mp3"
Sep 30 23:51 : exception: Failed to open "ALSA default" (alsa)
Sep 30 23:51 : exception: nested: Error opening ALSA device "hw:2,0"
Sep 30 23:51 : exception: snd_pcm_hw_params() failed: Input/output error
Sep 30 23:51 : exception: Failed to open "ALSA default" (alsa)
Sep 30 23:51 : exception: nested: Error opening ALSA device "hw:2,0"
Sep 30 23:51 : exception: snd_pcm_hw_params() failed: Input/output error
Sep 30 23:51 : player: problems opening audio device while playing "http://subfm.radioca.st/Sub.FM"
Oct 01 00:10 : exception: Failed to open "ALSA default" (alsa)
Oct 01 00:10 : exception: nested: Error opening ALSA device "hw:2,0"
Oct 01 00:10 : exception: snd_pcm_hw_params() failed: Input/output error
Oct 01 00:10 : exception: Failed to open "ALSA default" (alsa)
Oct 01 00:10 : exception: nested: Error opening ALSA device "hw:2,0"
Oct 01 00:10 : exception: snd_pcm_hw_params() failed: Input/output error
Oct 01 00:10 : exception: Failed to open "ALSA default" (alsa)
Oct 01 00:10 : exception: nested: Error opening ALSA device "hw:2,0"
Oct 01 00:10 : exception: snd_pcm_hw_params() failed: Input/output error
Oct 01 00:10 : exception: Failed to open "ALSA default" (alsa)
Oct 01 00:10 : exception: nested: Error opening ALSA device "hw:2,0"
Oct 01 00:10 : exception: snd_pcm_hw_params() failed: Input/output error
Oct 01 00:16 : player: played "http://ice1.somafm.com/metal-128-aac"
Oct 01 00:16 : player: played "http://ice1.somafm.com/bootliquor-128-aac"
Oct 01 00:16 : exception: Failed to open "ALSA default" (alsa)
Oct 01 00:16 : exception: nested: Error opening ALSA device "hw:2,0"
Oct 01 00:16 : exception: snd_pcm_hw_params() failed: Input/output error
Oct 01 00:16 : exception: Failed to open "ALSA default" (alsa)
Oct 01 00:16 : exception: nested: Error opening ALSA device "hw:2,0"
Oct 01 00:16 : exception: snd_pcm_hw_params() failed: Input/output error
Oct 01 00:16 : player: problems opening audio device while playing "http://stream.radioactive.fm"
Oct 01 00:16 : exception: Failed to open "ALSA default" (alsa)
Oct 01 00:16 : exception: nested: Error opening ALSA device "hw:2,0"
Oct 01 00:16 : exception: snd_pcm_hw_params() failed: Input/output error
Oct 01 00:16 : exception: Failed to open "ALSA default" (alsa)
Oct 01 00:16 : exception: nested: Error opening ALSA device "hw:2,0"
Oct 01 00:16 : exception: snd_pcm_hw_params() failed: Input/output error
Oct 01 00:17 : exception: Failed to open "ALSA default" (alsa)
Oct 01 00:17 : exception: nested: Error opening ALSA device "hw:2,0"
Oct 01 00:17 : exception: snd_pcm_hw_params() failed: Input/output error
Reply
#10
Pleased to report that I've solved the problem by selecting SOX resampling rate to 16/44.1. Not sure if it had anything to do with it, but I also installed latest version of Sox.
I'll play around with other resampling rates, to see what happens. Not sure why this was necessary as lsusb -v puts out

tSamFreq[ 0] 44100
tSamFreq[ 1] 48000
tSamFreq[ 2] 96000

Thanks for the support!
Phil
Reply


Forum Jump: