runeaudio cannot find audio device for Shairport

Raspberry Pi related support

runeaudio cannot find audio device for Shairport

Postby gearhead » 05 Feb 2018, 02:17

I have been playing around to replace shairport with shairport-sync. I think I have finally figured out what to do, but in the process, I have messed up the redis database or something. When this happened before, the only way out was to wipe and restart. There has to be a better way. Right now, the original files are restored (/var/www/app/libs/runeaudip.php and /var/www/command/rune_SY_wrk). Is there a way I can fix this short of a re-burn of the image?

What I have:
When I enable and edit the advertised name of the shairport module from the 'settings' page, it is unable to read the mixer device.
the Exec line in the service ends with '-- -d plug' and it should be ' -- -d plughw0:0'

If I refresh the audio device
Code: Select all
~# /var/www/command/refresh_ao

Notice: Trying to get property of non-object in /srv/http/app/libs/runeaudio.php on line 1978

Warning: socket_write(): unable to write to socket [32]: Broken pipe in /srv/http/app/libs/runeaudio.php on line 105


The refresh_ao.log shows:
Code: Select all
~# cat /var/log/runeaudio/refresh_ao.log
[05-Feb-2018 01:06:49 UTC] ### lock status  ###  0
[05-Feb-2018 01:06:49 UTC] ### --------------------------- start Audio Outputs refresh --------------------------- ### 
[05-Feb-2018 01:06:49 UTC] ### sysCmd($str) ###  cat /proc/asound/cards | grep : | cut -b 1-3,21-
[05-Feb-2018 01:06:49 UTC] ### sysCmd() output: ### $data type = array
[05-Feb-2018 01:06:49 UTC] ### sysCmd() output: ###  ['0'] =>  0 : snd_rpi_hifiber - snd_rpi_hifiberry_dacplus
[05-Feb-2018 01:06:49 UTC] ### /proc/asound/cards ### $data type = array
[05-Feb-2018 01:06:49 UTC] ### /proc/asound/cards ###  ['0'] =>  0 : snd_rpi_hifiber - snd_rpi_hifiberry_dacplus
[05-Feb-2018 01:06:49 UTC] ### >>--------------------------- card:  0 : snd_rpi_hifiber - snd_rpi_hifiberry_dacplus index: 0 (start) --------------------------->> ### 
[05-Feb-2018 01:06:49 UTC] ### wrk_audioOutput card string:  ###  snd_rpi_hifiberry_dacplus
[05-Feb-2018 01:06:49 UTC] ### sysCmd($str) ###  aplay -l -v | grep "\[snd_rpi_hifiberry_dacplus\]"
[05-Feb-2018 01:06:49 UTC] ### sysCmd() output: ### $data type = array
[05-Feb-2018 01:06:49 UTC] ### sysCmd() output: ###  ['0'] => card 0: sndrpihifiberry [snd_rpi_hifiberry_dacplus], device 0: HiFiBerry DAC+ Pro HiFi pcm512x-hifi-0 []
[05-Feb-2018 01:06:49 UTC] ### wrk_audioOutput: in loop: acards_details for: snd_rpi_hifiberry_dacplus ###  {"sysname":"snd_rpi_hifiberry_dacplus","extlabel":"HiFiBerry DAC+ (I²S)","mixer_numid":"1","mixer_control":"Digital","hwplatformid":"01","type":"i2s"}
[05-Feb-2018 01:06:49 UTC] ### wrk_audioOutput: in loop: (decoded) acards_details for: snd_rpi_hifiberry_dacplus ### $data type = object
[05-Feb-2018 01:06:49 UTC] ### wrk_audioOutput: in loop: (decoded) acards_details for: snd_rpi_hifiberry_dacplus ###  ['sysname'] => snd_rpi_hifiberry_dacplus
[05-Feb-2018 01:06:49 UTC] ### wrk_audioOutput: in loop: (decoded) acards_details for: snd_rpi_hifiberry_dacplus ###  ['extlabel'] => HiFiBerry DAC+ (I²S)
[05-Feb-2018 01:06:49 UTC] ### wrk_audioOutput: in loop: (decoded) acards_details for: snd_rpi_hifiberry_dacplus ###  ['mixer_numid'] => 1
[05-Feb-2018 01:06:49 UTC] ### wrk_audioOutput: in loop: (decoded) acards_details for: snd_rpi_hifiberry_dacplus ###  ['mixer_control'] => Digital
[05-Feb-2018 01:06:49 UTC] ### wrk_audioOutput: in loop: (decoded) acards_details for: snd_rpi_hifiberry_dacplus ###  ['hwplatformid'] => 01
[05-Feb-2018 01:06:49 UTC] ### wrk_audioOutput: in loop: (decoded) acards_details for: snd_rpi_hifiberry_dacplus ###  ['type'] => i2s
[05-Feb-2018 01:06:49 UTC] ### sysCmd($str) ###  amixer -c 0 get "Digital" | grep Limits | cut -d ':' -f 2 | cut -d ' ' -f 4,6
[05-Feb-2018 01:06:49 UTC] ### sysCmd() output: ### $data type = array
[05-Feb-2018 01:06:49 UTC] ### sysCmd() output: ###  ['0'] => -
[05-Feb-2018 01:06:49 UTC] ### ::::::acard extlabel::::::  ###  HiFiBerry DAC+ (I²S)
[05-Feb-2018 01:06:49 UTC] ### wrk_audioOutput: in loop: extlabel for: snd_rpi_hifiberry_dacplus ###  HiFiBerry DAC+ (I²S)
[05-Feb-2018 01:06:49 UTC] ### ::::::acard record array:::::: ### $data type = array
[05-Feb-2018 01:06:49 UTC] ### ::::::acard record array:::::: ###  ['device'] => hw:0,0
[05-Feb-2018 01:06:49 UTC] ### ::::::acard record array:::::: ###  ['volmin'] => -
[05-Feb-2018 01:06:49 UTC] ### ::::::acard record array:::::: ###  ['mixer_device'] => hw:0
[05-Feb-2018 01:06:49 UTC] ### ::::::acard record array:::::: ###  ['mixer_control'] => Digital
[05-Feb-2018 01:06:49 UTC] ### ::::::acard record array:::::: ###  ['extlabel'] => HiFiBerry DAC+ (I²S)
[05-Feb-2018 01:06:49 UTC] ### ::::::acard record array:::::: ###  ['name'] => snd_rpi_hifiberry_dacplus
[05-Feb-2018 01:06:49 UTC] ### ::::::acard record array:::::: ###  ['type'] => alsa
[05-Feb-2018 01:06:49 UTC] ### ::::::acard record array:::::: ###  ['system'] => card 0: sndrpihifiberry [snd_rpi_hifiberry_dacplus], device 0: HiFiBerry DAC+ Pro HiFi pcm512x-hifi-0 []
[05-Feb-2018 01:06:49 UTC] ### <<--------------------------- card: snd_rpi_hifiberry_dacplus index: 0 (finish) ---------------------------<< ### 
[05-Feb-2018 01:06:49 UTC] [wrk_mpdconf] ### detected ACARDS  ### $data type = array
[05-Feb-2018 01:06:49 UTC] [wrk_mpdconf] ### detected ACARDS  ###  ['snd_rpi_hifiberry_dacplus'] => {"device":"hw:0,0","volmin":"-","mixer_device":"hw:0","mixer_control":"Digital","extlabel":"HiFiBerry DAC+ (I&#178;S)","name":"snd_rpi_hifiberry_dacplus","type":"alsa","system":"card 0: sndrpihifiberry [snd_rpi_hifiberry_dacplus], device 0: HiFiBerry DAC+ Pro HiFi pcm512x-hifi-0 []"}
[05-Feb-2018 01:06:49 UTC] [wrk_mpdconf] ### decoded ACARD snd_rpi_hifiberry_dacplus ### $data type = object
[05-Feb-2018 01:06:49 UTC] [wrk_mpdconf] ### decoded ACARD snd_rpi_hifiberry_dacplus ###  ['device'] => hw:0,0
[05-Feb-2018 01:06:49 UTC] [wrk_mpdconf] ### decoded ACARD snd_rpi_hifiberry_dacplus ###  ['volmin'] => -
[05-Feb-2018 01:06:49 UTC] [wrk_mpdconf] ### decoded ACARD snd_rpi_hifiberry_dacplus ###  ['mixer_device'] => hw:0
[05-Feb-2018 01:06:49 UTC] [wrk_mpdconf] ### decoded ACARD snd_rpi_hifiberry_dacplus ###  ['mixer_control'] => Digital
[05-Feb-2018 01:06:49 UTC] [wrk_mpdconf] ### decoded ACARD snd_rpi_hifiberry_dacplus ###  ['extlabel'] => HiFiBerry DAC+ (I&#178;S)
[05-Feb-2018 01:06:49 UTC] [wrk_mpdconf] ### decoded ACARD snd_rpi_hifiberry_dacplus ###  ['name'] => snd_rpi_hifiberry_dacplus
[05-Feb-2018 01:06:49 UTC] [wrk_mpdconf] ### decoded ACARD snd_rpi_hifiberry_dacplus ###  ['type'] => alsa
[05-Feb-2018 01:06:49 UTC] [wrk_mpdconf] ### decoded ACARD snd_rpi_hifiberry_dacplus ###  ['system'] => card 0: sndrpihifiberry [snd_rpi_hifiberry_dacplus], device 0: HiFiBerry DAC+ Pro HiFi pcm512x-hifi-0 []
[05-Feb-2018 01:06:49 UTC] ### mpd.conf advanced state ###  0
[05-Feb-2018 01:06:49 UTC] ### mpd.conf advanced mode OFF ### 
[05-Feb-2018 01:06:49 UTC] ### sysCmd($str) ###  mpc status | grep '\[' | cut -d '[' -f 2 | cut -d ']' -f 1
[05-Feb-2018 01:06:49 UTC] ### sysCmd() output: ### $data type = array
[05-Feb-2018 01:06:49 UTC] ### opened **NORMAL MODE (blocking)** socket resource:  ###  Resource id #60
[05-Feb-2018 01:06:49 UTC] ### [open][Resource id #60]   <<<<<<<<<<<< OPEN MPD SOCKET ---- MPD greeting response: OK MPD 0.19.0
>>>>>>>>>>>> ### 
[05-Feb-2018 01:06:49 UTC] ### MPD COMMAND: (socket=Resource id #60) ###  kill

[05-Feb-2018 01:06:49 UTC] ### MPD COMMAND: (socket=Resource id #60) ###  close

[05-Feb-2018 01:06:49 UTC] ### [close][Resource id #60]   <<<<<< CLOSE MPD SOCKET (Broken pipe) >>>>>> ### 
[05-Feb-2018 01:06:51 UTC] ### sysCmd($str) ###  systemctl stop mpd
[05-Feb-2018 01:06:51 UTC] ### sysCmd() output: ### $data type = array
[05-Feb-2018 01:06:52 UTC] ### sysCmd($str) ###  systemctl start mpd
[05-Feb-2018 01:06:52 UTC] ### sysCmd() output: ### $data type = array
[05-Feb-2018 01:06:52 UTC] ### sysCmd($str) ###  systemctl restart upmpdcli
[05-Feb-2018 01:06:52 UTC] ### sysCmd() output: ### $data type = array
[05-Feb-2018 01:06:52 UTC] [sysCmdAsync] ### sysCmdAsync($cmdstr) decoded ###  sleep 1 && rune_prio nice
[05-Feb-2018 01:06:52 UTC] [sysCmdAsync] ### sysCmdAsync($cmdstr) encoded ###  /var/www/command/cmd_async c2xlZXAgMSAmJiBydW5lX3ByaW8gbmljZQ==
[05-Feb-2018 01:06:52 UTC] [sysCmdAsync] ### sysCmdAsync() output: ### $data type = array
[05-Feb-2018 01:06:52 UTC] ### ui_render channel= ###  notify
[05-Feb-2018 01:06:53 UTC] ### -------------------------- #finish Audio Outputs refresh# -------------------------- ### 
[05-Feb-2018 01:06:53 UTC] ### lock status  ###  0


When I change the name of the shairport device the rune_SY_wrk.log shows this:
Code: Select all
~# cat /var/log/runeaudio/rune_SY_wrk.log
[05-Feb-2018 01:10:57 UTC] ### [wrk] there is something for me in the queue!  ### 
[05-Feb-2018 01:10:57 UTC] ### (loop) start job ###  0b5fc3728a450dbf064cc1d21d8b04c8
[05-Feb-2018 01:10:57 UTC] ### wrk_SY:  ###  airplay
[05-Feb-2018 01:10:57 UTC] ### acard details:  ### 
[05-Feb-2018 01:10:57 UTC] ### wrk_replaceTextLine($file, $inputArray, $strfind, $strrepl, $linelabel, $lineoffset) ### 
[05-Feb-2018 01:10:57 UTC] ### wrk_replaceTextLine $file ###  /usr/lib/systemd/system/shairport.service
[05-Feb-2018 01:10:57 UTC] ### wrk_replaceTextLine $strfind ###  ExecStart=
[05-Feb-2018 01:10:57 UTC] ### wrk_replaceTextLine $strrepl ###  ExecStart=/usr/bin/shairport -w --name="Rune_1  (AirPlay)" --on-start=$ON --on-stop=$OFF --meta-dir=/var/run/shairport -o alsa -- -d plug
[05-Feb-2018 01:10:57 UTC] ### wrk_replaceTextLine $linelabel ### 
[05-Feb-2018 01:10:57 UTC] ### wrk_replaceTextLine $lineoffset ### 
[05-Feb-2018 01:10:57 UTC] ### replaceall $line ###  ExecStart=/usr/bin/shairport -w --name="Rune_1  (AirPlay)" --on-start=$ON --on-stop=$OFF --meta-dir=/var/run/shairport -o alsa -- -d plug

[05-Feb-2018 01:10:57 UTC] ### shairport.service : ### $data type = array
[05-Feb-2018 01:10:57 UTC] ### shairport.service : ###  ['0'] => [Unit]

[05-Feb-2018 01:10:57 UTC] ### shairport.service : ###  ['1'] => Description=Shairport AirTunes receiver

[05-Feb-2018 01:10:57 UTC] ### shairport.service : ###  ['2'] => After=sound.target

[05-Feb-2018 01:10:57 UTC] ### shairport.service : ###  ['3'] => Requires=avahi-daemon.service

[05-Feb-2018 01:10:57 UTC] ### shairport.service : ###  ['4'] => After=avahi-daemon.service

[05-Feb-2018 01:10:57 UTC] ### shairport.service : ###  ['5'] =>

[05-Feb-2018 01:10:57 UTC] ### shairport.service : ###  ['6'] => [Service]

[05-Feb-2018 01:10:57 UTC] ### shairport.service : ###  ['7'] => Environment="ON=/var/www/command/airplay_toggle on"

[05-Feb-2018 01:10:57 UTC] ### shairport.service : ###  ['8'] => Environment="OFF=/var/www/command/airplay_toggle off"

[05-Feb-2018 01:10:57 UTC] ### shairport.service : ###  ['9'] => ExecStartPre=/usr/bin/mkdir -p /var/run/shairport

[05-Feb-2018 01:10:57 UTC] ### shairport.service : ###  ['10'] => ExecStart=/usr/bin/shairport -w --name="Rune_1  (AirPlay)" --on-start=$ON --on-stop=$OFF --meta-dir=/var/run/shairport -o alsa -- -d plug

[05-Feb-2018 01:10:57 UTC] ### shairport.service : ###  ['11'] => Restart=always

[05-Feb-2018 01:10:57 UTC] ### shairport.service : ###  ['12'] =>

[05-Feb-2018 01:10:57 UTC] ### shairport.service : ###  ['13'] => [Install]

[05-Feb-2018 01:10:57 UTC] ### shairport.service : ###  ['14'] => WantedBy=multi-user.target

[05-Feb-2018 01:10:57 UTC] ### wrk_replaceTextLine($file, $inputArray, $strfind, $strrepl, $linelabel, $lineoffset) ### 
[05-Feb-2018 01:10:57 UTC] ### wrk_replaceTextLine $file ###  /etc/libao.conf
[05-Feb-2018 01:10:57 UTC] ### wrk_replaceTextLine $strfind ###  dev=
[05-Feb-2018 01:10:57 UTC] ### wrk_replaceTextLine $strrepl ###  dev=
[05-Feb-2018 01:10:57 UTC] ### wrk_replaceTextLine $linelabel ### 
[05-Feb-2018 01:10:57 UTC] ### wrk_replaceTextLine $lineoffset ### 
[05-Feb-2018 01:10:57 UTC] ### replaceall $line ###  dev=

[05-Feb-2018 01:10:57 UTC] ### sysCmd($str) ###  systemctl daemon-reload
[05-Feb-2018 01:10:57 UTC] ### sysCmd() output: ### $data type = array
[05-Feb-2018 01:10:57 UTC] ### restart shairport ### 
[05-Feb-2018 01:10:57 UTC] ### sysCmd($str) ###  systemctl restart shairport
[05-Feb-2018 01:10:57 UTC] ### sysCmd() output: ### $data type = array
[05-Feb-2018 01:10:57 UTC] [sysCmdAsync] ### sysCmdAsync($cmdstr) decoded ###  sleep 1 && rune_prio nice
[05-Feb-2018 01:10:57 UTC] [sysCmdAsync] ### sysCmdAsync($cmdstr) encoded ###  /var/www/command/cmd_async c2xlZXAgMSAmJiBydW5lX3ByaW8gbmljZQ==
[05-Feb-2018 01:10:57 UTC] [sysCmdAsync] ### sysCmdAsync() output: ### $data type = array
[05-Feb-2018 01:10:57 UTC] ### service: SHAIRPORT start ### 
[05-Feb-2018 01:10:58 UTC] ### sysCmd($str) ###  systemctl restart shairport
[05-Feb-2018 01:10:58 UTC] ### sysCmd() output: ### $data type = array
[05-Feb-2018 01:10:58 UTC] ### notify (async) JSON string:  ###  {"title":"AirPlay","text":"AirPlay feature enabled"}
[05-Feb-2018 01:10:58 UTC] [sysCmdAsync] ### sysCmdAsync($cmdstr) decoded ###  /var/www/command/ui_notify.php '{"title":"AirPlay","text":"AirPlay feature enabled"}
[05-Feb-2018 01:10:58 UTC] [sysCmdAsync] ### sysCmdAsync($cmdstr) encoded ###  /var/www/command/cmd_async L3Zhci93d3cvY29tbWFuZC91aV9ub3RpZnkucGhwICd7InRpdGxlIjoiQWlyUGxheSIsInRleHQiOiJBaXJQbGF5IGZlYXR1cmUgZW5hYmxlZCJ9
[05-Feb-2018 01:10:58 UTC] [sysCmdAsync] ### sysCmdAsync() output: ### $data type = array
[05-Feb-2018 01:10:58 UTC] ### (loop) delete job_queue ###  0b5fc3728a450dbf064cc1d21d8b04c8
gearhead
 
Posts: 101
Joined: 25 Nov 2014, 06:04

Re: runeaudio cannot find audio device for Shairport

Postby janui » 05 Feb 2018, 21:38

Hi gearhead,
When redis gets mixed up, this works most of the time:
Code: Select all
redis-cli set playerid ‘’
redis-cli set hwplatformid ‘’
/var/www/command/rune_shutdown poweroff
shutdown -P now
janui
User avatar
janui
 
Posts: 704
Joined: 20 Dec 2014, 12:55
Location: Ollanda

Re: runeaudio cannot find audio device for Shairport

Postby gearhead » 06 Feb 2018, 23:41

Janui,

That did it. Thanks!

The line for shairport-sync, at least for my card is:
Code: Select all
/usr/bin/shairport-sync -w --name="RuneAudio (AirPlay)" -- -d hw:0 -c Digital

and this was generated from the line in runeaudio.php:
Code: Select all
     $newArray = wrk_replaceTextLine($file, '', 'ExecStart=', 'ExecStart=/usr/bin/shairport-sync -w --name="'.$name.'" -- -d '.$acard->mixer_device.' -c '.$acard->mixer_control);

As my card is a 5122 with hardware volume control...
gearhead
 
Posts: 101
Joined: 25 Nov 2014, 06:04

support RuneAudio Donate with PayPal


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 16 guests
cron