Forked-daapd


#1

i recently installed improved version for forked-daapd on my vero 2: http://ejurgensen.github.io/forked-daapd/

everything works fine but i cant’t figure out how to specify the local audio. in the forked-daapd.conf in the section “local audio output” i can set two parameters:

Local audio output

audio {
# Name - used in the speaker list in Remote
nickname = “Computer”
# Audio device name for local audio output
card = “default”
# Mixer channel to use for volume control - ALSA/Linux only
# If not set, PCM will be used if available, otherwise Master.
# mixer = “”
}

what values do i have to put there to get local audio working?

tried already:
card =“hw:0”
mixer=“pcm”

did not work … does anyone have a clue how to find out card and mixer?

cheers
bendsch


#2

Do you have keepalive disabled in Kodi audio settings ?

If not, Kodi will keep the audio device busy and other applications will not be able to use it. (At least not if you are only using Alsa)


#3

yes, its disabled


#4

I would install aplay then try playing a wav file with it.

aplay -L will list the available sinks that are available, for direct access to the hardware but with sample rate conversion if required you should use plughw not hw.

hw does not provide sample rate conversion so if you try to play something the hardware doesn’t directly support it won’t work. plughw will only resample if it has to but will always work.

Here is an example of me playing a test wav on a USB interface:

aplay -D plughw:U192k piano2.wav

You can specify the sound interface by name (found with aplay -L, U192k in my example) or by index, for example plughw:0


#5

FYI, you’ll find aplay in the alsa-utils package.

sudo apt-get install alsa-utils

#6

hmm … seems like alsa does not recognize my soundcard

osmc@B2VERO:~$ aplay -vv ./test.wav
ALSA lib pcm_direct.c:940:(snd1_pcm_direct_initialize_slave) slave plugin does not support mmap interleaved or mmap noninterleaved access
ALSA lib pcm_dmix.c:1064:(snd_pcm_dmix_open) unable to initialize slave

wich of the following devices is the normal analog output:

aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
default:CARD=AMLM8AUDIO
AML-M8AUDIO,
Default Audio Device
sysdefault:CARD=AMLM8AUDIO
AML-M8AUDIO,
Default Audio Device
front:CARD=AMLM8AUDIO,DEV=0
AML-M8AUDIO,
Front speakers
iec958:CARD=AMLM8AUDIO,DEV=0
AML-M8AUDIO,
IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=AMLM8AUDIO,DEV=0
AML-M8AUDIO,
Direct sample mixing device
dmix:CARD=AMLM8AUDIO,DEV=1
AML-M8AUDIO,
Direct sample mixing device
dsnoop:CARD=AMLM8AUDIO,DEV=0
AML-M8AUDIO,
Direct sample snooping device
dsnoop:CARD=AMLM8AUDIO,DEV=1
AML-M8AUDIO,
Direct sample snooping device
hw:CARD=AMLM8AUDIO,DEV=0
AML-M8AUDIO,
Direct hardware device without any conversions
hw:CARD=AMLM8AUDIO,DEV=1
AML-M8AUDIO,
Direct hardware device without any conversions
plughw:CARD=AMLM8AUDIO,DEV=0
AML-M8AUDIO,
Hardware device with all software conversions
plughw:CARD=AMLM8AUDIO,DEV=1
AML-M8AUDIO,
Hardware device with all software conversions

i only mostly play flacs and some mp3s.


#7

What sound card ? You made no mention earlier of having an external sound card (USB) connected.

If you are just trying to play the audio through HDMI, use either plughw:0 or plughw:1. (Not sure off hand which one is correct)

You must specify the sound device with the -D option of aplay as I showed in my example.

So for example: aplay -vv -D plughw:0 ./test.wav


#8

i have no external soundcard. as mentioned i just want to know what the device for normal analog output ist (NOT hdmi).

UPDATE: just found the right device, its is indeed hw:0. however if i try to specify that in forked-daapd.conf in the line card =“hw:0” it does not seem to be working.

cheers bendsch


#9

Try just using default or sysdefault for the ALSA device.


#12

Tried, with the following configuration, but still not able to select the local audio device in the webinterface:

