SD player UI development

Anything to do with computer audio, hardware, software etc.
randytsuch
Posts: 395
Joined: Mon Aug 11, 2014 4:19 am

Re: SD player UI development

Post by randytsuch »

Hi John
I definitely agree the way to go is to find something that works, and change it to add our special requirements.
That's the limit of my sw capabilities, and even that will likely be a stretch.

Looks like beets really wants to run on a mac or a linux machine.
The amplitude looks to require node, which I looked at a little for a previous project, but never really understood how that works.

So I don't have much faith that I could get either of these running on my android phone.

Instead I started looking for android open source music players, found this one
https://github.com/vanilla-music/vanilla

It can be built in Android Studio
https://developer.android.com/studio/index.html
Which looks like a nice environment for building and debugging

I know your choices would be multi-platform, but honestly I think they are beyond my skills. Vanilla music may also be beyond my skills too lol.
But I'll spend some time looking at the code, and see if I can figure it out.

Randy
MSI H81-P33 MB, Xeon E3-1225 V3, LPS/LIFEPO4 and Astron RS-12A, 240gb SSD music, 2nd SSD for OS, Mod SS PCIE USB card, Server2012 R2 Ess+AO+MQn, Amanero USB to DACEND ES9018 to Schiit Lyr amp to Senn HD 700 headphones
jkeny
Posts: 2387
Joined: Sun Jan 17, 2010 9:37 pm

Re: SD player UI development

Post by jkeny »

randytsuch wrote: Fri Apr 13, 2018 7:45 pm Hi John
I definitely agree the way to go is to find something that works, and change it to add our special requirements.
That's the limit of my sw capabilities, and even that will likely be a stretch.

Looks like beets really wants to run on a mac or a linux machine.
The amplitude looks to require node, which I looked at a little for a previous project, but never really understood how that works.
So I don't have much faith that I could get either of these running on my android phone.
Thanks Randy - what do you mean by "require node"
AFAIK, AmplitudeJS is a library of HTML5 stuff so it really depends on the browser that runs on the device - & all web browsers support HTML5, I believe?

Instead I started looking for android open source music players, found this one
https://github.com/vanilla-music/vanilla

It can be built in Android Studio
https://developer.android.com/studio/index.html
Which looks like a nice environment for building and debugging

I know your choices would be multi-platform, but honestly I think they are beyond my skills. Vanilla music may also be beyond my skills too lol.
But I'll spend some time looking at the code, and see if I can figure it out.

Randy
I already looked at Vanilla Music & installed it on my phone but I couldn't find (through it's settings) how to scan a network drive for music files - maybe I'm just missing it?
This, I imagine, is another requirement for any playback software is that it can access audio files from the WiFi LAN, not just from local storage -
Last edited by jkeny on Fri Apr 13, 2018 8:44 pm, edited 1 time in total.
www.Ciunas.biz
For Digital Audio playback that delivers WHERE the performers are on stage but more importantly WHY they are there.
jkeny
Posts: 2387
Joined: Sun Jan 17, 2010 9:37 pm

Re: SD player UI development

Post by jkeny »

I came across this bridge technology or API for music libraries which may answer the network storage issue - Aura
"AURA is an API specification for music libraries. Music players—from HTML5 applications to mobile apps to
embedded devices—use AURA to access servers that host catalogs of music. An AURA server can act as a personal
alternative to centralized cloud services like Spotify or Rdio.
The AURA protocol is a lightweight and open alternative to DLNA or DAAP.
https://media.readthedocs.org/pdf/auras ... raspec.pdf

https://github.com/beetbox/aura

First, I guess we want to get something working with local storage music library but it's worth bearing in mind the limitations of local storage, particularly when using a phone/tablet
www.Ciunas.biz
For Digital Audio playback that delivers WHERE the performers are on stage but more importantly WHY they are there.
randytsuch
Posts: 395
Joined: Mon Aug 11, 2014 4:19 am

Re: SD player UI development

Post by randytsuch »

node.js
https://nodejs.org/en/

Looking at the amplitude install instructions, it uses node.js
But, maybe you don't need to understand node.js, just have it to do the install.

BTW, looks like you've gotten further in vanilla music than I did.
I looked at the code some, but was soon very lost :(

I'll take a look at that last link, but much of this is really over my head
MSI H81-P33 MB, Xeon E3-1225 V3, LPS/LIFEPO4 and Astron RS-12A, 240gb SSD music, 2nd SSD for OS, Mod SS PCIE USB card, Server2012 R2 Ess+AO+MQn, Amanero USB to DACEND ES9018 to Schiit Lyr amp to Senn HD 700 headphones
randytsuch
Posts: 395
Joined: Mon Aug 11, 2014 4:19 am

Re: SD player UI development

Post by randytsuch »

One other thing I figured out

Universal Music Player is an "official" google example for implementing a music player, so it might be useful.
https://github.com/googlesamples/androi ... er/#readme
MSI H81-P33 MB, Xeon E3-1225 V3, LPS/LIFEPO4 and Astron RS-12A, 240gb SSD music, 2nd SSD for OS, Mod SS PCIE USB card, Server2012 R2 Ess+AO+MQn, Amanero USB to DACEND ES9018 to Schiit Lyr amp to Senn HD 700 headphones
jkeny
Posts: 2387
Joined: Sun Jan 17, 2010 9:37 pm

Re: SD player UI development

Post by jkeny »

Has anybody actually tried the AmplitudeJS app on this page https://521dimensions.com/open-source/amplitudejs
It's not just a screen shot - it's a working version
Can people try it & point out any problems with it? No download needed - just choose a track from the playlist & press play
Looks good on desktop - also looks good on Android phone. Don't have an IOS phone can somebody try?

This is a fixed playlist hardcoded into the HTML source bu tit's picking up the cover art & audio tracks from a server

This is the HTML for the first entry - what we need is a way to not have this ino hard-coded but dynamically inserted. there is a way to do this with a method in AMplitudeJS called Add_song

Code: Select all

<div class="song-meta-data">
<span class="song-title">Risin' High (feat Raashan Ahmad)</span>
<span class="song-artist">Ancient Astronauts</span>
</div>
<a href="https://switchstancerecordings.bandcamp.com/track/risin-high-feat-raashan-ahmad" class="bandcamp-link" target="_blank">
<img class="bandcamp-grey" src="/img/open-source/amplitudejs/bandcamp-grey.svg" />
<img class="bandcamp-white" src="/img/open-source/amplitudejs/bandcamp-white.svg" />
</a>
<span class="song-duration">3:30</span>
</div>
<div class="song amplitude-song-container amplitude-play-pause" amplitude-song-index="1">
<div class="song-now-playing-icon-container">
<div class="play-button-container">
</div>
<img class="now-playing" src="/img/open-source/amplitudejs/now-playing.svg" />
</div>
www.Ciunas.biz
For Digital Audio playback that delivers WHERE the performers are on stage but more importantly WHY they are there.
randytsuch
Posts: 395
Joined: Mon Aug 11, 2014 4:19 am

Re: SD player UI development

Post by randytsuch »

Maybe I'm making it more complicated that it needs to be, wouldn't be the first time :/

I'll give it a shot in the next day or two.

Right now I'm using a pi and a hat dac in my system, so I'll need to connect my PC and soekris again, but that's pretty easy.

EDIT:
Just tried it on my iphone.
It worked, and it was easy to use, didn't realize you could just hit play lol

Randy
MSI H81-P33 MB, Xeon E3-1225 V3, LPS/LIFEPO4 and Astron RS-12A, 240gb SSD music, 2nd SSD for OS, Mod SS PCIE USB card, Server2012 R2 Ess+AO+MQn, Amanero USB to DACEND ES9018 to Schiit Lyr amp to Senn HD 700 headphones
randytsuch
Posts: 395
Joined: Mon Aug 11, 2014 4:19 am

Re: SD player UI development

Post by randytsuch »

John
So I think I figured out what amplitude does.

Its a java script program that generates a web page (HTML).

So we can open that web page from any device, iphone, android or PC, and then control amplitude.
But you would need to be running a local version of amplitude on some machine that supports java script. A pi would be fine I expect. Even a pi zero w.

The code needs to change to read the wifi sd card directory, get the flac tag information for each song, and then populate the fields you included above with this information.

And then when the play routine is called, it needs to call a special routine we'd create to send the commands to the player. This special routine will have to figure out the button pushes required to play the right song.

In this scenario, since the phone or whatever is just accessing a web page, I think using an ESP to control relays or optos to push buttons may make more sense. I'm pretty sure I can do this part of it fairly easily, with open source software and not too much hardware. I'd use an ESP instead of an arduino for its built in wifi interface. Plus I already ordered one just in case lol.
MSI H81-P33 MB, Xeon E3-1225 V3, LPS/LIFEPO4 and Astron RS-12A, 240gb SSD music, 2nd SSD for OS, Mod SS PCIE USB card, Server2012 R2 Ess+AO+MQn, Amanero USB to DACEND ES9018 to Schiit Lyr amp to Senn HD 700 headphones
jkeny
Posts: 2387
Joined: Sun Jan 17, 2010 9:37 pm

Re: SD player UI development

Post by jkeny »

randytsuch wrote: Sat Apr 14, 2018 12:44 am John
So I think I figured out what amplitude does.

Its a java script program that generates a web page (HTML).

So we can open that web page from any device, iphone, android or PC, and then control amplitude.
But you would need to be running a local version of amplitude on some machine that supports java script. A pi would be fine I expect. Even a pi zero w.
Yes, Randy, I'm still getting my head around it - AFAICS, it's a library of HTML5 routines that provides a richer set of functionality but it may be overkill? I'm now looking at HTML5 audio players - they all run natively in the main browsers & are open source
The code needs to change to read the wifi sd card directory, get the flac tag information for each song, and then populate the fields you included above with this information.
This was the way I originally thought it would work too - host the music library on a 32GB SD Flashair card but I think this is the wrong approach for a number of reasons - complexity of synching the navigation through folders/tracks on both control device & SD card. it might be better to store the music library on network storage & only transmit a playlist folder to the SD card - only one folder makes for much easier navigation synching - only up/down stepping through tracks
And then when the play routine is called, it needs to call a special routine we'd create to send the commands to the player. This special routine will have to figure out the button pushes required to play the right song.
Yes, all button presses on control device (navigation/play/stop) would have to be sent to the SD card. So I would leave existing code & add whatever is needed to transmit the button action codes. That way our control device is aping what's happening on the SDP - this has the added benefit that when we start playing a track it will play on both control device (mute it) & SDP & the track progress can be approx right between the two devices
In this scenario, since the phone or whatever is just accessing a web page, I think using an ESP to control relays or optos to push buttons may make more sense. I'm pretty sure I can do this part of it fairly easily, with open source software and not too much hardware. I'd use an ESP instead of an arduino for its built in wifi interface. Plus I already ordered one just in case lol.
I still think IR transmitter is easier but it would be good to have other approaches

I was going to order some of those ESP boards from taobao along with my SDP - I like the IoT stuff & these cards will be very handy & cheap ($1.50) - thanks for the tip. I'm wondering if a NodeMcu is a better option as it has USB & the same price?
www.Ciunas.biz
For Digital Audio playback that delivers WHERE the performers are on stage but more importantly WHY they are there.
randytsuch
Posts: 395
Joined: Mon Aug 11, 2014 4:19 am

Re: SD player UI development

Post by randytsuch »

Hey John
I need to finish my taxes today, but after that I'll look at it some more.
Might be able to run Amplitude on my macbook, we'll see.

I was thinking we'd delete the playback on the control device, but what you say about running on both makes sense. Plus less likely to break anything by adding code.

For IR vs wifi in a esp, since I have used esp's before, I'm more comfortable with that approach, probably why I won't give up on it lol.
And yeah, it would be good to have a couple methods here, options are always good.

Wemos vs NodeMCU, from what I remember they are basically the same. The Wemos Pro had more memory and a better wifi antenna I think. Wemos has usb too, and I think its very similar to the NodeMCU card. I think I happened to find the Wemos, it looked good and was cheap enough, so I went with it.

Wemos also has some other cards I used
These triple bases (they make a double size one too) are cool, they make it easier to add other boards and connect stuff up the the main board
https://www.aliexpress.com/store/produc ... 719fTvVyuh
I used it like a motherboard, also makes it easy to remove and/or replace the main board if it fails or if you suspect problems with it.

Randy
MSI H81-P33 MB, Xeon E3-1225 V3, LPS/LIFEPO4 and Astron RS-12A, 240gb SSD music, 2nd SSD for OS, Mod SS PCIE USB card, Server2012 R2 Ess+AO+MQn, Amanero USB to DACEND ES9018 to Schiit Lyr amp to Senn HD 700 headphones
Post Reply