How I can turning DAC on/off without rebooting Volumio

Hi, just dipping my toes in the wonderful world of Volumio. Here’s my setup:

Compulab Utilite with Volumio -> Yulong Sabre DA8 DAC -> Synthesis Shine tube amplifier -> ProAc D25

Volumio loaded beautifully on Utilite. The webUI is fast and flows well. Music quality is much better than my original setup (streaming from NAS to a Sonos box). Hats off to the Volumio team.

The challenge I encountered so far is that if I power off the Yulong DAC and power it back on, Volumio doesn’t recognize it. I have to reboot the whole system in order for the “DAC” option to re-appear in the Audio Output dropdown menu under Menu -> Playback setting. Is there a way I can let the Volumio recognize the Yulong DAC without rebooting?

I apologize if the question has been asked before. I did a quick search on “usb dac reboot” but the forum software told me the terms are too common.

Thanks,

in another thread Michelangelo had mentioned

shift + f5 to another user on the mpd page in the ui. I think that is a refresh, but it should pick it up with a power off - on situation (is that a usb dac?) if so it would just be like hot plugging a usb device. if so you could look into if there was somewhere to enable hot plugging usb serach.

One other thing you can try is to open putty (ssh session) and run sudo tail -f /var/log/dmesg or /var/log/syslog and then power the dac off and on and see if it picked up in dmesg that may give us some insight to the issue at hand. ps not sure if you need sudo on a tail command.

rgds,

Dave

Dave,

Thanks for the help. I tried your suggestions. Here are the procedures and the results.

When music was playing, I turned off the USB DAC and turned it back on. Music didn’t resume. I went to the System setting and restarted MPD. Music didn’t resume. I also noticed the playback seem to have stopped, i.e., on the playback page, the clock stopped running despite I clicking play or pause.

I took a log at this point:
ieee80211 phy0: info: ignoring the timeout value for IEEE power save
ieee80211 phy0: info: ignoring the timeout value for IEEE power save
ieee80211 phy0: info: received scan request on wlan0
mwifiex_sdio mmc0:0001:1: info: mwifiex_cfg80211_results: sending scan results
ieee80211 phy0: info: Trying to associate to SSID\x1a and bssid MAC ADDRESS
ieee80211 phy0: info: setting band 11, channel offset 0 and mode 2
mwifiex_sdio mmc0:0001:1: info: trying to associate to SSID and bssid MAC ADDRESS
mwifiex_sdio mmc0:0001:1: info: associated to bssid MAC ADDRESS successfully
eth0: Freescale FEC PHY driver [Generic PHY] (mii_bus:phy_addr=1:00, irq=-1)
Installing knfsd (copyright © 1996 okir@monad.swb.de).

I then rebooted the device and everything came back normal. Took another log. The information is identical to the one posted above.

I then turned off the USB DAC and took another log. The log is still identical.

At this point, I can report that that powering down the USB DAC somehow stopped the playback. I found the other thread you mentioned and seems that our problems may be due to the same source.

A Linux newbie question: Is there a way to view more detailed log? Will be interesting to see what happened when the USB device is powered off.

Thanks again

Is that the syslog or dmesg. all that is talking about is your wifi connection by the look of it. you should not have to be playing music. When you shut of the dac and pwr it back on there should be some mention of it in dmesg. Try and tail dmesg in putty as I suggested and then unplug the usb cable from the dac and plug it back in and see if that is seen in dmesg.

I did google dac power off Linux and there a quite a few thread out there.

rgds,

Dave

Thanks again for the help. Will search for DAC reboot under Linux. The message I posted was from dmesg as you suggested. In my /var/log folder there’s no syslog.

I am experiencing the same behavior/situation.

If I power-off (I don’t really disconnect it by cable) my DAC (Rotel RA-1570 integrated amp+DAC), volumio never picks it up again.

I tried going to the Playback page and refreshing, also saving settings (which seems to kick MPD to a restart) - but then it all goes wrong as well. The toast message about MPD restarting comes up, then my web interface disconnects - it goes black, and animated “Connecting” icon appears. It never comes back.

I have to SSH into device and do a reboot. Sometimes I’m not sure this is evening happening and I wait a couple minutes to make sure it’s hung, or trying super hard to reboot - but basically no Pi activity. Then I unplug USB power and restart entire device.

volumio comes up successfully after this.

I don’t have any logs ATM, but when I get a few minutes I can take log snaps while doing this process.

Here’s my reproduction scenario:

  • I paused my music.

  • I powered off my DAC. [I left volumio web interface on]

  • I powered the DAC back on.

  • I went to “Playback” page and ensured my “USBDAC” was selected and hit “Save Changes”. It gave me toast that MPD daemon was restarting.

  • I waited.

  • Now volumio web interface is not responding (browser can’t get to volumio), but I can SSH in.

  • Here is DMESG output:
    [ 130.915593] bcm2835-cpufreq: switching to governor performance
    [ 130.924312] bcm2835-cpufreq: switching to governor performance
    [ 1994.367108] smsc95xx 1-1.1:1.0 eth0: unexpected urb length 0
    [ 2149.620194] smsc95xx 1-1.1:1.0 eth0: unexpected urb length 0
    [19092.610050] smsc95xx 1-1.1:1.0 eth0: unexpected urb length 0
    [20872.155808] smsc95xx 1-1.1:1.0 eth0: unexpected urb length 0
    [24214.488349] usb 1-1.3: USB disconnect, device number 5
    [24214.811525] usb 1-1.3: new full-speed USB device number 6 using dwc_otg
    [24214.981539] usb 1-1.3: new high-speed USB device number 7 using dwc_otg
    [24221.381171] usb 1-1.3: new high-speed USB device number 8 using dwc_otg
    [24221.500239] usb 1-1.3: New USB device found, idVendor=278b, idProduct=3001
    [24221.510001] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [24221.519574] usb 1-1.3: Product: Rotel PC-USB
    [24221.526225] usb 1-1.3: Manufacturer: ROTEL
    [24221.559203] input: ROTEL Rotel PC-USB as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.2/input/input1
    [24221.574010] hid-generic 0003:278B:3001.0002: input,hidraw0: USB HID v1.00 Device [ROTEL Rotel PC-USB] on usb-bcm2708_usb-1.3/input2
    [24221.913345] usb 1-1.3: USB disconnect, device number 8
    [24222.241030] usb 1-1.3: new high-speed USB device number 9 using dwc_otg
    [24222.369987] usb 1-1.3: New USB device found, idVendor=278b, idProduct=3001
    [24222.379101] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [24222.388864] usb 1-1.3: Product: Rotel PC-USB
    [24222.395432] usb 1-1.3: Manufacturer: ROTEL
    [24222.428437] input: ROTEL Rotel PC-USB as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.2/input/input2
    [24222.443093] hid-generic 0003:278B:3001.0003: input,hidraw0: USB HID v1.00 Device [ROTEL Rotel PC-USB] on usb-bcm2708_usb-1.3/input2

  • I type “mpc” without parameters, it responds:
    “error: Connection refused”

  • I type /etc/init.d/mpd restart, it responds:
    Stopping Music Player Daemon: mpd.
    Starting Music Player Daemon: mpdlisten: bind to ‘0.0.0.0:6600’ failed: Address already in use (continuing anyway, because binding to ‘[::]:6600’ succeeded).

  • I then type “mpc” without parameters (mpc help says this shows status), it just sits there, not returning me to a prompt (nor displaying anything). I hit CTRL-C.

  • I then type /etc/init.d/mpd stop, it responds:
    Stopping Music Player Daemon: mpd.

  • I notice that my waiting Chrome browser trying to load volumio web interface now suddenly appears as soon as mpd stops.

  • Perhaps, coincidence, as I try to visit pages in app and none respond. (I tried Menu… System… as I want to restart MPD via web interface…)

  • Back at cmd line I will try restarting mpd manually, it responds:
    root@volumio:~# /etc/init.d/mpd start
    Starting Music Player Daemon: mpdlisten: bind to ‘0.0.0.0:6600’ failed: Address already in use (continuing anyway, because binding to ‘[::]:6600’ succeeded)
    .

  • Why does it say this? MPD was supposedly stopped?

  • Initially, web UI is unresponsive. Chrome just sits there waiting to load. I decide to see what “top” tells me.

  • cmd line “top” shows that MPD is running at 15% CPU.

  • After about 3-5 minutes MPD drops off the top of the list. Web UI suddenly loads. However, I can’t play anything back.

  • I do MPC to see what it may tell me. It finally gives me status.
    root@volumio:~# mpc
    volume: n/a repeat: off random: off single: off consume: off
    ERROR: problems opening audio device
    root@volumio:~# mpc outputs
    Output 1 (Output) is enabled

  • I try to go back to “Playback”, select PCUSB again.

  • top now shows me that php5-fpm has two processes each taking ~42% CPU, this goes on for 20-30 seconds. Then they disappear. But web interface is unresponseive again (goes white). Top shows really nothing going on. MPD never surfaces in this list. There is some kind of “mmcqd/0” thing that jumps around in the list while this is happening too.

  • Now, each time I hit the webpage, a php5-fpm goes to top and eats 90% of CPU. No web interface ever appears.

  • Back again to manually start MPD via cmd line. /etc/init.d/mpd start - gives me the warning that 6600 is already taken…

  • Sets at 10-15% CPU for 3-5 minutes. (I do have a fairly big music collection, and I have a playlist in mpd/volumio right now, with about 30 tracks…?)

  • Now Web UI loads. I can move between pages, but playback does not work.

  • mpc status on cmd line shows:
    root@volumio:~# mpc status
    Cobblestone Jazz - Fiesta
    [paused] #35/35 0:00/5:52 (0%)
    volume: n/a repeat: off random: off single: off consume: off
    ERROR: problems opening audio device

Ultimately, my only fix for this situation is to “sudo reboot”.

After I do so, volumio comes back up, web UI loads, my playlist is there, and playback works.

I guess what I’m trying to determine is - when I power off my DAC and power it back on - what needs to be reset and in what order for it to work again? Rebooting just seems extraneous, but it’s fast enough. Overall, totally annoying.

I will also add, it seems that when I have changed a config setting in the web UI that causes the MPD daemon to restart, it never seems to work for playback and I need to reboot.

Hi,
it works for me:

killall mpd
/etc/init.d/php5-fpm stop
killall nginx
rmmod snd_bcm2835
rmmod snd_usb_audio
rmmod snd_hwdep
rmmod snd_usbmidi_lib
rmmod snd_seq_midi
rmmod snd_seq_midi_event
rmmod snd_rawmidi
rmmod snd_pcm
rmmod snd_seq
rmmod snd_seq_device
rmmod snd_timer
rmmod snd
echo "restarting..."
modprobe snd
modprobe snd_usb_audio
modprobe snd_bcm2835
sudo /usr/sbin/nginx
/etc/init.d/php5-fpm start
/var/www/command/orion_optimize.sh default
/etc/init.d/mpd stop
/etc/init.d/mpd start

my DAC: devialet 200
my lsmod:

root@volumio:~# lsmod
Module                  Size  Used by
snd_bcm2835            18850  0 
snd_usb_audio         105630  2 
snd_hwdep               5902  1 snd_usb_audio
snd_usbmidi_lib        19617  1 snd_usb_audio
snd_seq_midi            4406  0 
snd_seq_midi_event      5375  1 snd_seq_midi
snd_rawmidi            18265  2 snd_usbmidi_lib,snd_seq_midi
snd_pcm                75388  3 snd_bcm2835,snd_usb_audio
snd_seq                53078  2 snd_seq_midi_event,snd_seq_midi
snd_seq_device          5628  3 snd_seq,snd_rawmidi,snd_seq_midi
snd_timer              17784  2 snd_pcm,snd_seq
snd                    51667  12 snd_bcm2835,snd_usb_audio,snd_hwdep,snd_timer,snd_pcm,snd_seq,snd_rawmidi,snd_usbmidi_lib,snd_seq_device
nfsd                  263569  2 
ipv6                  333229  38 
fuse                   82155  3 
sg                     18207  0 
uas                    13179  0 
uio_pdrv_genirq         2958  0 
uio                     8119  1 uio_pdrv_genirq

FWIW, I am experiencing the same symptoms as described by the previous posters.

I can ‘see’ my DAC in the dropdown / selector, but nothing can playback without rebooting volumio, if I power off/on the external DAC.

I am running Volumio 1.5 on a CuBox-i4Pro with a USB DAC (NAD D 1050).

Otherwise, everything works great.

I have a fix and it has been sent to the developers.

You need to ssh into your volumio system, or log in via the console (via a TV or monitor on HDMI and USB keyboard). Edit the file /usr/local/bin/volumio with nano.

Use control W to find a line that says “usbattach)”. You will see a “curl” command after it. Add “vstart” before it. Likewise, just after that, in the “usbdetach)” section, add “vstop” after the curl line. Here is a snippet of what it looks like.

    airplayinactive)
       /usr/bin/curl "http://127.0.0.1:3000/api/v1/commands/?cmd=airplayIna$
    ;;
    usbattach)
       vstart
       /usr/bin/curl "http://127.0.0.1:3000/api/v1/commands/?cmd=usbAudioAt$
    ;;
    usbdetach)
       /usr/bin/curl "http://127.0.0.1:3000/api/v1/commands/?cmd=usbAudioDe$ 
       vstop                                                                        
    ;;

Now it will work like it should.

Thanx Evan

That does the trick for me too with an Audiolab MDAC connected via USB to a rpi3.

1 Like