PeteManchester / MediaPlayer

61 stars 20 forks source link

Radio: stop/pause button #99

Closed e-roux closed 3 years ago

e-roux commented 3 years ago

Hello Pete,

I gave a try to the Lumin App as a control point on mac OS, work until now. It seems however that radio streams can not be stopped once on play.

May be the reason a pause request can be sent because of the UI and awaited is a stop request in Mediaplayer?

Thanks Emmanuel

PeteManchester commented 3 years ago

Hi Emmanuel,

Please can you provide a bit more detail, such as which source you are playing the radio from, is it from a MediaServer or the configured radio list in MediaPlayer etc.. You say it works until now, has something changed? Did you upgrade mediaplayer etc.

Also if possible please could you provide the mediaplayer log file that covers when you try to stop the radio stream.

Thanks,

Pete.

e-roux commented 3 years ago

mediaplayer version: I'm using the built from issue #98. Sorry, I meant by 'works' this built not the issue itself that a radio stream can be stopped with Lumin (never worked)

control point: lumin (on iOS), last version - 7.0.9 - from apple's app store.

issue description: Stopping a radio station seems not to work when clicking on the pause button. Radios are configured in the RadioList.json

From the second part of the log, at around 2021-10-20 14:45:00, I play a radio. At 2021-10-20 14:45:09, I click on the pause button from lumin's UI, a Pause Adapter message is seen but no effect on the player.

Friendly Name :     Cuisine
Version :           0.0.1.1
Host name  :            raspberrypi
StartTime :         Wed Oct 20 14:34:52 BST 2021
LocalTime :         Wed Oct 20 14:34:52 BST 2021
DST  :              Offset = 1
Timezone :          Europe/London, Greenwich Mean Time, British Summer Time

