Yes!
Reviewed my configuration and had some typos. It shows files in HA. Sorry for this.
Both for SD card and USB?
This is strange…
For USB is working ok on app and HA.
For SD is not working ok. No files on app and no files on HA.
BUT!
On the app it was selected the playlist from USB, when changing the source from USB to SD from HA AND the playlist was not closed, it shows the files from SD, but after reopening the playlist, it shows nothing on app.
Sounds like a bug in the UPNP part of the firmware. I guess it could be worked around but unless I could get my hands on such a unit, I don’t see real chances. None of my players have an SD slot, and additionally they are all above v4 firmware.
Working
Seems it is a 4stream problem. Using AudioPro shows files from both sources.
Edit: Yes, it is from 4stream. If playlist remains open when file playback changes, it shows files on SD.
If playlist remains open when file playback changes, it shows files on SD.
Can you please describe more exactly how it behaves?
The speaker is playing a track from SD.
Open 4stream, go to playlist. It is empty.
Playing track reaches the end and the next track starts playing (playlist still opened). This is the moment when the playlist populates and shows files on SD.
OK I see. I think the speaker is using a different UPNP queuename to publish the initial state of the ‘playlist’ (=list of all files) from the SD. During playback it seems updating the CurrentQueue
which looks like it’s common for both USB and SD, the problem is that it’s not available until the user starts playing.
4Stream app seems not prepared to handle SD queues…
This could be resolved with a bit of sniffing. If you’re in the mood of hacking, try to monitor the traffic between the other app and your speaker. You could use HttpCanary app on Android for this. The idea is to start watching for packets when you click on the list to see the contents of the SD. You should look for upnp control messages and find the one which in response gives a huge XML with all the files (select response on top and text on bottom). Near the beginning of that message there should be something like <ListName>USBDiskQueue</ListName>
- we need to know what’s the Queue name in the case of SD, instead of USBDiskQueue
.
This one?
There are only 2 tracks on SD.
HTTP/1.1 200 OK
CONTENT-LENGTH: 4330
CONTENT-TYPE: text/xml; charset="utf-8"
SERVER: Linux/2.6.36
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body>
<u:BrowseQueueResponse xmlns:u="urn:schemas-wiimu-com:service:PlayQueue:1">
<QueueContext><?xml version="1.0"?>
<PlayList>
<ListName>USBDiskQueue</ListName>
<ListInfo>
<SourceName>USBDiskQueue</SourceName>
<MarkSearch>0</MarkSearch>
<TrackNumber>2</TrackNumber>
<Quality>0</Quality>
<UpdateTime>1625</UpdateTime>
<LastPlayIndex>2</LastPlayIndex>
<RealIndex>0</RealIndex>
<SwitchPageMode>0</SwitchPageMode>
<CurrentPage>0</CurrentPage>
<TotalPages>0</TotalPages>
<searching>0</searching>
</ListInfo>
<Tracks>
<Track1>
<URL>/media/sda1/Basshunter - Calcutta.mp3</URL>
<Metadata>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;DIDL-Lite xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns:song=&quot;www.wiimu.com/song/&quot; xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot;&gt;
&lt;upnp:class&gt;object.item.audioItem.musicTrack&lt;/upnp:class&gt;
&lt;item id=&quot;0&quot;&gt;
&lt;song:subid&gt;&lt;/song:subid&gt;
&lt;song:description&gt;unknown&lt;/song:description&gt;
&lt;song:skiplimit&gt;0&lt;/song:skiplimit&gt;
&lt;song:id&gt;0&lt;/song:id&gt;
&lt;song:like&gt;0&lt;/song:like&gt;
&lt;song:singerid&gt;0&lt;/song:singerid&gt;
&lt;song:albumid&gt;0&lt;/song:albumid&gt;
&lt;res protocolInfo=&quot;http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;&quot; duration=&quot;00:00:00.000&quot;&gt;/media/sda1/Basshunter - Calcutta.mp3&lt;/res&gt;
&lt;dc:title&gt;Basshunter - Calcutta.mp3&lt;/dc:title&gt;
&lt;dc:creator&gt;unknown&lt;/dc:creator&gt;
&lt;upnp:artist&gt;unknown&lt;/upnp:artist&gt;
&lt;upnp:album&gt;unknown&lt;/upnp:album&gt;
&lt;upnp:albumArtURI&gt;unknown&lt;/upnp:albumArtURI&gt;
&lt;/item&gt;
&lt;/DIDL-Lite&gt;
</Metadata>
<Source>USBDiskQueue</Source>
</Track1>
<Track2>
<URL>/media/sda1/Big Brovaz - Nu Flow.mp3</URL>
<Metadata>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;DIDL-Lite xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns:song=&quot;www.wiimu.com/song/&quot; xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot;&gt;
&lt;upnp:class&gt;object.item.audioItem.musicTrack&lt;/upnp:class&gt;
&lt;item id=&quot;0&quot;&gt;
&lt;song:subid&gt;&lt;/song:subid&gt;
&lt;song:description&gt;unknown&lt;/song:description&gt;
&lt;song:skiplimit&gt;0&lt;/song:skiplimit&gt;
&lt;song:id&gt;0&lt;/song:id&gt;
&lt;song:like&gt;0&lt;/song:like&gt;
&lt;song:singerid&gt;0&lt;/song:singerid&gt;
&lt;song:albumid&gt;0&lt;/song:albumid&gt;
&lt;res protocolInfo=&quot;http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;&quot; duration=&quot;00:00:00.000&quot;&gt;/media/sda1/Big Brovaz - Nu Flow.mp3&lt;/res&gt;
&lt;dc:title&gt;Big Brovaz - Nu Flow.mp3&lt;/dc:title&gt;
&lt;dc:creator&gt;unknown&lt;/dc:creator&gt;
&lt;upnp:artist&gt;unknown&lt;/upnp:artist&gt;
&lt;upnp:album&gt;unknown&lt;/upnp:album&gt;
&lt;upnp:albumArtURI&gt;unknown&lt;/upnp:albumArtURI&gt;
&lt;/item&gt;
&lt;/DIDL-Lite&gt;
</Metadata>
<Source>USBDiskQueue</Source>
</Track2>
</Tracks>
</PlayList>
</QueueContext>
</u:BrowseQueueResponse>
</s:Body> </s:Envelope>
Yes, this is it, thanks. Strangely it has the same name USBDiskQueue
.
Edit: what happens if you replace at line 1198:
queuename = 'CurrentQueue'
instead of 'USBDiskQueue'
.
Try loading separately for both USB and SD.
USB is working.
When selecting SD, it takes the files from USB source.
Should I change lines 1197, 1198 and 1199 to match SD? Currentyl is USB.
That won’t affect it, those are just names…
Unfortunately I won’t be able to fix it unless I get my hands on such a device.
No problem!
Personally, I am using the speakers for internet radio.
I would like to thank you again for your time & work. Using HA to play music is more flexible.
When can we switch to master branch?
Is there a way to play youtube on theese speakers?
Master branch is alive and included in HACS. You can re-install from there (if you’re on previous version of Linkplay integration, uninstall that first, and install from HACS v2, which is this one).
If you use HACS, you will be notified when there are updates, and you can also check for updates manually if yo want.
Added ability to snapshot and restore Spotify state (released in HACS, v2.0.2a)
What happens during snapshot is that the current Spotify playlist will be saved (overwritten) on the device’s highest preset number. It can be seen in the Android app: Snapshot set by Home Assistant (playlist name)
. During restore HA will simply recall that preset, the playback will continue with the same Spotify playlist as before.
Caveats are that since this means, from Spotify’s point of view, a new start of the same playlist playback, it may either start from the beginning or not, or the same track or not. I couldn’t figure it out. And tracks which were played before the snapshot may be played again later after restore.
Since most people listen to randomly generated music playlists, I guess this is acceptable.
Currently there’s no other way to do this as there’s not much documentation available and Spotify communication with the unit is closed.
That’s awesome!!! Still much better functionality then having music stop completely after a TTS notification. Thank you for your great work!
Added support for metadata during Tidal playback (artitst, title, album, coverart).
Added support for metadata during TuneIn playback (title, coverart).
(released in HACS, v2.0.4)
TuneIn support is limited, in the aspect of data refresh, due to the fact that it’s hard to be differentiated clearly from other stream playback types, without intensive polling of the device. The value it brings doesn’t worth it - as the TuneIn info rarely has correct metadata present (it most cases only has a subtitle or slogan instead of normal artist and title information, and just a station logo instead of real cover art).
The experience is better with stations configured as sources (and thus buttons with mini-media-player card), as there metadata is grabbed from Icecast.
I’m seriously thinking to remove it…
v2.0.5:
- added possibilty to specify multiple entity ids separated by comma or use
all
to run the services against - fixed Spotify snapshot for devices which had an empty last preset
- removed TuneIn coverart support, as it caused more bad than good. Better get info from stream’s icecast headers + coverarts based on that from Last.Fm
v2.0.6:
- add support for Deezer metadata based on CDN subdomain detection (similar to Tidal)
Hey @robi - I just wanted to say thanks a lot for bringing this custom integration back to life with your new version.
I did test the original version a while back and it didn’t work as expected for me.
However now I found your new version randomly in HACS and so far it seems to work great. And you’re really on fire with the updates / further development.
Thanks again!