Re: [SlimDevices: Plugins] Announce: CDplayer plugin

2015-02-27 Thread Viator

For systems using udev I wrote two scripts which allows to austostart a
CD when the CD inserted into the drive.

The great thing with udev is, that udev supplies the number of tracks.

The first is a very simple rule for udev.
It just tells udev to run a script whenever there was a change in the
status of the cddrive.

create a file named 20-cdrom-media-change.rules in /etc/udev/rules.d/

put the following in the file:

Code:


  KERNEL=="sr?", SUBSYSTEM=="block", ACTION=="change", 
RUN+="/usr/bin/cd_media_changed.sh"
  



This will tell udev to call the script /usr/bin/cd_media_changed.sh

If you have more than one drive, adjust sr? to what your drive used to
play music actually is. i.e. sr0 or sr1 or ...


The second script will create a playlist and tell the server to use this
playlist to play.
create a file named cd_media_changed.sh in /usr/bin/ and make it
executable.

Place the following content into the file and
*_adjust_the_settings_to_your_own_needs_as_stated_in_the_code._This_is_important!_*.


Code:


  #! /bin/sh
  
  
  # adjust this to your needs
  server_ip="127.0.0.1"
  server_port="9000"  # on my qnap this is 9001
  
  # this is the path to your playlistfolder as specified
  # in the settings of squeezbox server, logitech media server
  # + the filename of the playlist (name it whatever you want)
  playlist="/home/squeezebox/playlists/current_cd.m3u"
  
  #>>  IMPORTANT <<<
  # commands need to be urlencoded.
  # use http://meyerweb.com/eric/tools/dencoder/
  # or replace any = with %3D
  #& with %26
  #/ with %2F
  #
  # urlencoded path to playlist
  playlist_enc="%2Fhome%2Fsqueezebox%2Fplaylists%2Fcurrent_cd.m3u"
  
  # urlencoded for 
p0=playlist&p1=play&p2=/home/squeezebox/playlists/current_cd.m3u
  cmd_play_enc="p0%3Dplaylist%26p1%3Dplay%26p2%3D"$playlist_enc
  
  # urlencoded for p0=playlist&p2=clear
  cmd_clear_enc="p0%3Dplaylist%26p1%3Dclear"
  
  # compute complete url
  server_url="http://"$server_ip":"$server_port"/status.html?";
  
  # check if cd has been inserted or ejected
  if [ "$ID_CDROM_MEDIA_CD" == "1" ]
  then
  
  # start new playlistfile
  textout="#CURTRACK 0\n"
  textout=$textout"#EXTM3U\n"
  
  # create one entry for each track
  for ((i=1;i<=$ID_CDROM_MEDIA_TRACK_COUNT;i++))
  do
  # write out #EXTURL:cdplay://1 ...
  textout=$textout"#EXTURL:cdplay://$i\n"
  # write out #EXTINF:-1,Track 1 ...
  textout=$textout"#EXTINF:-1,Track $i\n"
  # write out cdplay://1 ...
  textout=$textout"cdplay://$i\n"
  done
  
  # write playlist
  echo -e $textout > $playlist
  
  # tell server to use and play the playlist
  wget -t1 -q -O- $server_url$cmd_play_enc >> /dev/null
  
  else # EJECTED
  #clear playlist - stop playing
  wget -t1 -q -O- $server_url$cmd_clear_enc >> /dev/null
  # delete playlist
  rm $playlist
  fi
  



Unfortunately I have not found out yet how to tell SB/LMS to display
"Track 1","Track 2",""  instead of "Unknown Track".
On my Squeezeplay it also displays "Track 1 of 12" even if Track 7 is
played.

If someone has a solution for this, please post it.


Have fun.



Viator's Profile: http://forums.slimdevices.com/member.php?userid=63789
View this thread: http://forums.slimdevices.com/showthread.php?t=47288

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins


Re: [SlimDevices: Plugins] Announce: CDplayer plugin

2015-02-26 Thread Viator

I've done some testing.

udev does the trick for bluetooth and cd.

