Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help with configuring asound.conf and shairport-sync.conf #1339

Closed
rtmurphy opened this issue Nov 17, 2021 · 5 comments
Closed

Help with configuring asound.conf and shairport-sync.conf #1339

rtmurphy opened this issue Nov 17, 2021 · 5 comments

Comments

@rtmurphy
Copy link

rtmurphy commented Nov 17, 2021

Hello: I have tried for a few hours to get shairport-sync to work with my external amp (sabaj). It works fine with the pi's headphone jack. Can you please tell me what should be in the asound.conf file and output_device = line should be in the shairport-sync.conf file. Thank you.

Here is the output from aplayer, etc:

root@installpi:~# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
sabaj
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=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
hw:CARD=AMP,DEV=0
    Sabaj A3 AMP, USB Audio
    Direct hardware device without any conversions
plughw:CARD=AMP,DEV=0
    Sabaj A3 AMP, USB Audio
    Hardware device with all software conversions
default:CARD=AMP
    Sabaj A3 AMP, USB Audio
    Default Audio Device
sysdefault:CARD=AMP
    Sabaj A3 AMP, USB Audio
    Default Audio Device
front:CARD=AMP,DEV=0
    Sabaj A3 AMP, USB Audio
    Front output / input
surround21:CARD=AMP,DEV=0
    Sabaj A3 AMP, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=AMP,DEV=0
    Sabaj A3 AMP, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=AMP,DEV=0
    Sabaj A3 AMP, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=AMP,DEV=0
    Sabaj A3 AMP, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=AMP,DEV=0
    Sabaj A3 AMP, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=AMP,DEV=0
    Sabaj A3 AMP, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=AMP,DEV=0
    Sabaj A3 AMP, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=AMP,DEV=0
    Sabaj A3 AMP, USB Audio
    Direct sample mixing device
hw:CARD=vc4hdmi,DEV=0
    vc4-hdmi, MAI PCM i2s-hifi-0
    Direct hardware device without any conversions
plughw:CARD=vc4hdmi,DEV=0
    vc4-hdmi, MAI PCM i2s-hifi-0
    Hardware device with all software conversions
default:CARD=vc4hdmi
    vc4-hdmi, MAI PCM i2s-hifi-0
    Default Audio Device
sysdefault:CARD=vc4hdmi
    vc4-hdmi, MAI PCM i2s-hifi-0
    Default Audio Device
hdmi:CARD=vc4hdmi,DEV=0
    vc4-hdmi, MAI PCM i2s-hifi-0
    HDMI Audio Output
dmix:CARD=vc4hdmi,DEV=0
    vc4-hdmi, MAI PCM i2s-hifi-0
    Direct sample mixing device
root@installpi:~#


===============================================================================

root@installpi:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
  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: AMP [Sabaj A3 AMP], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 2: vc4hdmi [vc4-hdmi], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
root@installpi:~#


=========================================================================
root@installpi:~# ls -l /proc/asound
total 0
lrwxrwxrwx 1 root root 5 Nov 17 15:29 AMP -> card1
dr-xr-xr-x 4 root root 0 Nov 17 15:29 card0
dr-xr-xr-x 8 root root 0 Nov 17 15:29 card1
dr-xr-xr-x 4 root root 0 Nov 17 15:29 card2
-r--r--r-- 1 root root 0 Nov 17 15:29 cards
-r--r--r-- 1 root root 0 Nov 17 15:29 devices
lrwxrwxrwx 1 root root 5 Nov 17 15:29 Headphones -> card0
-r--r--r-- 1 root root 0 Nov 17 15:29 hwdep
-r--r--r-- 1 root root 0 Nov 17 15:29 modules
dr-xr-xr-x 4 root root 0 Nov 17 15:29 oss
-r--r--r-- 1 root root 0 Nov 17 15:29 pcm
dr-xr-xr-x 3 root root 0 Nov 17 15:29 seq
-r--r--r-- 1 root root 0 Nov 17 15:29 timers
lrwxrwxrwx 1 root root 5 Nov 17 15:29 vc4hdmi -> card2
-r--r--r-- 1 root root 0 Nov 17 15:29 version
@mikebrady
Copy link
Owner

Thanks for the post. Actually Shairport Sync doesn't use the asound.conf stuff -- that's an alsa configuration file.

Ideally, if possible, you should use an alsa hardware device directly. Those are indicated by having hw: at the start of their names. So, from aplay -L you can see:
hw:CARD=Headphones,DEV=0,
hw:CARD=AMP,DEV=0 and
hw:CARD=vc4hdmi,DEV=0.

They also have shorter names based on the card number. Thus, from aplay -l you have
hw:0, hw:1 and hw:2.

By inspection, you can match up the long names with the short names.

Thus, to output to the Sabaj A3, it looks like the output_device setting should be:

output_device="hw:CARD=AMP,DEV=0";

or

output_device="hw:1";

Now there may be a problem with this. Shairport Sync requires that the output device must be capable of accepting audio at 44,100 frames per second (CD quality) and this Sabaj A3 may not do so -- the specification is unclear on this. If it does not accept 44,100 FPS, Shairport Sync will terminate and leave a message in the logs. In that case, you can try using:

output_device="plughw:CARD=AMP,DEV=0";

or

output_device="plughw:1";

These are "virtual" alsa devices that pass audio through rate converters (and maybe other components) before sending the resulting data to the respective hardware devices. If they are your only option, so be it, but if they can be avoided, so much the better.

I hope this helps.

@rtmurphy
Copy link
Author

rtmurphy commented Nov 18, 2021 via email

@mikebrady
Copy link
Owner

Thanks for the update. With all these, it’s important to check the volume on the output device and to ensure that it is not muted. You can do both by checking the device with alsamixer.

@rtmurphy
Copy link
Author

rtmurphy commented Nov 18, 2021 via email

@github-actions
Copy link

This issue has been inactive for 45 days so will be closed 7 days from now. To prevent this, please remove the "stale" label or post a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants