Thank you for your donation!


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


Solved: Screen blanking with powered USB dac
#1
Hi all,

just discovered some strange behaviour in screen blanking. System setting is:

- local UI display "on"
- screen blank "1 minute"
- wake display on play "on"

Currently I am running Moode 6.7.1 on a Raspi 3B with USB boot from an attached USB SSD, official 7" touch display and USB audio connected to an external USB DAC (DacMagic 100 from Cambridge Audio) which is separately powered. Everything runs fine, SQ is great. However, there is just one rather disturbing issue: When I turn music off but do not shutdown, the display blanks after 1 minute as expecetd. When I now turn off the DAC, the screen immediatedly wakes up and will not blank until I repower the DAC.

Can anybody repro this? What about the current version 7.2.1?

Thanks in advance and cheers
Regards
Jörg
Reply
#2
(06-11-2021, 03:08 PM)Kikaha Wrote: Hi all,

just discovered some strange behaviour in screen blanking. System setting is:

- local UI display "on"
- screen blank "1 minute"
- wake display on play "on"

Currently I am running Moode 6.7.1 on a Raspi 3B with USB boot from an attached USB SSD, official 7" touch display and USB audio connected to an external USB DAC (DacMagic 100 from Cambridge Audio) which is separately powered. Everything runs fine, SQ is great. However, there is just one rather disturbing issue: When I turn music off but do not shutdown, the display blanks after 1 minute as expecetd. When I now turn off the DAC, the screen immediatedly wakes up and will not blank until I repower the DAC.

Can anybody repro this? What about the current version 7.2.1?

Thanks in advance and cheers

Something new here - although it is not that surprising. I had to send back the CA DAC due to interruptions and a lot of jitter, probably the DAC is defect. I reconnected a cheap USB DAC (30 € thingy from Amazon) which is not separately powered and tested the screen blanking behaviour on unplugging the USB cable. Result: Just the same as with the powered DAC: Unplugging the cable results in immediate screen wake up and no blanking until the cable is plugged in again.

@ Tim and team: I guess this has something to do with the mpd status which goes to "error" when the USB conncetion is broken.
Regards
Jörg
Reply
#3
The code that wakes the display when playback starts is in /var/www/command/watchdog.sh which runs every 6 seconds. See below.

Code:
    # Wake display on play
    CARD_NUM=$(sqlite3 $SQL_DB "SELECT value FROM cfg_mpd WHERE param='device'")
    HW_PARAMS=$(cat /proc/asound/card$CARD_NUM/pcm0p/sub0/hw_params)
    TIME_STAMP=$(date +'%Y%m%d %H%M%S')
    if [[ $HW_PARAMS = "closed" ]]; then
        LOG_MSG=" watchdog: Info: Audio output is (closed)"
        #echo $TIME_STAMP$LOG_MSG >> /var/log/moode.log
    else
        TIME_STAMP=$(date +'%Y%m%d %H%M%S')
        LOG_MSG=" watchdog: Info: Audio output is (in use)"
        WAKE_DISPLAY=$(sqlite3 $SQL_DB "SELECT value FROM cfg_system WHERE param='wake_display'")
        #echo $TIME_STAMP$LOG_MSG >> /var/log/moode.log
        if [[ $WAKE_DISPLAY = "1" ]]; then
            export DISPLAY=:0
            xset s reset > /dev/null 2>&1
        fi
    fi

USB DAC is connected but not playing

Code:
pi@rp1:~ $ HW_PARAMS=$(cat /proc/asound/card2/pcm0p/sub0/hw_params)
pi@rp1:~ $ echo $HW_PARAMS
closed
pi@rp1:~ $

USB DAC is disconnected or turned off

Code:
pi@rp1:~ $ HW_PARAMS=$(cat /proc/asound/card2/pcm0p/sub0/hw_params)
cat: /proc/asound/card2/pcm0p/sub0/hw_params: No such file or directory
pi@rp1:~ $ echo $HW_PARAMS

pi@rp1:~ $ 

As you can see the code block logic does not take into account USB DAC being disconnected and will fall into the "else" branch and wake the display.

I'll add to the TODO list to fix.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#4
(06-18-2021, 03:25 PM)Tim Curtis Wrote: The code that wakes the display when playback starts is in /var/www/command/watchdog.sh which runs every 6 seconds. See below.

Code:
    # Wake display on play
    CARD_NUM=$(sqlite3 $SQL_DB "SELECT value FROM cfg_mpd WHERE param='device'")
    HW_PARAMS=$(cat /proc/asound/card$CARD_NUM/pcm0p/sub0/hw_params)
    TIME_STAMP=$(date +'%Y%m%d %H%M%S')
    if [[ $HW_PARAMS = "closed" ]]; then
        LOG_MSG=" watchdog: Info: Audio output is (closed)"
        #echo $TIME_STAMP$LOG_MSG >> /var/log/moode.log
    else
        TIME_STAMP=$(date +'%Y%m%d %H%M%S')
        LOG_MSG=" watchdog: Info: Audio output is (in use)"
        WAKE_DISPLAY=$(sqlite3 $SQL_DB "SELECT value FROM cfg_system WHERE param='wake_display'")
        #echo $TIME_STAMP$LOG_MSG >> /var/log/moode.log
        if [[ $WAKE_DISPLAY = "1" ]]; then
            export DISPLAY=:0
            xset s reset > /dev/null 2>&1
        fi
    fi

USB DAC is connected but not playing

Code:
pi@rp1:~ $ HW_PARAMS=$(cat /proc/asound/card2/pcm0p/sub0/hw_params)
pi@rp1:~ $ echo $HW_PARAMS
closed
pi@rp1:~ $

USB DAC is disconnected or turned off

Code:
pi@rp1:~ $ HW_PARAMS=$(cat /proc/asound/card2/pcm0p/sub0/hw_params)
cat: /proc/asound/card2/pcm0p/sub0/hw_params: No such file or directory
pi@rp1:~ $ echo $HW_PARAMS

pi@rp1:~ $ 

As you can see the code block logic does not take into account USB DAC being disconnected and will fall into the "else" branch and wake the display.

I'll add to the TODO list to fix.

That's great. Thx a lot Tim. I will mark the thread as solved.
Regards
Jörg
Reply


Forum Jump: