Page 6 of 9

Re: 1/29/2013 Plugin: Random Music Player 1.0

PostPosted: Fri Mar 15, 2013 10:20 am
by KAD
is it normal for the audio file to open as a video file?


I decided to take a look at /usr/bin/upnp-meta

it appears the codec info generated in the meta is
either
*
or an image codec

so it seems the wd just assumes a video file if no info is provided

I'll need to test, but it seems reasonable, if we provided audio codec info in the upnp-meta
that WD would then use the music player to initiate playback, instead of the video player

Re: 1/29/2013 Plugin: Random Music Player 1.0

PostPosted: Fri Mar 15, 2013 11:57 am
by mad_ady
Well, it's about time you learned how to use it. It may prove useful in the future.

Try this for size: http://tovid.wikia.com/wiki/SVN_crash_course

The basics steps are:
1. You check out the source tree in a new directory on your hdd
2. You add/change code
3. If you added new files that were not part of the original code you will need to do "svn add dir-name"
4. When you are ready to commit your changes, do a svn diff to see what would get changed
5. To commit something do svn commit -m "my comment goes here"
6. Profit.

You can commit part of the code if you run the svn commit in a subdirectory of the tree you checked out.

Re: 1/29/2013 Plugin: Random Music Player 1.0

PostPosted: Fri Mar 15, 2013 12:00 pm
by KAD
ok, will take a look

Re: 1/29/2013 Plugin: Random Music Player 1.0

PostPosted: Fri Mar 15, 2013 5:45 pm
by sonic_blue
I'm finding that after approximately 20 songs the OSD crashes and doesn't respond to any remote commands. Music still continues to play on shuffle, and RandomMusicPlayerLoop.log reports that it is still running fine, but dmaosd.log is saying it's crashed on some error.

I searched the forum and found a comment where you said that if you initiate a Play command while something is already playing back, that it will crash the OSD. So, maybe that is happening, I don't really know.

I am interested to try and play the files as audio using unpnp-cmd meta to see if that helps.

Re: 1/29/2013 Plugin: Random Music Player 1.0

PostPosted: Fri Mar 15, 2013 6:46 pm
by sonic_blue
KAD wrote:
is it normal for the audio file to open as a video file?


I decided to take a look at /usr/bin/upnp-meta

it appears the codec info generated in the meta is
either
*
or an image codec

so it seems the wd just assumes a video file if no info is provided

I'll need to test, but it seems reasonable, if we provided audio codec info in the upnp-meta
that WD would then use the music player to initiate playback, instead of the video player


It works! I just added to /usr/bin/upnp-meta:

Code: Select all
if [ `echo "$fileName" | grep -q -i '\.mp3$'; echo $?` -eq 0 ]; then codec="audio/mp3"; fi
if [ `echo "$fileName" | grep -q -i '\.wma$'; echo $?` -eq 0 ]; then codec="audio/wma"; fi
if [ `echo "$fileName" | grep -q -i '\.mpa$'; echo $?` -eq 0 ]; then codec="audio/mpa"; fi
if [ `echo "$fileName" | grep -q -i '\.m4a$'; echo $?` -eq 0 ]; then codec="audio/m4a"; fi
if [ `echo "$fileName" | grep -q -i '\.mp4a$'; echo $?` -eq 0 ]; then codec="audio/mp4a"; fi
if [ `echo "$fileName" | grep -q -i '\.ogg$'; echo $?` -eq 0 ]; then codec="audio/ogg"; fi
if [ `echo "$fileName" | grep -q -i '\.wav$'; echo $?` -eq 0 ]; then codec="audio/wav"; fi
if [ `echo "$fileName" | grep -q -i '\.aac$'; echo $?` -eq 0 ]; then codec="audio/aac"; fi
if [ `echo "$fileName" | grep -q -i '\.flac$'; echo $?` -eq 0 ]; then codec="audio/flac"; fi
if [ `echo "$fileName" | grep -q -i '\.aif$'; echo $?` -eq 0 ]; then codec="audio/aiff"; fi
if [ `echo "$fileName" | grep -q -i '\.aiff$'; echo $?` -eq 0 ]; then codec="audio/aiff"; fi
if [ `echo "$fileName" | grep -q -i '\.mka$'; echo $?` -eq 0 ]; then codec="audio/mka"; fi



Need to write some lines to get Pause, FFWD, REW to work. And metadata to the Audio playback screen.

Re: 3/15/2013 Plugin: Random Music Player 1.1

PostPosted: Fri Mar 15, 2013 7:28 pm
by KAD
bump ver 1.1

@sonic_blue
looks like we're testing this at the same time

update has working stop button for audio_ex_playing.xml
also moved the log file to the root of the plugin path
maybe dmaosd is running out of memory that log file I'd guess could get pretty large

Re: 3/15/2013 Plugin: Random Music Player 1.1

PostPosted: Fri Mar 15, 2013 7:49 pm
by sonic_blue
Is there a list of all the xml files which correspond to which page you are on at the OSD?

eg. villa_home.xml I presume refers to the main menu.

Re: 3/15/2013 Plugin: Random Music Player 1.1

PostPosted: Fri Mar 15, 2013 7:53 pm
by KAD
nope, there's no list

but here's how I always find the xml
tail -f /tmp/dmaosd.log

then start navigating the osd
anytime you leave an xml it will log
..................audio_ex_playing.xml is popped

whatever xml is popped that corresponds to the screen you just exit

Re: 3/15/2013 Plugin: Random Music Player 1.1

PostPosted: Fri Mar 15, 2013 9:46 pm
by sonic_blue
I would like to add a unpnp-cmd Pause command inside the .js file, however I'm unsure how to do it.

Would this be correct, and if so, what is the correct key value for Pause.

Code: Select all
if ((page.markupFileName === "audio_ex_playing.xml") && (this.RandomMusicPlayer === true || this.RandomVideoPlayer === true)) {
      if (key == pause) {
         res = executeCmd("upnp-cmd Pause", this.debug.Lib);
}

Re: 3/15/2013 Plugin: Random Music Player 1.1

PostPosted: Fri Mar 15, 2013 10:16 pm
by sonic_blue
Trying to get FFWD and REW working like so:

Code: Select all
#upnp-cmd seek REL_TIME 00:01:33
[faultcode] => s:Client
[faultstring] => UPnPError
[detail] => 402Illegal value


Any idea what's wrong with this? Seems like I've given it the correct seek value. Tried it with " and ' as well.

edit: seems the parameter names are wrong.