2021-10-20 14:34:52,857 [main] INFO  [org.rpi.config.Config] Logging Configured
2021-10-20 14:34:52,860 [main] FATAL [org.rpi.config.Config] ###Start of app.properties###
2021-10-20 14:34:52,862 [main] FATAL [org.rpi.config.Config] 'mediaplayer_enable_receiver' : 'true'
2021-10-20 14:34:52,862 [main] FATAL [org.rpi.config.Config] 'java_sound_software_mixer_enabled' : 'false'
2021-10-20 14:34:52,863 [main] FATAL [org.rpi.config.Config] 'mplayer_playlist' : 'asx,b4s,kpl,m3u,pls,ram,rm,smil,wax,wvx'
2021-10-20 14:34:52,863 [main] FATAL [org.rpi.config.Config] 'log_file_level' : 'info'
2021-10-20 14:34:52,863 [main] FATAL [org.rpi.config.Config] 'airplay_master_volume_enabled' : 'false'
2021-10-20 14:34:52,864 [main] FATAL [org.rpi.config.Config] 'airplay_port' : '5002'
2021-10-20 14:34:52,864 [main] FATAL [org.rpi.config.Config] 'mplayer_cache_min' : '80'
2021-10-20 14:34:52,864 [main] FATAL [org.rpi.config.Config] 'openhome_port' : '52821'
2021-10-20 14:34:52,865 [main] FATAL [org.rpi.config.Config] 'web_server_port' : '8088'
2021-10-20 14:34:52,865 [main] FATAL [org.rpi.config.Config] 'mediaplayer_playlist_max' : '1000'
2021-10-20 14:34:52,865 [main] FATAL [org.rpi.config.Config] 'mediaplayer_friendly_name' : 'Cuisine'
2021-10-20 14:34:52,866 [main] FATAL [org.rpi.config.Config] 'mediaplayer_max_volume' : '100'
2021-10-20 14:34:52,866 [main] FATAL [org.rpi.config.Config] 'log_console_level' : 'off'
2021-10-20 14:34:52,866 [main] FATAL [org.rpi.config.Config] 'web_server_enabled' : 'true'
2021-10-20 14:34:52,867 [main] FATAL [org.rpi.config.Config] 'java_soundcard_suffix' : '[PLUGHW:0,0]--PRIMARY SOUND DRIVER'
2021-10-20 14:34:52,867 [main] FATAL [org.rpi.config.Config] 'mpd_preload_timer' : '3'
2021-10-20 14:34:52,868 [main] FATAL [org.rpi.config.Config] 'mediaplayer_enable_avTransport' : 'true'
2021-10-20 14:34:52,868 [main] FATAL [org.rpi.config.Config] 'mediaplayer_player' : 'mpd'
2021-10-20 14:34:52,868 [main] FATAL [org.rpi.config.Config] 'mplayer_path' : '/usr/bin/mplayer'
2021-10-20 14:34:52,869 [main] FATAL [org.rpi.config.Config] 'openhome_log_level' : 'Error'
2021-10-20 14:34:52,869 [main] FATAL [org.rpi.config.Config] 'mediaplayer_save_local_playlist' : 'true'
2021-10-20 14:34:52,869 [main] FATAL [org.rpi.config.Config] 'log_file_name' : '/var/log/mediaplayer.log'
2021-10-20 14:34:52,870 [main] FATAL [org.rpi.config.Config] 'airplay_audio_start_delay' : 'false'
2021-10-20 14:34:52,870 [main] FATAL [org.rpi.config.Config] 'airplay_latency_enabled' : 'true'
2021-10-20 14:34:52,870 [main] FATAL [org.rpi.config.Config] 'mpd_host' : 'localhost'
2021-10-20 14:34:52,871 [main] FATAL [org.rpi.config.Config] 'mpd_port' : '6600'
2021-10-20 14:34:52,871 [main] FATAL [org.rpi.config.Config] 'airplay_enabled' : 'false'
2021-10-20 14:34:52,872 [main] FATAL [org.rpi.config.Config] 'mediaplayer_startup_volume' : '42'
2021-10-20 14:34:52,872 [main] FATAL [org.rpi.config.Config] 'mplayer_cache_size' : '520'
2021-10-20 14:34:52,872 [main] FATAL [org.rpi.config.Config] 'songcast_latency_enabled' : 'false'
2021-10-20 14:34:52,873 [main] FATAL [org.rpi.config.Config] ###End of app.properties####
2021-10-20 14:34:52,873 [main] INFO  [org.rpi.main.StartMe] Starting......
2021-10-20 14:34:52,878 [main] INFO  [org.rpi.utils.NetworkUtils] Getting Network Interfaces
2021-10-20 14:34:52,883 [main] INFO  [org.rpi.utils.NetworkUtils] Network Interface Display Name: 'eth0'
2021-10-20 14:34:52,884 [main] INFO  [org.rpi.utils.NetworkUtils] NIC Name: 'eth0'
2021-10-20 14:34:52,884 [main] INFO  [org.rpi.utils.NetworkUtils] IPAddress for Network Interface: eth0 : fe80:0:0:0:c9e:2cff:f318:5aff%eth0
2021-10-20 14:34:52,885 [main] INFO  [org.rpi.utils.NetworkUtils] IPAddress for Network Interface: eth0 : 2003:e8:970b:a100:f798:ce67:9e:76da%eth0
2021-10-20 14:34:52,885 [main] INFO  [org.rpi.utils.NetworkUtils] IPAddress for Network Interface: eth0 : 192.168.178.29
2021-10-20 14:34:52,886 [main] INFO  [org.rpi.utils.NetworkUtils] Network Interface Display Name: 'lo'
2021-10-20 14:34:52,886 [main] INFO  [org.rpi.utils.NetworkUtils] NIC Name: 'lo'
2021-10-20 14:34:52,887 [main] INFO  [org.rpi.utils.NetworkUtils] IPAddress for Network Interface: lo : 0:0:0:0:0:0:0:1%lo
2021-10-20 14:34:52,887 [main] INFO  [org.rpi.utils.NetworkUtils] IPAddress for Network Interface: lo : 127.0.0.1
2021-10-20 14:34:52,887 [main] INFO  [org.rpi.utils.NetworkUtils] End Of Network Interfaces
2021-10-20 14:34:52,888 [main] INFO  [org.rpi.main.StartMe] Available Audio Devices:
2021-10-20 14:34:53,078 [main] INFO  [org.rpi.main.StartMe] 'Port sndrpihifiberry [hw:0]'
2021-10-20 14:34:53,079 [main] INFO  [org.rpi.main.StartMe] 'Port II [hw:1]'
2021-10-20 14:34:53,079 [main] INFO  [org.rpi.main.StartMe] 'sndrpihifiberry [plughw:0,0]'
2021-10-20 14:34:53,096 [main] INFO  [org.rpi.main.StartMe] 'II [plughw:1,0]'
2021-10-20 14:34:53,097 [main] INFO  [org.rpi.main.StartMe] End Of Audio Devices
2021-10-20 14:34:53,098 [main] FATAL [org.rpi.main.StartMe] ###Setting Sound Card Name: #sndrpihifiberry [plughw:0,0]
2021-10-20 14:34:53,098 [main] INFO  [org.rpi.main.StartMe] JVM Version: 11.0.12
2021-10-20 14:34:53,099 [main] FATAL [org.rpi.main.StartMe] #####Start of System Properties#########
2021-10-20 14:34:53,109 [main] FATAL [org.rpi.main.StartMe] awt.toolkit=sun.awt.X11.XToolkit
2021-10-20 14:34:53,110 [main] FATAL [org.rpi.main.StartMe] file.encoding=UTF-8
2021-10-20 14:34:53,110 [main] FATAL [org.rpi.main.StartMe] file.separator=/
2021-10-20 14:34:53,111 [main] FATAL [org.rpi.main.StartMe] java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
2021-10-20 14:34:53,111 [main] FATAL [org.rpi.main.StartMe] java.awt.printerjob=sun.print.PSPrinterJob
2021-10-20 14:34:53,111 [main] FATAL [org.rpi.main.StartMe] java.class.path=mediaplayer.jar
2021-10-20 14:34:53,112 [main] FATAL [org.rpi.main.StartMe] java.class.version=55.0
2021-10-20 14:34:53,112 [main] FATAL [org.rpi.main.StartMe] java.home=/usr/lib/jvm/java-11-openjdk-armhf
2021-10-20 14:34:53,112 [main] FATAL [org.rpi.main.StartMe] java.io.tmpdir=/tmp
2021-10-20 14:34:53,113 [main] FATAL [org.rpi.main.StartMe] java.library.path=/usr/java/packages/lib:/usr/lib/arm-linux-gnueabihf/jni:/lib/arm-linux-gnueabihf:/usr/lib/arm-linux-gnueabihf:/usr/lib/jni:/lib:/usr/lib
2021-10-20 14:34:53,113 [main] FATAL [org.rpi.main.StartMe] java.runtime.name=OpenJDK Runtime Environment
2021-10-20 14:34:53,114 [main] FATAL [org.rpi.main.StartMe] java.runtime.version=11.0.12+7-post-Raspbian-2deb10u1
2021-10-20 14:34:53,114 [main] FATAL [org.rpi.main.StartMe] java.specification.name=Java Platform API Specification
2021-10-20 14:34:53,115 [main] FATAL [org.rpi.main.StartMe] java.specification.vendor=Oracle Corporation
2021-10-20 14:34:53,115 [main] FATAL [org.rpi.main.StartMe] java.specification.version=11
2021-10-20 14:34:53,115 [main] FATAL [org.rpi.main.StartMe] java.vendor=Raspbian
2021-10-20 14:34:53,116 [main] FATAL [org.rpi.main.StartMe] java.vendor.url=Unknown
2021-10-20 14:34:53,116 [main] FATAL [org.rpi.main.StartMe] java.vendor.url.bug=Unknown
2021-10-20 14:34:53,117 [main] FATAL [org.rpi.main.StartMe] java.version=11.0.12
2021-10-20 14:34:53,117 [main] FATAL [org.rpi.main.StartMe] java.version.date=2021-07-20
2021-10-20 14:34:53,117 [main] FATAL [org.rpi.main.StartMe] java.vm.info=mixed mode
2021-10-20 14:34:53,118 [main] FATAL [org.rpi.main.StartMe] java.vm.name=OpenJDK Server VM
2021-10-20 14:34:53,118 [main] FATAL [org.rpi.main.StartMe] java.vm.specification.name=Java Virtual Machine Specification
2021-10-20 14:34:53,118 [main] FATAL [org.rpi.main.StartMe] java.vm.specification.vendor=Oracle Corporation
2021-10-20 14:34:53,119 [main] FATAL [org.rpi.main.StartMe] java.vm.specification.version=11
2021-10-20 14:34:53,119 [main] FATAL [org.rpi.main.StartMe] java.vm.vendor=Raspbian
2021-10-20 14:34:53,120 [main] FATAL [org.rpi.main.StartMe] java.vm.version=11.0.12+7-post-Raspbian-2deb10u1
2021-10-20 14:34:53,120 [main] FATAL [org.rpi.main.StartMe] javax.sound.sampled.SourceDataLine=#sndrpihifiberry [plughw:0,0]
2021-10-20 14:34:53,121 [main] FATAL [org.rpi.main.StartMe] jdk.debug=release
2021-10-20 14:34:53,121 [main] FATAL [org.rpi.main.StartMe] line.separator=

2021-10-20 14:34:53,122 [main] FATAL [org.rpi.main.StartMe] os.arch=arm
2021-10-20 14:34:53,122 [main] FATAL [org.rpi.main.StartMe] os.name=Linux
2021-10-20 14:34:53,123 [main] FATAL [org.rpi.main.StartMe] os.version=5.10.63-v8+
2021-10-20 14:34:53,124 [main] FATAL [org.rpi.main.StartMe] path.separator=:
2021-10-20 14:34:53,124 [main] FATAL [org.rpi.main.StartMe] sun.arch.abi=
2021-10-20 14:34:53,125 [main] FATAL [org.rpi.main.StartMe] sun.arch.data.model=32
2021-10-20 14:34:53,126 [main] FATAL [org.rpi.main.StartMe] sun.boot.library.path=/usr/lib/jvm/java-11-openjdk-armhf/lib
2021-10-20 14:34:53,126 [main] FATAL [org.rpi.main.StartMe] sun.cpu.endian=little
2021-10-20 14:34:53,127 [main] FATAL [org.rpi.main.StartMe] sun.cpu.isalist=
2021-10-20 14:34:53,127 [main] FATAL [org.rpi.main.StartMe] sun.io.unicode.encoding=UnicodeLittle
2021-10-20 14:34:53,128 [main] FATAL [org.rpi.main.StartMe] sun.java.command=mediaplayer.jar
2021-10-20 14:34:53,128 [main] FATAL [org.rpi.main.StartMe] sun.java.launcher=SUN_STANDARD
2021-10-20 14:34:53,129 [main] FATAL [org.rpi.main.StartMe] sun.jnu.encoding=UTF-8
2021-10-20 14:34:53,129 [main] FATAL [org.rpi.main.StartMe] sun.management.compiler=HotSpot Tiered Compilers
2021-10-20 14:34:53,130 [main] FATAL [org.rpi.main.StartMe] sun.os.patch.level=unknown
2021-10-20 14:34:53,130 [main] FATAL [org.rpi.main.StartMe] user.country=GB
2021-10-20 14:34:53,131 [main] FATAL [org.rpi.main.StartMe] user.dir=/opt/mediaplayer
2021-10-20 14:34:53,132 [main] FATAL [org.rpi.main.StartMe] user.home=/opt/mediaplayer
2021-10-20 14:34:53,132 [main] FATAL [org.rpi.main.StartMe] user.language=en
2021-10-20 14:34:53,133 [main] FATAL [org.rpi.main.StartMe] user.name=mediaplayer
2021-10-20 14:34:53,133 [main] FATAL [org.rpi.main.StartMe] user.timezone=Europe/London
2021-10-20 14:34:53,134 [main] FATAL [org.rpi.main.StartMe] #####End of System Properties#########
2021-10-20 14:34:53,134 [main] FATAL [org.rpi.main.StartMe] 
2021-10-20 14:34:53,138 [main] FATAL [org.rpi.main.StartMe] #####Start of System Variables#########
2021-10-20 14:34:53,143 [main] FATAL [org.rpi.main.StartMe] PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
2021-10-20 14:34:53,145 [main] FATAL [org.rpi.main.StartMe] INVOCATION_ID=680ab008213542c5953526979c162e90
2021-10-20 14:34:53,145 [main] FATAL [org.rpi.main.StartMe] JOURNAL_STREAM=8:23354
2021-10-20 14:34:53,146 [main] FATAL [org.rpi.main.StartMe] SHELL=/bin/bash
2021-10-20 14:34:53,146 [main] FATAL [org.rpi.main.StartMe] LOGNAME=mediaplayer
2021-10-20 14:34:53,146 [main] FATAL [org.rpi.main.StartMe] USER=mediaplayer
2021-10-20 14:34:53,147 [main] FATAL [org.rpi.main.StartMe] LANG=en_GB.UTF-8
2021-10-20 14:34:53,147 [main] FATAL [org.rpi.main.StartMe] HOME=/opt/mediaplayer
2021-10-20 14:34:53,148 [main] FATAL [org.rpi.main.StartMe] #####End of System Variables#########
2021-10-20 14:34:53,148 [main] FATAL [org.rpi.main.StartMe] 
2021-10-20 14:34:53,261 [main] INFO  [org.rpi.mpdplayer.TCPConnector] MPD Version: MPD 0.21.4
2021-10-20 14:34:53,296 [Thread-0] INFO  [org.rpi.player.PlayManager] SetStatus: Playing Source: PLAYER
2021-10-20 14:34:53,393 [main] WARN  [org.rpi.os.OSManager] Using full_path /opt/mediaplayer/mediaplayer_lib/ohNet/linux/armv6hf
2021-10-20 14:34:53,445 [main] INFO  [org.rpi.main.SimpleDevice] OpenHome DebugLevel: 0
2021-10-20 14:34:53,449 [main] INFO  [org.rpi.main.SimpleDevice] Using LocalIPAddress: 192.168.178.29
2021-10-20 14:34:53,477 [main] INFO  [org.rpi.main.SimpleDevice] Using NIC: eth0
2021-10-20 14:34:53,859 [main] INFO  [org.rpi.pins.PinManager] PinManger URL is not configured, do  NOT connect to the service
2021-10-20 14:34:53,904 [main] ERROR [org.rpi.pins.PinManager] Error Reading from File: pins.json
2021-10-20 14:34:53,913 [main] ERROR [org.rpi.providers.PrvPins] Error Reading from pins.json
java.lang.NullPointerException
    at java.base/java.io.StringReader.<init>(StringReader.java:50)
    at org.json.JSONTokener.<init>(JSONTokener.java:94)
    at org.json.JSONArray.<init>(JSONArray.java:162)
    at org.rpi.providers.PrvPins.updatePins(PrvPins.java:162)
    at org.rpi.providers.PrvPins.readPins(PrvPins.java:156)
    at org.rpi.providers.PrvPins.<init>(PrvPins.java:86)
    at org.rpi.main.SimpleDevice.initSimpleDevice(SimpleDevice.java:197)
    at org.rpi.main.SimpleDevice.<init>(SimpleDevice.java:102)
    at org.rpi.main.StartMe.main(StartMe.java:80)
2021-10-20 14:35:00,882 [main] WARN  [org.rpi.sources.SourceReader] ListSources.xml Not Found

[...]

2021-10-20 14:45:00,105 [Thread-4] DEBUG [org.rpi.providers.PrvInfo] Return Details: org.openhome.net.device.providers.DvProviderAvOpenhomeOrgInfo1$Details@1db82c1
2021-10-20 14:45:00,117 [Thread-6] DEBUG [org.rpi.providers.PrvInfo] metatext  Adapter: 192.168.178.29 uriPrefix: http://192.168.178.29:52821/device-Cuisine-raspberrypi-MediaRenderer/Upnp/resource/ Version:1 
2021-10-20 14:45:00,119 [Thread-6] DEBUG [org.rpi.providers.PrvInfo] Return metatext: <?xml version="1.0" encoding="UTF-8" standalone="no"?><DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="BBC Radio 2"><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/">BBC Radio 2</dc:title><upnp:artist xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" role="Performer"/><upnp:album xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/">BBC Radio 2</upnp:album><upnp:class xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/">object.item.audioItem.musicTrack</upnp:class><res bitrate="" nrAudioChannels="" protocolInfo="http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01">http://opml.radiotime.com/Tune.ashx?id=s24940</res><upnp:albumArtURI xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/">http://cdn-radiotime-logos.tunein.com/s24940q.png</upnp:albumArtURI></item></DIDL-Lite>
2021-10-20 14:45:09,803 [Thread-7] DEBUG [org.rpi.providers.PrvRadio] Pause Adapter: 192.168.178.29 uriPrefix: http://192.168.178.29:52821/device-Cuisine-raspberrypi-MediaRenderer/Upnp/resource/ Version:1 
PeteManchester commented 3 years ago

Hi Emmanuel,

I would say it is Lumin that is wrong, you are not supposed to be able to Pause a live radio stream, you can only Stop it.

However I have modified mediaplayer so that if a client sends a pause request for a radio channel it will stop playing the channel.

Please can you try the beta version that is here

https://github.com/PeteManchester/MediaPlayer/tree/master/com.upnp.mediaplayer/download/beta

and let me know the results.

Thanks,

Pete.

e-roux commented 3 years ago

Hello Pete,

thank you for the work you deliver, it's really awesome!

The modification provides the expected result.

Concerning the strategy of pausing a stream, one could e.g. pause and buffer the stream for a certain time/amount of memory, and stop the stream in case you exceed this time/memory. Quite a complicated memory management however. The easiest solution and the one that makes more sense is for sure stopping it like you say, agree.

Thanks again,

Emmanuel