netstat -tn | grep -e "6600" -e "5002" does it for upnp and airplay.



Viator's Profile: http://forums.slimdevices.com/member.php?userid=63789
View this thread: http://forums.slimdevices.com/showthread.php?t=47288

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins


Re: [SlimDevices: Plugins] Announce: CDplayer plugin

2015-02-26 Thread Viator

bpa wrote: 
> I'm not sure of the exact solution but the way to start would be to
> create a plugin (need to learn a little Perl and LMS internals) which
> handles a new URL type e.g. "viator://" and  the rest of the URL would
> be processed by the plugin which eventually spits out a normal LMS
> playable URL such as CDDA://1 or wavin: depending on what available.
> 
> For esxample, the BBCiPlayer plugin has an iplayer:// URL which include
> the 3 URLS to be tested by the plugin to see which one works for the
> user and then the best working one is used by LMS.


As far as I understand it, I would have to select viator:// every time a
change occours.
Or is the plugin running in the background to monitor any changes?
Anyway, I still have to find out how to recognize that there is a
change.

I thought about some shell scripts to detect changes/connections and
then simply use the http interface of LMS to change whats played. I find
the http interface easier to use (for me, since I use it with tasker)
rather than learning Perl.



Viator's Profile: http://forums.slimdevices.com/member.php?userid=63789
View this thread: http://forums.slimdevices.com/showthread.php?t=47288

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins


Re: [SlimDevices: Plugins] Announce: CDplayer plugin

2015-02-26 Thread Viator

bpa wrote: 
> I spent a lot of time with Bluetooth and alsa and I have a collection of
> BT adaptors to prove it. I think Bluez(4 or was it 5 ?) was a step
> backward in functionality (and lack of documentation) and pulseaudio as
> an unnecessary evil as it should be optional not default.  It seems the
> underlying systems make it  much harfder than it should be.

Latest Arch comes with Bluez5 and I totally agree with you. Some time
ago I've tried an older version of Bluez and I've been able to setup
sime kind of autopairing which seems to be impossible with Bluez5 (at
least I can not find any documentation for this). One has to log into
SSH to pair a mobile which makes Bluetooth more or less useless for for
a headless player.




bpa wrote: 
> Not sure what you mean by "some client" as each of those use different
> subsystems and present different end user interfaces - can you say which
> client application can play any / all of these to standard audio ?

I will explain the hole project.

Some time ago I bought a SB touch which was not used for years. This
days I thought to install a soundsystem in my gf's flat. Using a qnap as
LMS, the SB touch and a Raspi with Picoplayer. Then I had the "glorious"
idea to put the Raspi into a vintage radio as a present to her ;-) Then
I had the idea to use an USB CD to make her able to play cds as well.
This leads me to the idea to be able to connect a USB stick as well
which lead me to the idea to put a HD into this vintage Radio to make
this radio the LMS server for the system so I can rid of the QNAP. So if
she has such a nice radio it would be nice to be able to allow guests to
play from their devices. This leads me to Bluetooth, Airplay and making
the radio a UPnP Client as well as beeing able to connect i.e. a iPod
nano (my GF has 2 of them) by using line-in. Voila. Thats it.

Now, my GF is not really a techie. In fact shes more of the kind using
google (on startpage) to find google ;-) So I wanted to have it as easy
to use as possible. I wrote some scripts for tasker to make her (and of
course me as well) able to controll LMS by using the android. First
attempt was just to use tasker with NFC wich turned out not to be
practical since one has to unlock the mobile to be able to recognize
NFC. Tasker allows to put the actions as widgets on the mobile, so I did
this. This is working fine and it's very usefull since we now have a
radio alarm controlled by the alarm of the mobile and it mutes the sound
when a call is in place.

What I have now is a Raspi B with LMS, your great wavin and cd plugins,
Bluetooth, Airplay, mpd as UPnP client and line-in as sources.
Bluetooth, Airplay, mpd and line-in are mixed into one stream using
alsa. This can be played using a favourite with wavin. (It's also
possible to select them as individual sources but that's not what I
want)

