mati
Posts: 7
Joined: Fri Sep 06, 2013 8:47 am

Sabre USB DAC SA9023 problem

Fri Sep 06, 2013 4:33 pm

Hi all,

firstly, apologies for posting here if this is not the right place.

Recently I bought a HifiMeDie Sabre Dac (the one from http://hifimediy.com/index.php?route=pr ... duct_id=83) to improve my aural experience. So far I have been using onboard analog audio (3,5mm). Yesterday I plugged it into my rpi.

It was discovered instantly and listed as device 1,0 and 1,1. I am not sure why it appears twice.

root@squeezeplug:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 1: Audio [SA9023 USB Audio], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Audio [SA9023 USB Audio], device 1: USB Audio [USB Audio #1]
Subdevices: 1/1
Subdevice #0: subdevice #0
root@squeezeplug:~#

aplay -L

root@squeezeplug:~# aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
pulse
PulseAudio Sound Server
sysdefault:CARD=ALSA
bcm2835 ALSA, bcm2835 ALSA
Default Audio Device
sysdefault:CARD=Audio
SA9023 USB Audio, USB Audio
Default Audio Device
front:CARD=Audio,DEV=0
SA9023 USB Audio, USB Audio
Front speakers
surround40:CARD=Audio,DEV=0
SA9023 USB Audio, USB Audio
4.0 Surround output to Front and Rear speakers
surround41:CARD=Audio,DEV=0
SA9023 USB Audio, USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Audio,DEV=0
SA9023 USB Audio, USB Audio
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Audio,DEV=0
SA9023 USB Audio, USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Audio,DEV=0
SA9023 USB Audio, USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Audio,DEV=0
SA9023 USB Audio, USB Audio
IEC958 (S/PDIF) Digital Audio Output


I tried playing test wav on on with aplay -Dhw:1,0 but it does not work. alsa ends with an error (no channel count). However specifying channel with -c 2 also does not help

root@squeezeplug:~# aplay -D hw:1 /usr/share/sounds/alsa/Front_Center.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
aplay: set_params:1087: Channels count non available
root@squeezeplug:~#

Alsamixer sees the card, I can select it with F6 and change volume.

I also tried playing with plughw. First time it does not give error, but also no sound but the second time I get this:

root@squeezeplug:~# aplay -D plughw:1 /usr/share/sounds/alsa/Front_Center.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
root@squeezeplug:~# aplay -D plughw:1 /usr/share/sounds/alsa/Front_Center.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
aplay: set_params:1145: Unable to install hw params:
ACCESS: RW_INTERLEAVED
FORMAT: S16_LE
SUBFORMAT: STD
SAMPLE_BITS: 16
FRAME_BITS: 16
CHANNELS: 1
RATE: 48000
PERIOD_TIME: 125000
PERIOD_SIZE: 6000
PERIOD_BYTES: 12000
PERIODS: 4
BUFFER_TIME: 500000
BUFFER_SIZE: 24000
BUFFER_BYTES: 48000
TICK_TIME: 0
root@squeezeplug:~#

lsusb output:
root@squeezeplug:~# lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 262a:10e0
Bus 001 Device 005: ID 1058:1042 Western Digital Technologies, Inc.

root@squeezeplug:~# lsusb -t
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
|__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/3p, 480M
|__ Port 1: Dev 3, If 0, Class=vend., Driver=smsc95xx, 480M
|__ Port 2: Dev 4, If 0, Class=HID, Driver=usbhid, 12M
|__ Port 2: Dev 4, If 1, Class=audio, Driver=snd-usb-audio, 12M
|__ Port 2: Dev 4, If 2, Class=audio, Driver=snd-usb-audio, 12M
|__ Port 2: Dev 4, If 3, Class=audio, Driver=snd-usb-audio, 12M
|__ Port 3: Dev 5, If 0, Class=stor., Driver=usb-storage, 480M

asound.conf - changing that to card 1 ends up in no sound at all (not surprisingly)

pcm.!default {
type hw
card 0
}

ctl.!default {
type hw
card 0
}


I also tried limiting usb speed to 1.1 in cmdline.txt, Did not help.

Any way to improve this situation? I am not a huge linux expert. I've tried everything I could find. Is this some problem with alsa or the usb card?

Edit: DAC works on windows and debian without any problems - checked today. So the culprit must be somewhere in RPi

jepperc
Posts: 6
Joined: Mon Sep 09, 2013 3:25 pm

Re: Sabre USB DAC SA9023 problem

Mon Sep 09, 2013 3:27 pm

I have exactly the same issue.. no one have any clues?

msewing
Posts: 2
Joined: Thu Apr 25, 2013 3:49 pm

Re: Sabre USB DAC SA9023 problem

Tue Sep 10, 2013 5:20 pm

I see the same kind of thing using a Creative Soundblaster SB1240. Alsamixer sees everything. My Python program works for stereo capture on other platforms, but on the RPi, the soundcard (card 0, device 1) cannot be accessed. It appears that the RPi ALSA is not configured to pick up multiple devices (device > 0) correctly. Other sound cards work fine with card 0, device 0.

It's probably something simple if you're an ALSA expert. Could use some help!

Martin

jepperc
Posts: 6
Joined: Mon Sep 09, 2013 3:25 pm

Re: Sabre USB DAC SA9023 problem

Mon Sep 23, 2013 10:53 am

I got mine to work in raspbian, just using the newest updates. Sounds a lot better than the integrated :)

Can't make it work in xbian nor pi-musicbox though.

mati
Posts: 7
Joined: Fri Sep 06, 2013 8:47 am

Re: Sabre USB DAC SA9023 problem

Mon Sep 23, 2013 11:16 am

Did you have problems before you installed the newest updates?

msewing
Posts: 2
Joined: Thu Apr 25, 2013 3:49 pm

Re: Sabre USB DAC SA9023 problem

Mon Sep 23, 2013 12:19 pm

Seems to be OK for me now with newer system. Thanks!

mati
Posts: 7
Joined: Fri Sep 06, 2013 8:47 am

Re: Sabre USB DAC SA9023 problem

Mon Sep 23, 2013 3:50 pm

No luck for me. It still does not work. No difference with the newest updates (20 Sep).

When I try to speaker-test
root@squeezeplug:~# speaker-test -D hw:1,0 -c2

speaker-test 1.0.25

Playback device is hw:1,0
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 96 to 262144
Period size range from 48 to 131072
Using max buffer size 262144
Periods = 4
Unable to set hw params for playback: Input/output error
Setting of hwparams failed: Input/output error

dmesg gives this:

[ 147.921096] bcm2835_audio_close:744 bcm2835_audio_close: failed on waiting for event (status=0)
[ 154.432553] bcm2835_audio_close:744 bcm2835_audio_close: failed on waiting for event (status=0)<3>[ 154.432730] vc_vchi_audio_deinit:331 vc_vchi_audio_deinit: failed to close VCHI service connection (status=1)
[ 203.641971] 4:3:1: usb_set_interface failed (-32)
[ 584.955779] 4:3:1: usb_set_interface failed (-32)
[ 1114.697993] 4:3:1: usb_set_interface failed (-32)

I guess usb_set_interface failed is the reason.

Any ideas?

mati
Posts: 7
Joined: Fri Sep 06, 2013 8:47 am

Re: Sabre USB DAC SA9023 problem

Sat Sep 28, 2013 8:35 am

any ideas?

jepperc
Posts: 6
Joined: Mon Sep 09, 2013 3:25 pm

Re: Sabre USB DAC SA9023 problem

Mon Sep 30, 2013 2:06 pm

I set usb sound as index 0, in the alsa-config.
Furthermore i only use the analog part.

mati
Posts: 7
Joined: Fri Sep 06, 2013 8:47 am

Re: Sabre USB DAC SA9023 problem

Mon Sep 30, 2013 4:00 pm

I tried this. Also disabled bcm module so onboard audio would be completely off. Neither brought improvement.

exiton
Posts: 1
Joined: Wed Oct 16, 2013 1:03 am

Re: Sabre USB DAC SA9023 problem

Wed Oct 16, 2013 1:12 am

I'm having the same problem with the SA9027, which is the asynchronous brother of the SA9023. Specifically I'm using soundtest and getting the same errors:

Unable to set hw params for playback: Input/output error
Setting of hwparams failed: Input/output error


The DAC in question is the Stoner Acoustics UD110. It produces this error in both Rasbian and Raspyfi. It works in Ubuntu and in Windows with no issues. Any help would be greatly appreciated.

StephenR
Posts: 19
Joined: Thu Aug 23, 2012 7:09 pm

Re: Sabre USB DAC SA9023 problem

Wed Oct 16, 2013 7:40 am

I never solved the SA9023 problem and have given up. There are plenty of other options out there that do work so when I have another go, will use one of them. I use a cheap USB card for now http://www.amazon.co.uk/gp/product/B003 ... UTF8&psc=1.

cheers,

Stephen

muc89
Posts: 3
Joined: Tue Oct 22, 2013 7:48 am

Good sound needs power

Tue Oct 22, 2013 8:11 am

Problem seems to be solved:

Use a USB hub between USB DAC SA9023 and Raspberry Pi.

To be on the safe side, this should be an active USB hub providing independed power to the DAC.

If you are familiar with USB hubs, this hub inbetween can also be a simple passive USB hub.

Well, good sound needs a little bit of power.

And then you'll get a S/PDIF optical out with it for free.
Last edited by muc89 on Wed Oct 23, 2013 7:12 am, edited 1 time in total.

jepperc
Posts: 6
Joined: Mon Sep 09, 2013 3:25 pm

Re: Sabre USB DAC SA9023 problem

Tue Oct 22, 2013 4:55 pm

Mine stopped working again (have been moving for a couple of weeks, and the PI i was using dies.. now trying on a second PI).. cant seem to find a firmware where it consistently works. On some firmwares no sound comes out, and upon second play, gives the "unable to set hw params error".. on others sound comes out the first time, and then silence from there... this is crap :(

muc89
Posts: 3
Joined: Tue Oct 22, 2013 7:48 am

Re: Sabre USB DAC SA9023 problem

Tue Oct 22, 2013 5:52 pm

I have seen second play problem on some other DACs before, too :=(

But with the latest RaspyFi1.0.img it did not show up any more - at least not with the SA9023 based DAC on the USB behind a hub.

And to be on the safe side: better use an active USB hub.

Then you have total detachment between the rpi and the DAC.
Last edited by muc89 on Wed Oct 23, 2013 7:00 am, edited 1 time in total.

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2127
Joined: Thu Jul 11, 2013 2:37 pm

Re: Sabre USB DAC SA9023 problem

Tue Oct 22, 2013 7:18 pm

Where can I buy one of these?
Rockets are loud.
https://astro-pi.org

muc89
Posts: 3
Joined: Tue Oct 22, 2013 7:48 am

Re: Sabre USB DAC SA9023 problem

Tue Oct 22, 2013 7:30 pm

Globally, you can buy it on the HiFimeDIY Website: http://www.hifimediy.com

If you don't like to pay the customs from china or if you don't want to wait for the shipping, you will also find this device on ebay or amazon in some countries.

Just search for "usb dac sabre es9023".

In Germany, you can also find it on a local webshop here: http://www.muc89.com
There is also an async variant with even lower jitter from USB available.

It should be noted, that many ALSA based implementations have their trouble with *all* DACs (occational drop-outs or crackle).
Better results have been achieved with Raspian and PulseAudio.

chadian
Posts: 3
Joined: Sun Dec 30, 2012 9:08 pm

Re: Sabre USB DAC SA9023 problem

Thu Feb 06, 2014 5:57 am

I wanted to post here because in all of my research for this Sabre SA9023 DAC problem this post kept coming up in my search results. This USB DAC does work with the raspberry pi, but I only was able to work by re-flashing my card _from_ raspbian _to_ raspyfi.

I want to get the normal raspbian distro working but as of yet I haven't been able to get it to work. I tried all the different asla configurations, setting the default on boot, etc, no luck. The "broken pipe" message was all I got, even though I could see it listed. My guess in the difference between the two distro (since rapsyfi is a stripped down version of raspbian) is this USB audio fix. I believe applying the fix mentioned here to raspbian (as outlined at the bottom of the post) might fix the issues. I eventually want to test this.

Some other background information: I read other advice that mentioned that this DAC required a stable, dedicated power from a USB hub. The one I was originally using was listed as "poor" with backfeed problems, so I bought an approved one, and this didn't solve my problems either. With raspyfi it worked with plug and play out of the box, along with shairpoint configured out of the box.

At the end of the day, whatever configuration, drivers that varies between raspbian and raspyfi is the difference that makes in this DAC working.

Update: I also don't notice any crackles between playing/pausing etc when using raspyfi.

wk01
Posts: 1
Joined: Tue Nov 24, 2015 9:53 pm

Re: Sabre USB DAC SA9023 problem

Tue Nov 24, 2015 11:24 pm

Same experience, have seen this page regularly now. Therefore am posting my experiences here.
To cut a long story short: for analog output use the "front" device, not the "default" or "sysdefault" devices because they only operate at 48kHz/16bits.
I've got this setup: RaspberryPi model B with 512MB, powered USB hub, with a HifimeDIY U2 Dac connected to it. The U2 also has the SA9023 on board though it works in USB Asynchronous mode. OS image is Raspbian Wheezy. Music sources are MPD and Shairport.
First setup with this card was with PulseAudio, a setup that I was satisfied with using an older USB DAC (Edirol UA-1A) but it was a USB1.0 devices therefore slowed down all USB traffic. Therefore the U2 came in. It didn't work very well (occasional glitches). Major improvement after removing PulseAudio switching back to Alsa.
I've followed the recipe above to install that "USB audio fix" about a year ago on the Raspbian, and it worked. Currently I think this fix is in the regular Raspbian image.

Other configs:
  • Allow USB device as first Alsa device

    Code: Select all

    sudo nano /etc/modprobe.d/alsa-base.conf
    and replace "options snd-usb-audio index=-2" with "options snd-usb-audio index=0"
  • Disabled the internal audio device

    Code: Select all

    sudo nano /etc/modules
    comment-out the line that says "snd-bcm2835"
  • Relevant section from /boot/config.txt

    Code: Select all

    force_turbo=1
    arm_freq=900
    core_freq=375
    sdram_freq=500
    over_voltage=2
    gpu_mem=64
    Thus little GPU memory, suitable for terminal use.
  • Here's the /boot/cmdline.txt, but honestly I don't have a clue what is relevant here...

    Code: Select all

    dwc_otg.fiq_enable=1 dwc_otg.fiq_fsm_enable=1 dwc_otg.fiq_fsm_mask=0x3 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
    
With aplay -L I get that same list of devices listed in the first post.

The essential part now is that I found out that the default and sysdefault devices only run 48kHz/16bits. You can check the actual mode of operation by inspecting /proc/asound/card0/pcm0p/sub0/hw_params

Now run a test signal to your USB DAC on the "default" device, and see what it does.

Code: Select all

speaker-test -r 44100 -c2
While speaker test runs, check what it does in another terminal:

Code: Select all

more /proc/asound/card0/pcm0p/sub0/hw_params
This gives me:
access: MMAP_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 48000 (48000/1)
period_size: 1024
buffer_size: 16384

So I ask the thing to do 44.1kHz but it actually runs at 48kHz. Now test sending the same signal to the "front" device:

Code: Select all

speaker-test -Dfront -r 44100 -c2
This gets me a different mode of operation where it does use the requested sample rate and bit depth:
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 65536
buffer_size: 262144
The "front" device also follows other sample rates and bit depths.

MPD works perfectly if you tell it to use the "front" device, in the mpd.conf file (/etc/mpd.conf or ~/.mpd/mpd.conf depending how you start MPD) look for the Alsa output:

Code: Select all

audio_output {
        type            "alsa"
        name            "alsa@rpi"
        device          "front"
}
and for Shairport check /etc/default/shairport

Code: Select all

OUTPUT=alsa
OUTPUT_OPTS='-d front'
I suppose you could also tell Alsa to use "front" as the default device. Maybe PulseAudio also works with it, have not tried that. My setup works for 44k1/48k and 16/24 bits, consistently, no cracks or glitches, for about a year now.

Return to “Troubleshooting”