Closed suiluj closed 8 years ago
I think the best approach would be to keep the setting, and then set the usb card as the default? I am, however, not sure how you do that. Maybe @LordMyschkin can give some advice on this?
well, I went throught various steps to achieve exactly that. I am not really sure about what exactly changed my usb-soundcard to default; my root/.asoundrc consists of the following lines: pcm.!default { type hw card 1 }
ctl.!default { type hw card 1 }
But I do think the relevant step was just to change the default soundcard in alsamixer.
I had some success in using the output of aplay -L (like "surround51:CARD=CODEC,DEV=0") as device instead of "default" in card = "default" - like card = "surround51:CARD=CODEC,DEV=0" but I did not try out all my outputs because switching the default output was much easier.
Take care that most online recipes on how to manipulate alsa outputs are for Debian Wheezy and not for the current Debian Jessie. I described most of my steps in https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=49928&sid=225d311b22287a3498cd6c5650952d51&start=925
Good luck!
I am running with the user root and created a file .asoundrc
in the folder /root
(which is home for the root user.
But then forked-daapd crashes if i press on a song to play it. I don't know why. Any idea?
What does the log say? (see the end of /var/log/forked-daapd.log)
In my .asoundrc
is the following configuration for my root user:
GNU nano 2.2.6 Datei: /root/.asoundrc
pcm.!default {
type hw
card 1
}
ctl.!default {
type hw
card 1
}
(When using card 0
the standard raspberrypi audio jack is used, so i changed to card 1
.)
I tried twice to use the local output:
First time I already listened music via my shairport-sync server (which runs on my raspberrypi, too). I activated my local output audio while using airplay and got the following log errors
...
[2016-05-25 17:02:35] [ LOG] scan: Bulk library scan completed in 31 sec
[2016-05-25 17:02:35] [ LOG] spotify: Can't login! - could not find libspotify
[2016-05-25 17:03:22] [ LOG] laudio: open '/dev/snd/pcmC1D0p' failed (-16)[2016-05-25 17:03:22] [ LOG] laudio: Could not open playback device: Das Gerät oder die Ressource ist belegt
[2016-05-25 17:03:22] [ LOG] player: Could not start ALSA device 'Lokal Pi'
[2016-05-25 17:03:22] [ LOG] player: Could not activate ALSA device 'Lokal Pi'
[2016-05-25 17:03:22] [ LOG] dacp: Speakers de/activation failed!
[2016-05-25 17:03:32] [ LOG] main: Forked Media Server Version 24.1 taking off
...
Das Gerät oder die Ressource ist belegt
means something like The device is in use
.
So the second time I first deactivated airplay output and then activated my localoutput:
...
[2016-05-25 17:04:02] [ LOG] spotify: Can't login! - could not find libspotify
[2016-05-25 17:05:33] [ LOG] laudio: Failed to open PCM or Master mixer element
[2016-05-25 17:05:33] [ LOG] laudio: Could not open mixer
[2016-05-25 17:05:33] [ LOG] player: Could not start ALSA device 'Lokal Pi'
[2016-05-25 17:05:33] [ LOG] player: Could not activate ALSA device 'Lokal Pi'
[2016-05-25 17:05:33] [ LOG] dacp: Speakers de/activation failed!
...
Why is it failing? I thought the root user just can do everything. I even added the root user to the audio usergroup but I don't know if this is important.
Thank you for your help :)
Ah I found the solution :)
I had to set the mixer (explained here).
In the local audio part of the forked-daapd.conf file:
# Mixer channel to use for volume control - ALSA/Linux only
# If not set, PCM will be used if available, otherwise Master.
mixer = "Speaker"
So this issue can be closed :) Thanks for the hint with the log file, I only viewd the status of the systemd process before
@suiluj do you need to disable airplay? I have same issue airplay and forked-daapd using same card 1 and log file error device in use I try to use dmix, but I don't know how to set mixer parameter in configuration I follow output from "amixer --card 1" but still cannot open mixer Anybody can help?
@dony71 sorry i don't know more than the step which I described above
I try to use my usb soundcard as my local output source. Which string do i have to put for
card="default"
in the config file?I use a Raspberry Pi 3 and get the following
aplay -l
output:I want to use my C-Media USB Audio Device.
card=hw:1
did not work. At the moment it automatically uses my shairport-sync airplay server which is also on my pi. So i get sound through "local" airplay. But i just want to use local output.Thank you for your help. Regards Julius