Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 9 123 ... LastLast
Results 1 to 10 of 90
  1. #1
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    18,049

    Announce: SharkPlay plugin - radioSHARK player

    Announcing version 1.00 of SharkPlay - plugin which enables controlling & playing an FM/AM tuner from Griffin Technology - the USB radioSHARK2 ( http://www.griffintechnology.com/products/radioshark2 ). This version of the plugin only works on SC 7.1-7.2.

    The rationale for this plugin was
    - Reducing download usage (and charges) when listening to local radio.
    - Local radio internet feeds are poor quality compared to FM.
    - Ensure a reliable radio stream for alarm when ISP does not provide a reliable service.

    The plugin uses an small application called shark2 which sends command to radioSHARK to set the frequency and turn on/off the leds. The original shark2 application was written by Michael Rolig with subsequent mods by other (see http://javier.rodriguez.org.mx/index...-linux-shark2c )

    The Windows version of the plugin includes a Windows port of the shark2 utility and also uses the wavin2cmd utility written by Joe Bryan for the WaveInput plugin.

    Basic Operation.
    Once installed - there is a SharkPlay menu in Extras on WebUI, SB and SBC. Click on SharkPlay menu and you will a favorites list and a "manual tuning" entry where users can enter a frequency from webUI, SB remote or SBC controller.
    The Sharkplay favorites list is just like favorites. It seems to be useful to have the possibility to keep the FM/AM presets separate from Internet radio.

    A user can also make entries in the standard top-level Favorites with the URL prefix "shark://" so that the Favorite with URL "shark://104.0" will tune to FM 104.0 MHz and "shark://1090" would tune into AM 1090kHz.

    The user can add Title and Subtitle parameters to the URL to get extra text or override the Favorites name. for example shark://98.1?Title=Rock FM&Subtitle=live radio

    Windows Installation.
    1. Install and test radioSHARK. Make sure the installed software is at least v2.1 found here -
    http://www.griffintechnology.com/sof...SHARK_v2.1.exe and that all installation steps are performed including those in the Sound control panel.
    2. Using the Griffin Radio find a radio station with a good signal - note the frequency as you need this to test SC operation.
    3. Download the attached Zip file sharkplay-win-100.zip. This zip file includes necessary executables radioshark.exe and wavin2cmd.exe.
    4. Unzip the zipped file into server/Plugins so that you have a Plugins/SharkPlay
    5. Before starting SC make sure radioShark2 is installed and working as radioShark2 detection is only carried out at SC startup.
    6. Start SqueezeCenter - check in Settings there is a Plugin called SharkPlay and in Advanced/FileTypes there should be "RadioShark" entries enabled to use wavin2cmd.
    7. In Settings/Plugins/SharkPlay/Settings - The main setting is the Audio You can select the audio capture source to be used. The audio source is named slightly differently in XP and Vista so select a source with "radioSHARK" in the name.
    8. Optionally in Settings you can select whether you want the blue or red should light when in use.
    9. To test, Use Tune-in (or create a Favorite) with the URL shark://98.1 if your test frequency is 98.1 In practice you will use the frequency you noted in Step 2 instead of the example 98.1. AM/FM is decided by frequency number FM = 87.9-108 and AM 530-1750.

    On Windows it seems there is no lockout for the radioSHARK device, both the Windows radio app and SC plugin can use the radioSHARK audio stream - whichever app tunes last selects the frequency and LED display.

    Linux Installation.

    The shark2 application which is used to tune the radioSHARK requires access to USB devices. On most Linux system, USB devices have permissions such that only root can write to them. For this plugin to work either USB devices are opened to all users or shark2 is owned by root and marked such that it runs as root. The second method is preferred way as it does not open the USB devices. Some users are wary of unknown programs running as root in which case source code is provided for shark2 and those users can examine the code and build their own copy.

    The default installation assume an ALSA audio subsystems and that arecord is installed - this works for many mainstream distros (e.g. OpenSUSE, Ubuntu). To support OSS or use another app besides arecord - changes needs to be made to the custom-convert.conf file and the sharkplay.sh script.

    1. Stop SC
    2. The shark2 applications requires two Linux packages to be installed. Install libusb and libhid libraries usually through the distros package manager.
    3. Plugin radioShark.
    4. Download the sharkplay-linux-100.tar.gz file attached to this post.
    5. Untar the tar.gz file into server/Plugins such that you have a directory Plugins/SharkPlay. Change ownership and permissions of the files to suit your system.
    6. The following steps test shark2 application to make sure it works.
    6a. At a command prompt - cd to the Plugins/Sharkplay/Bin
    6b. try the command ./shark2 - you should get usage text of options.
    6c. If shark2 did not run with "Permission denied" - make sure it is executable by using the command chmod +x shark2. Try step 3b again.
    6d. Once you get the usage text then try the following command ./shark2 -red 1. If it works the radioSHARK red led will light - success go to step 4.
    If it fails with "hid_force_open failed with return code 7" means shark2 cannot find the radioSHARK USB device - check the cables and try step 6d again.
    If it fails with "hid_force_open failed with return code 12" it means shark2 cannot access USB devices and needs to be run as root. As root change owner of shark2 to root (i.e command chown root shark2 )and then set the Set UID bit on permissions (i.e. command chmod +s shark2 . Then try step 6d again.
    7. Check that Plugins/SharkPlay/Bin/sharkplay.sh is also executable by all users.
    8. Start SqueezeCenter - check in Settings there is a Plugin called SharkPlay and in Advanced/FileTypes there should be entries "RadioShark" enabled to use sharkplay.sh.
    9. In Settings/Plugins/SharkPlay/Settings the "Name of RadioShark audio stream device" field needs to have a valid device of ther forms hw:<cardno>,<device no> where <card number> and <device number> depends on your system. With Radioshark plugged in, use the arecord -l command. This will produce a number of lines of output - one line will be like
    card 1: radioSHARK [radioSHARK], device 0: USB Audio [USB Audio]
    So for this example the device is hw:1,0 as it is card 1 and device 0. For a standard PC the ALSA device hw:1,0 seems to work and so it is the default value.
    10. To test, Use Tune-in (or create a Favorite) with the URL shark://98.1 if your test frequency is 98.1 In practice you will use a local known frequency instead of the example 98.1. AM/FM is decided by frequency number FM = 87.9-108 and AM 530-1750.

  2. #2
    Senior Member
    Join Date
    Mar 2007
    Posts
    398
    Just out of curiosity is there a perceptible lag between SharkPlay and a regular radio?

    My main interest in this plugin would be for to play it between the two rooms which still have regular radios and the rest of the house which is Squeezecentered.

    TIA for all the hard work.

  3. #3
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    18,049
    There is a small lag maybe 0.25 sec - noticeable. It is probably due to network. On Windows it is about the same delay as when using WaveInput plugin as SharkPlay reuses the wavin2cmd application.

  4. #4
    Junior Member
    Join Date
    Oct 2008
    Posts
    22
    Sorry it took me a couple of days, work wouldnt let me play.
    This works great for me. I heard of people having problems with antenna strength but I'm in a city.

    So I installed the programs, unziped your files and setup the stations as you posted and away I went.
    This shows up on the Duet in the Extras section!!( XM doesnt for me)

    This is a great way to listen to the radio without using another device.


    The Radio Shark 2 says it can do timeshifting, have you messed with it?

  5. #5
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    18,049
    I deliberately put the Plugin in Extras on WebUI, SB and Duet controller menu. I felt putting real FM radio under "Internet Radio" would be confusing especially as in 7.3 Internet radio menu gets more entries and plugins are at the end.

    Timeshift is done by the Windows/Mac user application and not by the device or its driver.

    To timeshift on SC would require another application to save the audio stream to disk and hook into SC's FFW/REW mechanism - it's possible but not at the moment.

    I heard of people having problems with antenna strength but I'm in a city.
    On the radioshark2 the headphone jack on the back doubles as an external antenna port.

  6. #6

    Plug Help

    Thanks for the RadioShark plugin! I've been wanting a way to get FM radio on my SBs for awhile now.
    I just received my sharkplayer2 and installed everything per the instructions above. I can now listen to FM radio on my Duet player, but can not change stations using the SqueezeController. I hear whatever station is active using the main sharkplayer application.
    I also noticed that under the plugin settings page the only option available under "name of audio source" is "unassigned". Nothing else appears in the drop down list...

    What am I doing wrong? All help is appreciated, and thanks again for the plugin.

  7. #7
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    18,049
    What OS - Windows or Linux ? If Windows which version ?

    I'll guess it Windows as I think there is no RadioShark app for Linux.

    If Windows - it looks like the support apps in the Plugin Bin directory are not running.

    try the following.

    1. Open a command prompt window.
    2. change directory to the Plugins/SharkPlay/Bin directory.
    3. There should be 2 programs RadioShark.exe and Wavin2cmd
    4. type RadioShark followed by return - you should get a help text of the possible command such as the following which turn the RadioShark Red LED ON and OFF. Try the commands.
    RadioShark
    RadioShark -red 1
    RadioShark -red 0
    5. Next Try the wavin2cmd command. If it runs try the following command (the option is lowercase letter L not digit one)
    wavin2cmd
    wavin2cmd -l

    Did Radioshark.exe work (i.e. red led on/off) ?
    What is the output from "wavin2cmd -l" command ?

  8. #8

    Using Windows

    Hi,
    I am using Windows (XP)
    I tried your suggestions and;
    - the LED toggled between blue and red with the first command, but the command reported "Could not open HID device"
    - the "wavin2cmd -l" option returned
    "radioSHARK"
    "Realtek HD Digital Input"
    "Realtek HD Front Green Jack"
    "Realtek HD Front Pink Jack"
    "Realtek HD Audio rear input"

  9. #9
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    18,049
    The "Could not open HID device" message can be ignored as it is probably a Microsoft keyboard or mouse. All HID devices are checked to find thr RadioShark but some essential devices are inaccessible.

    OK - the support apps work wavin2cmd lists suitable sound sources and the RadioShark app turns on/off LED.

    What drive is your Windows directory on ? There was a bug if Windows was not on "C:" drive - I thought I had fixed it but the fix is not in the code. The fix requires to update one file (Fork.pm) in the SharkPlay plugin.

    To fix the non "C:" drive bug
    1. Stop SC
    2. Download the attached file Fork-pm.txt into a temporary area.
    3. Open an Explorer/File Manager window on the SharkPlay plugin files (e.g. \Program Files\Squeezecenter\server\Plugins\SharkPlay\ )
    4. Save a copy of the current Fork.pm file in case you need to revert.
    5. Copy and save the downloaded Fork-pm.txt as Fork.pm in the Plugins\SharkPlay directory.
    6. Restart SC and test.
    7. If still not working - reboot Windows and test. In Windows sometime a SC restart is not enough for a patched file to be used.

  10. #10

    Works now

    That did it! My windows drive is F: instead of C:
    I also noticed that "radioSHARK" now appears in the assigned drop down list so I selected that as well.

    Thanks for your help and a great plugin!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •