Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to configure forked-daapd on my computer, and everything goes well except that in configuration file I can not set a new value for the line corresponding to soundcard. This is the default code in the config file:

#card = "default"

I want to use a soundcard called "DG2", which is the soundcard no.1 and has a first device that ALSA recognizes as no.0. So, I change the line to the following:

card = "hw:DG2,0"

I restart the daapd service and the next time I play a file through iTune remote, I get a message in my server log file saying that it can not play the file because the device is busy. Any change in the device name will return a different error, saying that the device does not exist. I am pretty sure no other uses this external device, and I don't understand why I get this message. I have tried plughw as well, with the same result.

When running lsof, I get the following result:

mah@HomeServer:~$ lsof /dev/snd/*
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
pulseaudi 1579  mah   20u   CHR  116,3      0t0 9083 /dev/snd/controlC1
pulseaudi 1579  mah   26u   CHR 116,10      0t0 9542 /dev/snd/controlC0
pulseaudi 1579  mah   32u   CHR 116,10      0t0 9542 /dev/snd/controlC0

Let me add one last detail. This soundcard is just a SPDIF-out USB dongle with very limited functionality (e.g. no volume control). Alsamixersays it only has a PCM channel (which would be the device number 0).

share|improve this question
    
The controlC* devices are harmless. Does aplay -D hw:DG2 something.wav work? –  CL. Nov 21 '12 at 13:02
    
Yes, it does. No issues at all. –  Mah Nov 21 '12 at 13:13
    
It works for all the following as well: hw:DG2,0, hw:1, hw:1,0. Also for the plughws. –  Mah Nov 21 '12 at 13:21
    
Then there must be some other program when forked-daapd is running. –  CL. Nov 21 '12 at 13:50
    
Well, that is the point: really, no other program. Right when I receive an error from daapd, shairport can still successfully open the device. –  Mah Nov 22 '12 at 13:20
show 3 more comments

1 Answer 1

The default device automatically uses a plugin that can mix multiple streams together.

Try using default:DG2 (but this will not work if the other program does not also go through default).

Run lsof /dev/snd/* to see which programs are accessing sound devices.

share|improve this answer
    
Thanks for your response! I added details to the question. Does this mean that pulseaudiois reserving the device to itself and any other software has to pass through it to get access to the device? But isn't forked-daapd doing so? Shouldn't pulseaudio block the other applications from accessing the device as well? I open hw:0,1 with no issues on shairport. Actually, I don't want two programs to access the card, and prefer to give exclusive access to forked-daapd. Is there any way to do so? –  Mah Nov 21 '12 at 12:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.