This limits the sources one has to handle. Just have to select
"External" as source.

The next step of evolution is to automatically select "External" as soon
as Client connects to the "radio".

Line in will be becomes detected by a simple switch whenever the plug is
plugged. 
I think bluetooth possibly can be detected by using udev. Not shure,
have to check this. CD for shure can be detected this way.
But I have no idea how to check if a client (i.e a guests mobile)
connects via Airplay or UPnP (i.e using MPdroid). I thought about
periodically to check wether a specific port is in use or not. But as
sayed, I have really no idea if this is a usefull aproach.



Viator's Profile: http://forums.slimdevices.com/member.php?userid=63789
View this thread: http://forums.slimdevices.com/showthread.php?t=47288

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins


Re: [SlimDevices: Plugins] Announce: CDplayer plugin

2015-02-26 Thread Viator

Hello!

bpa wrote: 
> Why not create a playlist in a file with many tracks say CDDA://1
> CDDA://2 ..CDA://20

Had the same idea after going to bed. I think I will do this. Not the
most elegant way but the by far easiest and it's working. At the moment
I'm a bit tired of tinkering around to get all the bits and pieces to
work. Took me ages to get bluetooth with pulseaudio and line-in from
soundcard to work with alsa. (If someone is interested in this, pls
contact me, I can post a rough guide and the config files)



May I ask you a totally different question? You seem to be much more
into Linux than I be (although in IT since 20 Years, I'm just a newbie
to Linux with a very steep learning curve). Do you have any idea how to
check if some client did connect to Bluetooth (blueZ + pulseaudio),
Airplay (Shairport) or UPnP (using mpd as UPnP client)? This would allow
me to automatically switch to wavin as Source for LMS.



Viator's Profile: http://forums.slimdevices.com/member.php?userid=63789
View this thread: http://forums.slimdevices.com/showthread.php?t=47288

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins


Re: [SlimDevices: Plugins] Announce: CDplayer plugin

2015-02-25 Thread Viator

Hello!

It's me again ;-) This time I don't have such a stupid problem than last
time but just a question.

I would like to have the CD autostarted when I insert the CD into the
player. This is a easy task by using the webinterface it's just calling
a url to add and play a favourite (aka a playlist) to the player. But -
obviously  - this requires a favorite.

So my question is: Is there any chance to create a favourite which plays
all titles from the cd? Coverart and Artistname/Trackname is not
important, it could just show something like "CD" or even the
information of the first finding from cddb.

Thank you again for your help and spending time.



Viator's Profile: http://forums.slimdevices.com/member.php?userid=63789
View this thread: http://forums.slimdevices.com/showthread.php?t=47288

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins


Re: [SlimDevices: Plugins] Announce: WaveInput for Linux

2015-02-18 Thread Viator

bpa wrote: 
> I should also apologise - I wasn't being critical of your english and
> sorry if it came across as that.
> By "plain english" I meant - "explain what you want to happen with no
> technical details" and you have done that.

Never mind, I googled the meaning of"plain english". After that I've
just not been shure that my english was understandable.


bpa wrote: 
> 
> The URL should be *wavin:*plughw:1
> 

Argl, thats it. Sometimes things are so easy and I've spend ages and I
read every posting in this thread to fix the problem.
I'm pretty shure that "wavein:" was the default. Anyway, Changed it,
clicked on play and "voila" it's working. Thank you so much for your
help. And also thank you for the great plugins.



Viator's Profile: http://forums.slimdevices.com/member.php?userid=63789
View this thread: http://forums.slimdevices.com/showthread.php?t=49584

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins


Re: [SlimDevices: Plugins] Announce: WaveInput for Linux

2015-02-18 Thread Viator

bpa wrote: 
> I don't understand your point.  I think you do not understand what
> wavein does.
> 
> Wavin plugin is used on a LMS server. Wavein is used copies that audio
> source (often what is playing on server audio out but can be a Line-in
> on the server)  from the LMS server to the SB player.
> 
> Typically user has browser playing a radio station stream on LMS server
> PC audio and wants the same audio to be played out an SB player.
> 
> Please describe your setup (LMS server, player, audio source to be
> copied to SB player) and what you want to do in plain english.

