You are not logged in.
Hi guys,
I could not get any sound of my USB DAC, I hope someone can help me. When I start playing the music the playback stops immediately.
When I list the audio cards I got this:
card 0: D2Qute [2Qute], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
I'm trying to set it up in ALSA and I assuming the 'device hw' is wrong in the mpd.conf file, but I have no idea what else I could try as I tried all of these:
"0,0", "0,1", "1,1", "D2Qute", "2Qute" but the error message is always the same:
Unable to set hw params for PLAYBACK: Input/output error
I found the speaker-test -c 2 command and it alwas says:
ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
I've also commented out these two options from the mpd.conf file:
# dsd_native "yes"
# dsd_native_type "2"
Any help would be much appreciated!
Thanks,
Tom
Last edited by ftom75 (2017-05-04 14:52:53)
Offline
Feel free to let me know if you guys think there is a better place to ask.
Offline
Use code tags for pasting command output and file contents. hw:0,0 should be the correct card from what we see here. Could you post the complete outputs of
sudo fuser -v /dev/snd/*
aplay -lL
amixer -c0
dmesg | grep usb
I suppose your DAC only exposes an SPDIF output, which would make sense that the two channel request with speaker-test would fail.
Last edited by V1del (2017-05-04 14:44:29)
Offline
Use code tags for pasting command output and file contents. hw:0,0 should be the correct card from what we see here. Could you post the complete outputs of
sudo fuser -v /dev/snd/* aplay -lL amixer -c0 dmesg | grep usb
I suppose your DAC only exposes an SPDIF output, which would make sense that the two channel request with speaker-test would fail.
Ah, thanks, I did not find how to add code tags.
My DAC has COAX, SPDIF and USB input and works pretty well on Ubuntu with no extra hustle.
Offline
Ubuntu also uses pulseaudio by default, which will do many of the things you will want to be aware of if you intend to simply use ALSA directly, automatically. This of course, would be another option to use, but then you'd have to change your approach to MPD configuration.
Offline
Ubuntu also uses pulseaudio by default, which will do many of the things you will want to be aware of if you intend to simply use ALSA directly, automatically. This of course, would be another option to use, but then you'd have to change your approach to MPD configuration.
No, I prefer to stick with the Arch distro unless I have to give up because of my DAC.
Offline
V1del wrote:Ubuntu also uses pulseaudio by default, which will do many of the things you will want to be aware of if you intend to simply use ALSA directly, automatically. This of course, would be another option to use, but then you'd have to change your approach to MPD configuration.
No, I prefer to stick with the Arch distro unless I have to give up because of my DAC.
I think he meant you could try pulseaudio and see if it just magically fixes it (same as in Ubuntu).
Offline
I wasn't talking about the distribution, but about using pulseaudio as opposed to plain ALSA. However before we drown ourselves in technicalities, could you post the commands I asked for? Maybe also append your full mpd.conf
Offline
Oh I see, sorry I was confused. BTW my main goal is getting the best audio out of the PC through of my USB DAC.
This is what I have in the mpd.conf.
Many thanks!
# mpd.conf
### PATHS section start ############################
music_directory "/home/tom/Music"
playlist_directory "/home/tom/.mpd/playlists"
db_file "/home/tom/.mpd/mpd.db"
log_file "/home/tom/.mpd/mpd.log"
pid_file "/home/tom/.mpd/mpd.pid"
state_file "/home/tom/.mpd/mpd_state"
sticker_file "/home/tom/.mpd/sticker.sql"
### PATHS section end
####################################################
password "1234@read,add,control,admin"
user "tom"
### AUDIO section start ############################
audio_output {
type "alsa"
name "Audio USB Audio"
device "hw:0,0"
mixer_type "none"
dop "no"
dsd_native "yes"
dsd_native_type "2"
# buffer_time "100000"
# period_time "1024000000"
use_mmap "yes"
auto_resample "no"
auto_channels "no"
auto_format "no"
}
### AUDIO section end ##############################
### MISC section start #############################
filesystem_charset "UTF-8"
id3v1_encoding "UTF-8"
auto_update "yes"
connection_timeout "3600"
restore_paused "yes"
### MISC section end ##############################
Offline
I can send you the output of the commands you sent me when I got back home.
Offline
Unable to set hw params for PLAYBACK: Input/output error
Probably the device is picky about sample formats and channel count. I have a soundcard which will only accepts 2 channels 32bit. No mono, no 8/16/24bit.
Try to discover supported formats like that:
$ aplay /dev/zero -D hw:3
Playing raw data '/dev/zero' : Unsigned 8 bit, Rate 8000 Hz, Mono
aplay: set_params:1299: Sample format non available
Available formats:
- S32_LE
$ aplay /dev/zero -D hw:3 -f S32_LE
Playing raw data '/dev/zero' : Signed 32 bit Little Endian, Rate 8000 Hz, Mono
aplay: set_params:1305: Channels count non available
$ aplay /dev/zero -D hw:3 -f S32_LE -c 2
Playing raw data '/dev/zero' : Signed 32 bit Little Endian, Rate 8000 Hz, Stereo
Offline
dop "no"
Have you tried enabling the DoP option?
Also, does PCM work?
I think that is the technically superior paradigm anyway, unless you enjoy excessive amounts of high-frequency quantisation noise
Offline
Well, I am not far from that
All of the ICs are covered with EMI shield,
I have a usb card with crystal oscillator module, driven with an external linear power supply + with an external ultracap, the mobo has a separated linear power supply with toroidal transformer, the Dac is galvanically isolated with another linear power supply and the SSD has its own lpsu as well.
Not sure if I tried to turn the DOP off, will do that.
Last edited by ftom75 (2017-05-04 18:04:38)
Offline
Unable to set hw params for PLAYBACK: Input/output error
Probably the device is picky about sample formats and channel count. I have a soundcard which will only accepts 2 channels 32bit. No mono, no 8/16/24bit.
Try to discover supported formats like that:
$ aplay /dev/zero -D hw:3 Playing raw data '/dev/zero' : Unsigned 8 bit, Rate 8000 Hz, Mono aplay: set_params:1299: Sample format non available Available formats: - S32_LE $ aplay /dev/zero -D hw:3 -f S32_LE Playing raw data '/dev/zero' : Signed 32 bit Little Endian, Rate 8000 Hz, Mono aplay: set_params:1305: Channels count non available $ aplay /dev/zero -D hw:3 -f S32_LE -c 2 Playing raw data '/dev/zero' : Signed 32 bit Little Endian, Rate 8000 Hz, Stereo
For USB sound card you can do:
cat /proc/asound/cardN/stream0
Some cards might have stream1 and so on, personally I haven't seen one yet though.
Edit: aplay also has the corresponding --dump-hw-params switch, tho it only lists supported sampling rates as a range AFAIK.
Last edited by tom.ty89 (2017-05-05 10:21:43)
Offline
Use code tags for pasting command output and file contents. hw:0,0 should be the correct card from what we see here. Could you post the complete outputs of
sudo fuser -v /dev/snd/* aplay -lL amixer -c0 dmesg | grep usb
I suppose your DAC only exposes an SPDIF output, which would make sense that the two channel request with speaker-test would fail.
Hi V1del,
These are the output from the commands:
sudo fuser -v /dev/snd/* /home/tom
USER PID ACCESS COMMAND
/dev/snd/controlC0: root 1759 F.... Main
/dev/snd/pcmC0D0p: root 1759 F...m Main
<apl>[tom]# aplay -lL /home/tom
null
Discard all samples (playback) or generate zero samples (capture)
sysdefault:CARD=D2Qute
2Qute, USB Audio
Default Audio Device
front:CARD=D2Qute,DEV=0
2Qute, USB Audio
Front speakers
surround21:CARD=D2Qute,DEV=0
2Qute, USB Audio
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=D2Qute,DEV=0
2Qute, USB Audio
4.0 Surround output to Front and Rear speakers
surround41:CARD=D2Qute,DEV=0
2Qute, USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=D2Qute,DEV=0
2Qute, USB Audio
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=D2Qute,DEV=0
2Qute, USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=D2Qute,DEV=0
2Qute, USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=D2Qute,DEV=0
2Qute, USB Audio
IEC958 (S/PDIF) Digital Audio Output
**** List of PLAYBACK Hardware Devices ****
card 0: D2Qute [2Qute], device 0: USB Audio [USB Audio]
Subdevices: 0/1
Subdevice #0: subdevice #0
<apl>[tom]# amixer -c0 /home/tom
Simple mixer control 'PCM',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 32767
Mono:
Front Left: Playback 27646 [84%] [-20.01dB] [on]
Front Right: Playback 27646 [84%] [-20.01dB] [on]
Simple mixer control 'PCM',1
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 32767
Mono: Playback 27646 [84%] [-20.01dB] [on]
Simple mixer control '2Qute Validity',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [on]
<apl>[tom]# dmesg | grep usb /home/tom
[ 1.133234] usbcore: registered new interface driver usbfs
[ 1.134051] usbcore: registered new interface driver hub
[ 1.134519] usbcore: registered new device driver usb
[ 1.177586] usb usb6: We don't know the algorithms for LPM for this host, disabling LPM.
[ 1.480050] usb 1-4: new high-speed USB device number 2 using xhci_hcd
[ 1.503591] usb 4-1: new SuperSpeed USB device number 2 using xhci_hcd
[ 1.596710] usb 5-2: new high-speed USB device number 2 using xhci_hcd
[ 1.936661] usb 1-6: new full-speed USB device number 3 using xhci_hcd
[ 2.200731] usbcore: registered new interface driver usbhid
[ 2.200733] usbhid: USB HID core driver
[ 2.211328] input: AliTV Remote V1 Airmouse as /devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6:1.0/0003:0C45:3451.0001/input/input2
[ 2.266968] hid-generic 0003:0C45:3451.0001: input,hidraw0: USB HID v1.01 Keyboard [AliTV Remote V1 Airmouse] on usb-0000:00:14.0-6/input0
[ 2.267335] input: AliTV Remote V1 Airmouse as /devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6:1.1/0003:0C45:3451.0002/input/input3
[ 2.267460] hid-generic 0003:0C45:3451.0002: input,hidraw1: USB HID v1.01 Mouse [AliTV Remote V1 Airmouse] on usb-0000:00:14.0-6/input1
[ 2.267825] hid-generic 0003:0C45:3451.0003: hiddev0,hidraw2: USB HID v1.10 Device [AliTV Remote V1 Airmouse] on usb-0000:00:14.0-6/input2
[ 2.268327] input: AliTV Remote V1 Airmouse as /devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6:1.3/0003:0C45:3451.0004/input/input4
[ 2.270552] hid-generic 0003:0C45:3451.0004: input,hidraw3: USB HID v1.01 Gamepad [AliTV Remote V1 Airmouse] on usb-0000:00:14.0-6/input3
[ 3.138009] usbcore: registered new interface driver usb-storage
[ 3.163332] usbcore: registered new interface driver uas
[ 3.297075] usb 5-2: Not enough bandwidth for altsetting 1
[ 3.301232] usb 5-2: Not enough bandwidth for altsetting 1
[ 3.306259] usb 5-2: Warning! Unlikely big volume range (=32767), cval->res is probably wrong.
[ 3.306260] usb 5-2: [10] FU [PCM Playback Volume] ch = 2, val = -32767/0/1
[ 3.309996] usbcore: registered new interface driver r8152
[ 3.310756] usb 5-2: Warning! Unlikely big volume range (=32767), cval->res is probably wrong.
[ 3.310757] usb 5-2: [10] FU [PCM Playback Volume] ch = 1, val = -32767/0/1
[ 3.319328] usbcore: registered new interface driver snd-usb-audio
[ 3.330998] usbcore: registered new interface driver cdc_ether
[ 3.443904] usb 4-1: reset SuperSpeed USB device number 2 using xhci_hcd
[ 358.570500] usb 5-2: Not enough bandwidth for altsetting 1
[ 358.570502] usb 5-2: 2:1: usb_set_interface failed (-22)
[ 358.671462] usb 5-2: Not enough bandwidth for altsetting 1
[ 358.671464] usb 5-2: 2:1: usb_set_interface failed (-22)
[ 358.772289] usb 5-2: Not enough bandwidth for altsetting 1
[ 358.772293] usb 5-2: 2:1: usb_set_interface failed (-22)
[ 358.873129] usb 5-2: Not enough bandwidth for altsetting 1
[ 358.873133] usb 5-2: 2:1: usb_set_interface failed (-22)
Offline
.....
For USB sound card you can do:cat /proc/asound/cardN/stream0
Hi Tom,
I have this:
cat /proc/asound/card0/stream0 /home/tom
Chord Electronics Ltd 2Qute at usb-0000:0a:00.0-2, high speed : USB Audio
Playback:
Status: Stop
Interface 2
Altset 1
Format: S32_LE
Channels: 2
Endpoint: 5 OUT (ASYNC)
Rates: 32000, 44100, 48000, 88200, 96000, 176400, 192000, 352800, 384000
Data packet interval: 125 us
Offline
So that's it, only 32bit stereo. I see some "auto_channels" and "auto_format" options disabled in your config. Did you try enabling them?
Offline
You need this line under audio_output (if you use ALSA and the hw plugin):
format *:32:2
since your sound card is like mich41's, accepts only 2-channel 32 bit signal. The * allows mpd to dynamically switch the set sample rate according to the source, while it should convert format and upmix/downmix when necessary.
https://www.musicpd.org/doc/user/config … tputs.html
"auto_format" and "auto_channels" can stay as "no" I think, apparently setting them to yes passes the job to ALSA (which makes the format line/option unnecessary).
P.S. Interestingly, it seems that there is no way to make mpd set format as S24_3 (unpadded 24-bit)...
Last edited by tom.ty89 (2017-05-05 21:34:55)
Offline
Many thanks for the reply guys but it is the same. This is what I have in the config file, can I change anything else?
audio_output {
16 type "alsa"
17 name "2Qute"
18 device "hw:0,0"
19 mixer_type "none"
20 dop "no"
21 # dsd_native "yes"
22 # dsd_native_type "2"
23 # buffer_time "100000"
24 # period_time "1024000000"
25 use_mmap "yes"
26 auto_resample "no"
27 auto_channels "yes"
28 auto_format "yes"
29 format "*:32:2"
Offline
Are you trying to play DSD files? If so you may try setting "dop" to "yes" and "dsd_native" to "no".
Also try setting "use_mmap" to "no".
Also after you do the fuser check, have you check whether the pid refers to mpd?
ps -p $pid
Note that most sound cards these days do not support hardware mixing, so it can only be opened by one process with the hw plugin.
Also does this at least work (with the mpd server stopped):
speaker-test -D plughw:0,0
Last edited by tom.ty89 (2017-05-05 22:10:40)
Offline
Thanks Tom, I've tried
dsd_native "no"
and
use_mmap "no"
did not help, but probably this might be interesting:
speaker-test -D plughw:0,0 ~
speaker-test 1.1.3
Playback device is plughw:0,0
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Playback open error: -16,Device or resource busy
Last edited by ftom75 (2017-05-07 17:20:04)
Offline
speaker-test -D plughw:0,0 ~ speaker-test 1.1.3 Playback device is plughw:0,0 Stream parameters are 48000Hz, S16_LE, 1 channels Using 16 octaves of pink noise Playback open error: -16,Device or resource busy
As I said, the device can only be opened by one process, so before you test with anything (speaker-test, starting the mpd server...), you should make sure nothing is using the device, which can be done with the fuser check that you've already done once. If it is being used (that is, you see a PID), you should check the PID with ps -p and see what it is, and stop it from using the device any longer properly.
Last edited by tom.ty89 (2017-05-08 07:43:47)
Offline
Hi Tom,
I could find out which software kept the soundcard busy and killed it. I ran the speaker test
and this time I got something else:
speaker-test 1.1.3
Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
Playback open error: -2,No such file or directory
Thanks!
Last edited by ftom75 (2017-05-09 19:03:56)
Offline
The error message isn't particularly informative but you can see it's trying to use wrong channel count and format. So,
speaker-test -c 2 -F S32_LE
Offline
Hi Mich,
Thanks for your help!
I got this:
speaker-test -c 2 -F S32_LE ~
speaker-test 1.1.3
Playback device is default
Stream parameters are 48000Hz, S32_LE, 2 channels
Using 16 octaves of pink noise
ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
Playback open error: -2,No such file or directory
Offline