#Local audio output
audio {
# Name - used in the speaker list in Remote
nickname = “Computer”
# Type of the output (alsa, pulseaudio, dummy or disabled)
type = “alsa”
# For pulseaudio output, an optional server hostname or IP can be
# specified (e.g. “localhost”). If not set, connection is made via local
# socket.
#server = “”
# Audio PCM device name for local audio output - ALSA only
card = “default”
# Mixer channel to use for volume control - ALSA only
# If not set, PCM will be used if available, otherwise Master.
mixer = “aml audio i2s mute”
# Mixer device to use for volume control - ALSA only
# If not set, the value for “card” will be used.
#mixer_device = “”
# Synchronization
# If your local audio is out of sync with AirPlay, you can adjust this
# value. Positive values correspond to moving local audio ahead,
# negative correspond to delaying it. The unit is samples, where is
# 44100 = 1 second. The offset must be between -44100 and 44100.
#offset = 0
}

also tried with mixer=“Ext Speaker”, also does not work, any idea?

i followed the instrucitions here: https://github.com/ejurgensen/forked-daapd/issues/262


#13

You will find the preformatted text button </> better than quotes.

I will have to bow out as I don’t have a vero2 or use forked-daapd.


#14

Did you try plughw:0 as I suggested ?


#15

yes, also tried with the following configuration. does not work either …

#Local audio output
audio {
# Name - used in the speaker list in Remote
nickname = “Computer”
# Type of the output (alsa, pulseaudio, dummy or disabled)
type = “alsa”
# For pulseaudio output, an optional server hostname or IP can be
# specified (e.g. “localhost”). If not set, connection is made via local
# socket.
#server = “”
# Audio PCM device name for local audio output - ALSA only
card = “plughw:0”
# Mixer channel to use for volume control - ALSA only
# If not set, PCM will be used if available, otherwise Master.
mixer = “Ext Speaker”
# Mixer device to use for volume control - ALSA only
# If not set, the value for “card” will be used.
#mixer_device = “”
# Synchronization
# If your local audio is out of sync with AirPlay, you can adjust this
# value. Positive values correspond to moving local audio ahead,
# negative correspond to delaying it. The unit is samples, where is
# 44100 = 1 second. The offset must be between -44100 and 44100.
#offset = 0
}


#16

ok, i was able to solve this by doing the following:

create /etc/asound.conf with:

pcm.!default {
    type hw
    card 0
}

ctl.!default {
    type hw           
    card 0
}

the restart alsa.
i am able to select local output an play music to it.

now i am trying to set the main volume for alsa device permanently. but when i try:

amixer sset ‘Ext Spk’ 50
amixer: Invalid command!

i get this error. How do i specify a device with blank spaces in its name? The quotes seem to be the right ones …


#17

Try using a backslash:

amixer sset Ext\ Spk 50

#18

without quotes:

amixer sset Ext\ Spk 50
amixer: Invalid command!

with quotes:

amixer sset ‘Ext\ Spk’ 50
amixer: Unable to find simple control ‘Ext\ Spk’,0

amixer command gives me:

amixer
Simple mixer control ‘Ext Spk’,0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control ‘HDMI Audio Type’,0
Capabilities: enum
Items: ‘LPCM’ ‘NONE-LPCM’ ‘UN-KNOWN’
Item0: ‘UN-KNOWN’
Simple mixer control ‘SPDIFIN Audio Type’,0
Capabilities: enum
Items: ‘LPCM’ ‘NONE-LPCM’ ‘UN-KNOWN’
Item0: ‘LPCM’
Simple mixer control ‘aml audio i2s mute’,0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control ‘aml audio spdif mute’,0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]


#19

Looks like you need to specify the -D option. On Mint this works:

amixer -D pulse sset Master 50%

so try:

amixer -D alsa

to see what you can control.


#20

osmc@B2VERO:~$ amixer -D alsa sset ‘Ext\ Spk’ 50
ALSA lib control.c:1373:(snd_ctl_open_noupdate) Invalid CTL alsa
amixer: Mixer attach alsa error: No such file or directory
osmc@B2VERO:~$ amixer -D alsa sset Ext\ Spk 50
ALSA lib control.c:1373:(snd_ctl_open_noupdate) Invalid CTL alsa
amixer: Mixer attach alsa error: No such file or directory

still not working …


#21

On vero4k Ext Spk does nothing. What does alsamixer show you? Makes it easier to fiddle about.


#22