Sorry for my english, I'm not a native speaker. I will try to make
things as clear as possible.

I have one Raspberry Pi serving as LMS Server, another Raspberry Pi as
Player in RoomA and a Squeezebox Touch as Player in RoomB. RoomA and
RoomB are synced. Currently LMS Serves Audio Streams (Radio), mp3 and CD
Audio which workes fine. 

I also want to stream from the LineIn of the soundcard connected to the
LMS to the players. As far as I understood that is what WaveIn should be
for. Pls correct me if I'm wrong.


So the chain should look like this.

LAN - WebRadio -\
HDD - mp3 - \- LMS  - WLAN - /  Room A
CD Drive - CD Audio - /   \  Room B
SoundCard - LineIn  -/

I can record from LineIn to a wave file using "arecord -D plughw:1  -f
cd test.wav" and I can play this using "aplay -D plughw:1 test.wav".

I have created a Favourite named "Line In" with the parameter
"wavein:plughw:1"

What I have done to produce the logfile in my last post was:

- Playing a stream from webradio
(http://opml.radiotime.com/Tune.ashx?id=s44255&formats=aac,ogg,mp3,wma,wmvoice&partnerId=16&serial=a7a5d66134588d3135a8bc03f8a096ce)
which played fine.
- Then I klicked on play on the Favourite "LineIn".
- The webradio was terminated and the playlist showed "empty"


bpa wrote: 
> Review the  stesp I told you about the log. Your log showed no use of
> the Wavein plugin even if not working the log will still be about 30-50
> lines long.
This also makes me wonder. But WaveIn seems to be loaded. When I start
LMS I get the following entry in the log:


Code:


  [15-02-18 11:17:04.4774] Plugins::WaveInput::Plugin::BEGIN (29) Settings 
called
  [15-02-18 11:17:04.6638] Plugins::WaveInput::Plugin::initPlugin (42) 
Initialising 1.04
  [15-02-18 11:17:04.6687] Plugins::WaveInput::Settings::new (34) New Settings
  [15-02-18 11:17:04.6764] Plugins::WaveInput::Settings::init (95) Initializing 
settings
  




Viator's Profile: http://forums.slimdevices.com/member.php?userid=63789
View this thread: http://forums.slimdevices.com/showthread.php?t=49584

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins


Re: [SlimDevices: Plugins] Announce: WaveInput for Linux

2015-02-18 Thread Viator

Hello! Thank you for the fast response!

bpa wrote: 
> 1. Enable WebUI Settings/Advanced/Logging player.source to DEBUG and
> click Apply
> 2. Note the time
> 3. Try playing the wavein favorite to record audio
> 4. Stop the stream on the player.
> 5. Copy log file entries from noted time to end of log into a text file
> , zip it and attach to a post

>From my point of view it seems that the actual stream - which is radio -
will be stopped but the waveIn will never be started.

The log is quite short, so i will post it directly in here:

Should I enable some other logs? So far the only logs enabled are
player.source and plugin.waveinput


Code:


  [15-02-18 09:12:51.4416] Slim::Player::StreamingController::stop (2208) 
00:0c:29:24:f2:63
  [15-02-18 09:12:51.4473] Slim::Player::StreamingController::_eventAction 
(271) 00:0c:29:24:f2:63: Stop in PAUSED-STREAMING -> 
Slim::Player::StreamingController::_Stop
  [15-02-18 09:12:51.4567] Slim::Player::StreamingController::_Stop (603) Song 
queue is now 0
  [15-02-18 09:12:51.4621] Slim::Player::SongStreamController::DESTROY (44) 
DESTROY(Slim::Player::SongStreamController=HASH(0x54ffe38)) live=0
  [15-02-18 09:12:51.4674] Slim::Player::StreamingController::_setPlayingState 
(2479) new playing state STOPPED
  [15-02-18 09:12:51.4725] 
Slim::Player::StreamingController::_setStreamingState (2492) new streaming 
state IDLE
  [15-02-18 09:12:51.4790] Slim::Player::StreamingController::_eventAction 
(303) 00:0c:29:24:f2:63: Stop - new state STOPPED-IDLE
  [15-02-18 09:12:51.4844] Slim::Player::Song::DESTROY (160) 
DESTROY(Slim::Player::Song=ARRAY(0x552d300)) live=1: index=0, 
url=http://opml.radiotime.com/Tune.ashx?id=s44255&formats=aac,ogg,mp3,wma,wmvoice&partnerId=16&serial=a7a5d66134588d3135a8bc03f8a096ce
  [15-02-18 09:12:51.4899] Slim::Player::StreamingController::resetSongqueue 
(1848) Song queue is now 
  [15-02-18 09:12:51.5628] Slim::Player::StreamingController::_eventAction 
(271) 00:0c:29:24:f2:63: StatusHeartbeat in STOPPED-IDLE -> 
Slim::Player::StreamingController::_NoOp
  [15-02-18 09:12:52.0084] Slim::Player::StreamingController::_eventAction 
(271) 00:0c:29:24:f2:63: StatusHeartbeat in STOPPED-IDLE -> 
Slim::Player::StreamingController::_NoOp
  [15-02-18 09:12:57.0124] Slim::Player::StreamingController::_eventAction 
(271) 00:0c:29:24:f2:63: StatusHeartbeat in STOPPED-IDLE -> 
Slim::Player::StreamingController::_NoOp
  [15-02-18 09:13:02.0097] Slim::Player::StreamingController::_eventAction 
(271) 00:0c:29:24:f2:63: StatusHeartbeat in STOPPED-IDLE -> 
Slim::Player::StreamingController::_NoOp
  [15-02-18 09:13:07.0101] Slim::Player::StreamingController::_eventAction 
(271) 00:0c:29:24:f2:63: StatusHeartbeat in STOPPED-IDLE -> 
Slim::Player::StreamingController::_NoOp
  [15-02-18 09:13:12.0091] Slim::Player::StreamingController::_eventAction 
(271) 00:0c:29:24:f2:63: StatusHeartbeat in STOPPED-IDLE -> 
Slim::Player::StreamingController::_NoOp
  [15-02-18 09:13:17.0106] Slim::Player::StreamingController::_eventAction 
(271) 00:0c:29:24:f2:63: StatusHeartbeat in STOPPED-IDLE -> 
Slim::Player::StreamingController::_NoOp
  




Viator's Profile: http://forums.slimdevices.com/member.php?userid=63789
View this thread: http://forums.slimdevices.com/showthread.php?t=49584

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins


Re: [SlimDevices: Plugins] Announce: WaveInput for Linux

2015-02-17 Thread Viator

Hi!

I've been trying for about 3 days to get the WaveIn Plugin running on my
rasperry and I have no idea what I can do anymore.

As mentioned I have a Raspberry Pi Model B running Arch Linux and LMS
7.8. LMS is running fine and also the CD-Player Plugin is working fine
(after I found out, that I have to add the user running LMS to group
"optical"). Thanky very much for this plugin.

I can run arecord -D plughw:1 to record audio data and I can play this
data.

I have created a favourite wavein:plughw:1 but when I click on play just
nothing happens. Playlist simply shows "empty". I tried to enable debug
in the protocol but the protocol stays more or less empty. Just
showing:

[15-02-17 15:45:31.7520] Plugins::WaveInput::Plugin::BEGIN (29) Settings
called
[15-02-17 15:45:32.7146] Plugins::WaveInput::Plugin::initPlugin (42)
Initialising 1.04
[15-02-17 15:45:32.7203] Plugins::WaveInput::Settings::new (34) New
Settings
[15-02-17 15:45:32.7288] Plugins::WaveInput::Settings::init (95)
Initializing settings

That's all and as mentioned I really have no idea where to look to find
the problem. Your help is really appreciated.



Viator's Profile: http://forums.slimdevices.com/member.php?userid=63789
View this thread: http://forums.slimdevices.com/showthread.php?t=49584

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins