Posts: 17
Threads: 5
Joined: Jan 2023
Reputation:
0
Hello,
I have my Moode setup on a RPi Zero 2 W with a Topping E50 USB DAC running inside a closet, connect to a Apple Home Kit AC-plug that I power on/off with my iPhone.
Everytime I power on this setup I have to manually open the closet to turn on the DAC (since it is USB powered).
The other option is to access Moode and put a song playing in MPD (it sends a signal to the DAC via USB and the DAC is auto-powered on).
Since I mainly use with Spotify Connect and did not want, every time I want to hear music, to 1) open the closet to power on the DAC or 2) open the web browser and enter Moode webpage to play a music in MPD and the stop it.
Is there any script that I can put on Moode "power-on" so that it "plays something on MPD for 2 seconds only"?
Thank you!
Posts: 14,498
Threads: 332
Joined: Mar 2018
Reputation:
593
Why exactly doesn't the DAC turn on?
Posts: 1,463
Threads: 25
Joined: Jun 2022
Reputation:
52
(01-06-2024, 12:04 PM)Tim Curtis Wrote: Why exactly doesn't the DAC turn on?
From what I understand, the Apple Home plug powers on the Pi, which in turn can power the DAC on via the USB, but it looks like the USB is not live (5V I mean) until the Pi plays something... I don't think this is a prerogative of the Pi-Zero.
1. How do you manually turn the DAC on, then, by pressing a button on it? Is there the possibility that the Topping turns indeed ON, but in sleep-mode, and this can be changed in its settings?
2. How can you have the Pi play from Spotify if you do not cast something from your phone? Doesn't it (casting from the phone) force the Pi to play, and hence the DAC to wake up?
Posts: 17
Threads: 5
Joined: Jan 2023
Reputation:
0
(01-06-2024, 12:04 PM)Tim Curtis Wrote: Why exactly doesn't the DAC turn on?
I think is a Topping thing. Even if I connect the DAC USB power cord on the wall, the DAC always "powers on at sleep mode".
The only way for it to wake up it so use the remote, click on the DAC power button, or send it some music.
The problem is that if I send it some music the MPD gives an error, and only plays after the second "attempt" - I think the moment MPD tries to send music the DAC is on sleep, and the time it takes to wake up is not fast enought (so the second time I try the DAC is already "on" and the music plays nicelly)
Here are the startup logs:
PHP Code: 20240106 192058 worker: -- 20240106 192059 worker: -- Start moOde 8 series 20240106 192059 worker: -- 20240106 192059 worker: Successfully daemonized 20240106 192059 worker: Wait for Linux startup... 20240106 192105 worker: Linux startup complete 20240106 192105 worker: Boot config backed up 20240106 192108 worker: Session loaded 20240106 192112 worker: Package holds applied 20240106 192113 worker: File check complete 20240106 192113 worker: Debug logging off 20240106 192113 worker: Reduced logging off 20240106 192113 worker: -- 20240106 192113 worker: -- Audio debug 20240106 192113 worker: -- 20240106 192113 worker: ALSA cards: 0:b1 | 1:E50 | 2:empty | 3:empty 20240106 192113 worker: MPD config: 1:E50 | mixer:none | cardnum:1 20240106 192113 worker: Mixer name: none exists 20240106 192113 worker: Hdwr volume: controller not detected 20240106 192113 worker: -- 20240106 192113 worker: -- System 20240106 192113 worker: -- 20240106 192243 worker: Host: pi4 20240106 192243 worker: Model: Pi-Zero 2 W 1.0 512MB 20240106 192243 worker: moOde: 8.3.7 2023-12-07 20240106 192243 worker: RaspiOS: 11.6 Bullseye 64-bit 20240106 192243 worker: Kernel: 6.1.21 64-bit 20240106 192243 worker: MPD ver: 0.23.14 20240106 192243 worker: CPU gov: ondemand 20240106 192243 worker: Userid: pi 20240106 192243 worker: Homedir: /home/pi 20240106 192243 worker: Timezone: Portugal 20240106 192243 worker: Keyboard: pt 20240106 192243 worker: USB boot: not available 20240106 192243 worker: File sys: expanded 20240106 192243 worker: HDMI out: off 20240106 192243 worker: Sys LED0: off 20240106 192243 worker: Sys LED1: sysclass does not exist 20240106 192243 worker: -- 20240106 192243 worker: -- Network 20240106 192243 worker: -- 20240106 192243 worker: Eth: adapter does not exist 20240106 192244 worker: Wlan: adapter exists 20240106 192244 worker: Wlan: country PT 20240106 192244 worker: Wlan: SSID myNet 20240106 192244 worker: Wlan: other none 20240106 192244 worker: Wlan: router off 20240106 192244 worker: Wlan: timeout up to 90 secs 20240106 192244 worker: Wlan: connect to myNet 20240106 192244 worker: Wlan: sleep disabled 20240106 192244 worker: Wlan: method dhcp 20240106 192244 worker: Wlan: address 192.168.50.151 20240106 192244 worker: Wlan: netmask 255.255.255.0 20240106 192244 worker: Wlan: gateway 192.168.50.1 20240106 192244 worker: Wlan: pri DNS 192.168.50.1 20240106 192244 worker: Wlan: domain lan 20240106 192244 worker: -- 20240106 192244 worker: -- Software update 20240106 192244 worker: -- 20240106 192244 worker: Automatic check off 20240106 192244 worker: -- 20240106 192244 worker: -- File sharing 20240106 192244 worker: -- 20240106 192247 worker: SMB file sharing: on 20240106 192247 worker: NFS file sharing: off 20240106 192247 worker: DLNA file sharing: off 20240106 192247 worker: -- 20240106 192247 worker: -- Audio config 20240106 192247 worker: -- 20240106 192247 worker: MPD config: update skipped (USB audio device) 20240106 192247 worker: Audio device: E50 20240106 192247 worker: Formats: S32_LE, SPECIAL, DSD_U32_BE 20240106 192247 worker: Mixer type CamillaDSP 20240106 192247 worker: Mixer name none exists 20240106 192247 worker: Hdwr volume: controller not detected 20240106 192247 worker: ALSA card: 1 20240106 192247 worker: ALSA mode: Default 20240106 192247 worker: ALSA loopback: off 20240106 192248 worker: CamillaDSP: VLS_805_v1_ALIGNED_ESTIMATE 20240106 192248 worker: Renderers: active flags reset 20240106 192248 worker: -- 20240106 192248 worker: -- MPD startup 20240106 192248 worker: -- 20240106 192250 worker: MPD service: started 20240106 192250 worker: MPD port 6600: accepting connections 20240106 192250 worker: MPD ALSA Default: on 20240106 192250 worker: MPD ALSA Bluetooth: off 20240106 192250 worker: MPD HTTP Server: off 20240106 192250 worker: MPD crossfade: off 20240106 192250 worker: MPD ignore CUE: yes 20240106 192250 worker: MPD CDSP volsync: on 20240106 192250 worker: MPD CDSP volrange: 60 dB 20240106 192250 worker: -- 20240106 192250 worker: -- Music sources 20240106 192250 worker: -- 20240106 192250 worker: USB auto-mount: udisks-glue 20240106 192250 worker: USB drives: no drives found 20240106 192250 worker: NAS source: Downloads 20240106 192250 worker: NAS source: FLAC 20240106 192321 worker: NAS mount: mount all submitted 20240106 192321 worker: -- 20240106 192321 worker: -- Feature availability 20240106 192321 worker: -- 20240106 192321 worker: Input select: available, src MPD, out E50 20240106 192330 worker: Bluetooth: started, PA started, ALSA mode Default 20240106 192330 worker: AirPlay: started 20240106 192330 worker: Spotify Connect: started 20240106 192330 worker: Squeezelite: available 20240106 192330 worker: RoonBridge: not installed 20240106 192330 worker: Multiroom: available 20240106 192330 worker: UPnP client: available 20240106 192330 worker: GPIO buttons: available 20240106 192330 worker: Stream recorder: n/a 20240106 192330 worker: HTTPS-Only mode: n/a 20240106 192330 worker: -- 20240106 192330 worker: -- Volume levels 20240106 192330 worker: -- 20240106 192332 worker: Volume knob: 0 20240106 192332 worker: Saved MPD volume: 0 20240106 192332 worker: Saved SRC volume: 0 20240106 192332 worker: Hdwr volume: controller not detected 20240106 192332 worker: -- 20240106 192332 worker: -- Peripherals 20240106 192332 worker: -- 20240106 192335 worker: Local display: off 20240106 192335 worker: On-screen kbd: off 20240106 192335 worker: Rotary encoder: off 20240106 192335 worker: USB volume knob: off 20240106 192335 worker: LCD updater: off 20240106 192335 worker: -- 20240106 192335 worker: -- Miscellaneous 20240106 192335 worker: -- 20240106 192335 worker: Auto-CoverView: off 20240106 192335 worker: CoverView timeout: Never 20240106 192335 worker: Auto-shuffle: off 20240106 192335 worker: Auto-play: off 20240106 192335 worker: Web SSH server: on 20240106 192335 worker: Maintenance task: 360 mins 20240106 192335 worker: Current view: reset to Playback 20240106 192335 worker: Session check: ok 20240106 192335 worker: -- 20240106 192335 worker: -- Startup complete 20240106 192335 worker: -- 20240106 192335 waitWorker(): Start cdsp-configeditor, w_active=0 20240106 192335 waitWorker(): End cdsp-configeditor, w_active=0 20240106 192335 waitWorker(): Start cdsp-configeditor, w_active=0 20240106 192335 waitWorker(): End cdsp-configeditor, w_active=0 20240106 192335 worker: Mount monitor: off 20240106 192335 worker: MPD monitor: off 20240106 192336 worker: Watchdog monitor: started 20240106 192336 worker: Responsiveness: Default 20240106 192336 worker: Ready 20240106 192336 waitWorker(): Start sys-config, w_active=0 20240106 192336 waitWorker(): End sys-config, w_active=0 20240106 192406 waitWorker(): Start sys-config, w_active=0 20240106 192406 waitWorker(): End sys-config, w_active=0
Posts: 17
Threads: 5
Joined: Jan 2023
Reputation:
0
(01-06-2024, 01:20 PM)Nutul Wrote: (01-06-2024, 12:04 PM)Tim Curtis Wrote: Why exactly doesn't the DAC turn on?
From what I understand, the Apple Home plug powers on the Pi, which in turn can power the DAC on via the USB, but it looks like the USB is not live (5V I mean) until the Pi plays something... I don't think this is a prerogative of the Pi-Zero.
1. How do you manually turn the DAC on, then, by pressing a button on it? Is there the possibility that the Topping turns indeed ON, but in sleep-mode, and this can be changed in its settings?
2. How can you have the Pi play from Spotify if you do not cast something from your phone? Doesn't it (casting from the phone) force the Pi to play, and hence the DAC to wake up?
Correct!
1) Yes, via button or remote, and it turns ON in "sleep-mode".
2) That's the main problem I have. I can connect to "Spotify Connect", but when I press play on Spotify it "drops" the connection to moode in Spotify Connect (but the DAC wakes up at that moment). But then I am forced to login into moode and restart the "Spotify Connect" render service in order to be able to connect again from the iPhone to Spotify in order to play music.
Posts: 14,498
Threads: 332
Joined: Mar 2018
Reputation:
593
(01-06-2024, 06:31 PM)tiago.trindade Wrote: (01-06-2024, 01:20 PM)Nutul Wrote: (01-06-2024, 12:04 PM)Tim Curtis Wrote: Why exactly doesn't the DAC turn on?
From what I understand, the Apple Home plug powers on the Pi, which in turn can power the DAC on via the USB, but it looks like the USB is not live (5V I mean) until the Pi plays something... I don't think this is a prerogative of the Pi-Zero.
1. How do you manually turn the DAC on, then, by pressing a button on it? Is there the possibility that the Topping turns indeed ON, but in sleep-mode, and this can be changed in its settings?
2. How can you have the Pi play from Spotify if you do not cast something from your phone? Doesn't it (casting from the phone) force the Pi to play, and hence the DAC to wake up?
Correct!
1) Yes, via button or remote, and it turns ON in "sleep-mode".
2) That's the main problem I have. I can connect to "Spotify Connect", but when I press play on Spotify it "drops" the connection to moode in Spotify Connect (but the DAC wakes up at that moment). But then I am forced to login into moode and restart the "Spotify Connect" render service in order to be able to connect again from the iPhone to Spotify in order to play music.
The Spotify Connect implementation (librespot) doesn't have a failover capability if the connection to the audio device gets interrupted, it just crashes or hangs. This failure case doesn't occur for most audio devices because they maintain their connection to the host.
Posts: 17
Threads: 5
Joined: Jan 2023
Reputation:
0
(01-06-2024, 06:37 PM)Tim Curtis Wrote: (01-06-2024, 06:31 PM)tiago.trindade Wrote: (01-06-2024, 01:20 PM)Nutul Wrote: (01-06-2024, 12:04 PM)Tim Curtis Wrote: Why exactly doesn't the DAC turn on?
From what I understand, the Apple Home plug powers on the Pi, which in turn can power the DAC on via the USB, but it looks like the USB is not live (5V I mean) until the Pi plays something... I don't think this is a prerogative of the Pi-Zero.
1. How do you manually turn the DAC on, then, by pressing a button on it? Is there the possibility that the Topping turns indeed ON, but in sleep-mode, and this can be changed in its settings?
2. How can you have the Pi play from Spotify if you do not cast something from your phone? Doesn't it (casting from the phone) force the Pi to play, and hence the DAC to wake up?
Correct!
1) Yes, via button or remote, and it turns ON in "sleep-mode".
2) That's the main problem I have. I can connect to "Spotify Connect", but when I press play on Spotify it "drops" the connection to moode in Spotify Connect (but the DAC wakes up at that moment). But then I am forced to login into moode and restart the "Spotify Connect" render service in order to be able to connect again from the iPhone to Spotify in order to play music.
The Spotify Connect implementation (librespot) doesn't have a failover capability if the connection to the audio device gets interrupted, it just crashes or hangs. This failure case doesn't occur for most audio devices because they maintain their connection to the host.
True!
That is why I have to mannualy play on MPD (because it has a failover capability) in order to "wake up" the DAC.
And after that I can use Spotify Connect without problems.
Is there any way/script to force this "MPD play" on startup, for a limit of time/songs (I could create and "empty song" just for that)?
Posts: 1,463
Threads: 25
Joined: Jun 2022
Reputation:
52
(01-07-2024, 04:42 PM)tiago.trindade Wrote: (01-06-2024, 06:37 PM)Tim Curtis Wrote: (01-06-2024, 06:31 PM)tiago.trindade Wrote: (01-06-2024, 01:20 PM)Nutul Wrote: (01-06-2024, 12:04 PM)Tim Curtis Wrote: Why exactly doesn't the DAC turn on?
From what I understand, the Apple Home plug powers on the Pi, which in turn can power the DAC on via the USB, but it looks like the USB is not live (5V I mean) until the Pi plays something... I don't think this is a prerogative of the Pi-Zero.
1. How do you manually turn the DAC on, then, by pressing a button on it? Is there the possibility that the Topping turns indeed ON, but in sleep-mode, and this can be changed in its settings?
2. How can you have the Pi play from Spotify if you do not cast something from your phone? Doesn't it (casting from the phone) force the Pi to play, and hence the DAC to wake up?
Correct!
1) Yes, via button or remote, and it turns ON in "sleep-mode".
2) That's the main problem I have. I can connect to "Spotify Connect", but when I press play on Spotify it "drops" the connection to moode in Spotify Connect (but the DAC wakes up at that moment). But then I am forced to login into moode and restart the "Spotify Connect" render service in order to be able to connect again from the iPhone to Spotify in order to play music.
The Spotify Connect implementation (librespot) doesn't have a failover capability if the connection to the audio device gets interrupted, it just crashes or hangs. This failure case doesn't occur for most audio devices because they maintain their connection to the host.
True!
That is why I have to mannualy play on MPD (because it has a failover capability) in order to "wake up" the DAC.
And after that I can use Spotify Connect without problems.
Is there any way/script to force this "MPD play" on startup, for a limit of time/songs (I could create and "empty song" just for that)?
There is an option, in the MPD section of AUDIO settings: "Autoplay after start". I believe that if you leave a 3-seconds silence track in the queue, at every startup it will play. You can give it a try, you can use any track for now, if you don't have any empty; that will also notify you when the system is ready to accept Spotify... maybe a short jingle...
Give it a try.
Posts: 17
Threads: 5
Joined: Jan 2023
Reputation:
0
05-07-2024, 05:39 PM
(This post was last modified: 05-07-2024, 05:54 PM by tiago.trindade.)
For those who might be in a similar situation, I manage to find a solution.
1) created a file (with nano) named start_music.sh
2) edited the file with these inputs:
sleep 10 # Wait for 10 seconds after aplying this
mpc clear # Clear the current playlist
mpc load 'Default Playlist' # Load the playlist named 'Default Playlist'
mpc volume 50
mpc play # Start playing the music
sleep 1 # Wait for 1 second
mpc volume 100
mpc stop # Stop the playback after 1 second
3) changed permission using
chmod +x start_music.sh
4) executed
crontab -e
5) added the following line
@reboot sleep 30 && /path/to/your/script/start_music.sh
6) save and exit
(Make sure to replace /path/to/your/script/ with the actual path where you saved your script.Save the crontab file and exit the editor)
done
|