Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Problem: Issue with sound card that have multiple device
#1
Hi,

I have install moode-r760 on a RPi3 and use it with the Asus Xonar U7 MKII. It have analog and spdif out which I want to use the spdif to output the sound to a Sony PHA3. On aplay -l the card appear like this

Quote:card 2: MKII [Xonar U7 MKII], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: MKII [Xonar U7 MKII], device 1: USB Audio [USB Audio #1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: MKII [Xonar U7 MKII], device 2: USB Audio [USB Audio #2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
The SPDIF port is on device 1. I tried to change the output in web GUI but they do not have the option to choose the device, only allow to change the card. I tried to looking for a solution and come up with some post mentioned that changing /etc/alsa/conf.d/_audioout.conf will allow to change the output device so I manually changed it to


Quote:pcm._audioout {
type copy
slave.pcm "plughw:2,1"
}
and


Quote:pcm._audioout {
type copy
slave.pcm "hw:2,1"
}
but MPD and spotify still output on the old device.
After a while i figured that by changing /www/inc/playerlib.php in the below place

Quote:sysCmd("sed -i '/slave.pcm/c\slave.pcm \"" . $output_mode . ':' . $cardnum . ",0\"' " . ALSA_PLUGIN_PATH . '/_audioout.conf');
sysCmd("sed -i '/a { channels 2 pcm/c\a { channels 2 pcm \"" . $output_mode . ':' . $cardnum . ",0\" }' " . ALSA_PLUGIN_PATH . '/_sndaloop.conf');
and swap ",0\" to ",1\" and then using the web GUI to change the sound card I can output the sound to the spdif port. and when I took a look at the _audioout.conf file it changed to the same value that I manually inputted before
Quote:pcm._audioout {
type copy
slave.pcm "plughw:2,1"
}

So my question is what happened? Why manually changed the /etc/alsa/conf.d/_audioout.conf did not changed the output of the sound card? And if possible please add the ability to choose the device to your wonderful program in some future release.
Thank.
Reply
#2
You need to restart MPD after changing ALSA conf.
sudo systemctl restart mpd

If there is more demand for cards like the Xonar device I could add to the TODO list but at minimum I'd need a sample device for testing.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
(12-11-2021, 09:21 PM)Tim Curtis Wrote: You need to restart MPD after changing ALSA conf.
sudo systemctl restart mpd

If there is more demand for cards like the Xonar device I could add to the TODO list but at minimum I'd need a sample device for testing.

Sorry I forgot to mention it in the previous post but after I changed the _audioout.conf I did restart MPD using "systemctl restart mpd" I also try reboot the pi .

Quote:audio_output { type "alsa"
name "ALSA Default"
device "_audioout"
...}
If I change the mpd.conf file and replace "_audioout" with "hw2:1" I can change the output of MPD after restart the service or reboot but spotify remain the same( they are different service after all).
Reply


Forum Jump: