This project has moved. For the latest updates, please go here.

Changing the shoutcast url

Mar 28, 2014 at 6:40 PM
Hi henric. Now ı can play mp3 shoutcast URL's in my app. But when I change the source. The new URL can't play. This problem doesn't occur when the URL is HLS.

Here is the output window.
MediaElementWrapper.ctor()
MediaElementWrapper.MediaElement setter
MediaElementWrapper.OnApplyTemplate()
MediaElementWrapper.Source setter: http://46.20.4.58:8030/;stream.mp3
MediaElementWrapper.SetSourceAsync()
MediaStreamFacadeBase.CloseMediaAsync()
MediaStreamFacadeBase.CloseMediaAsync() completed
MediaStreamFacadeBase.OpenMediaAsync(http://46.20.4.58:8030/;stream.mp3)
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\Data\Programs{2D377FFD-DFB4-4767-B8C2-F87D0C453A9E}\Install\SM.TsParser.DLL'. Symbols loaded.
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Linq.ni.dll'. Cannot find or open the PDB file.
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Runtime.Extensions.ni.dll'. Cannot find or open the PDB file.
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'Anonymously Hosted DynamicMethods Assembly'.
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\Data\Programs{2D377FFD-DFB4-4767-B8C2-F87D0C453A9E}\Install\System.Net.Http.Primitives.DLL'. Cannot find or open the PDB file.
MediaElementWrapper.SetSource(MediaStreamSource)
TsMediaStreamSource.OpenMediaAsync()
Media OpenMediaAsyncCalled: Idle -> Opening at 3/28/2014 8:27:05 PM +02:00
TsMediaManager.OpenMedia()
TsMediaManager.OpenMedia() handler
MediaElementWrapper.mediaElement_CurrentStateChanged(): Opening
MediaStreamFacadeBase.MediaManagerOnStateChange() to OpenMedia:
TsMediaManager.OpenMediaAsync() state OpenMedia
MediaStreamFacadeBase.MediaManagerOnStateChange() to Opening:
HttpClientWebReaderManager.DetectContentTypeAsync() url ext "http://46.20.4.58:8030/;stream.mp3" type MP3 (audio/mpeg)
BufferingManager.Flush()
++++ Starting http://46.20.4.58:8030/;stream.mp3 at 3/28/2014 8:27:05 PM +02:00. Total memory: 1.19 MiB
Configuration MP3 Frame: MPEG Version 1 (ISO/IEC 11172-3), Layer III sample 44.1kHz bitrate 64kHz channel mode 0
TsMediaStreamSource.ConfigureAudioStream(): CodecPrivateData: 5500020044AC0000401F0000000000000C00010000000000D10001000000
BufferingManager.UpdateBuffering: 63.47% duration 00:00:08.0979440 size 64993 starting True memory 1.68 MiB
TsMediaStreamSource: ReportOpenMediaCompleted (1 streams)
MediaStreamFacadeBase.MediaManagerOnStateChange() to Playing:
TsMediaStreamSource: ReportOpenMediaCompleted CanSeek = False
Media CallingReportOpenMediaCompletedLive: Opening -> Playing at 3/28/2014 8:27:06 PM +02:00
TsMediaStreamSource.SeekAsync(00:00:00)
Media SeekAsyncCalled: Playing -> Seeking at 3/28/2014 8:27:06 PM +02:00
TsMediaManager.SeekMediaAsync(00:00:00)
BufferingManager.IsSeekAlreadyBuffered(00:00:00)
Media CallingReportSeekCompleted: Seeking -> Playing at 3/28/2014 8:27:06 PM +02:00
TsMediaStreamSource.SeekHandler(00:00:00) completed, actual: 00:00:00
MediaElementWrapper.Play()
Sample Audio buffering 63.47%
MediaElementWrapper.mediaElement_CurrentStateChanged(): Playing
TsMediaStreamSource.SignalHandler() re-requesting Audio
MediaElementWrapper.mediaElement_CurrentStateChanged(): Playing
BufferingManager.UpdateBuffering done buffering: duration 00:00:16.2742552 size 130404 starting True memory 1.06 MiB
Audio count 624 size 130404 newest 00:00:16.2742552 oldest 00:00:00
MediaElementWrapper.Close()
BufferingManager.UpdateState read blocking -> True duration 00:00:27.0366840 size 216294 memory 1.20 MiB
Audio count 1035 size 216294 newest 00:00:28.5256608 oldest 00:00:01.4889768
TsMediaStreamSource.CloseMedia()
Media CloseMediaCalled: Playing -> Draining at 3/28/2014 8:27:07 PM +02:00
TsMediaStreamSource.CloseMediaHandler()
TsMediaManager.CloseMedia()
MediaStreamFacadeBase.RequestStop()
MediaElementWrapper.Source setter: http://46.20.3.231/;stream.mp3
MediaElementWrapper.SetSourceAsync()
MediaElementWrapper.mediaElement_CurrentStateChanged(): Closed
TsMediaManager.CloseAsync()
TsMediaManager.CloseAsync() calling readerManager.StopAsync()
TsMediaManager.CloseAsync() calling _mediaStreamSource.CloseAsync()
TsMediaStreamSource.CloseAsync(): open 1 close RanToCompletion
MediaStreamFacadeBase.MediaManagerOnStateChange() to Closing:
MediaStreamFacadeBase.CloseMediaAsync()
MediaPlayerSource.CloseMediaAsync() calling mediaManager.CloseAsync()
TsMediaManager.CloseAsync()
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\en-US\mscorlib.debug.resources.dll'. Module was built without symbols.
A first chance exception of type 'System.Threading.Tasks.TaskCanceledException' occurred in mscorlib.ni.dll
A first chance exception of type 'System.Threading.Tasks.TaskCanceledException' occurred in mscorlib.ni.dll
A first chance exception of type 'System.Threading.Tasks.TaskCanceledException' occurred in SM.Media.DLL
A first chance exception of type 'System.Threading.Tasks.TaskCanceledException' occurred in mscorlib.ni.dll
A first chance exception of type 'System.Threading.Tasks.TaskCanceledException' occurred in mscorlib.ni.dll
BufferingManager.Flush()
MediaStreamFacadeBase.MediaManagerOnStateChange() to Closed:
TsMediaManager.CloseAsync() completed
TsMediaManager.CloseAsync() completed by other caller
MediaPlayerSource.CloseMediaAsync() returned from mediaManager.CloseAsync()
MediaStreamFacadeBase.CleanupMediaManager()
TsMediaManager.Dispose()
TsMediaManager.CloseAsync()
TsMediaManager.CloseAsync() completed by other caller
TsMediaManager.Dispose()
TsMediaStreamSource.Dispose()
ValidateEvent Invalid state transition: state Draining event DisposeCalled
The thread 0xcd0 has exited with code 259 (0x103).
MediaStreamFacadeBase.CleanupMediaManager() completed
MediaStreamFacadeBase.CloseMediaAsync() completed
MediaStreamFacadeBase.CloseMediaAsync()
MediaStreamFacadeBase.CloseMediaAsync() completed
MediaStreamFacadeBase.OpenMediaAsync(http://46.20.3.231/;stream.mp3)
MediaElementWrapper.SetSource(MediaStreamSource)
TsMediaStreamSource.OpenMediaAsync()
Media OpenMediaAsyncCalled: Idle -> Opening at 3/28/2014 8:27:16 PM +02:00
TsMediaManager.OpenMedia()
TsMediaManager.OpenMedia() handler
TsMediaManager.OpenMediaAsync() state OpenMedia
MediaElementWrapper.mediaElement_CurrentStateChanged(): Opening
MediaStreamFacadeBase.MediaManagerOnStateChange() to OpenMedia:
MediaStreamFacadeBase.MediaManagerOnStateChange() to Opening:
HttpClientWebReaderManager.DetectContentTypeAsync() url ext "http://46.20.3.231/;stream.mp3" type MP3 (audio/mpeg)
BufferingManager.Flush()
++++ Starting http://46.20.3.231/;stream.mp3 at 3/28/2014 8:27:16 PM +02:00. Total memory: 1.32 MiB
A first chance exception of type 'System.ObjectDisposedException' occurred in System.Net.Http.DLL
A first chance exception of type 'System.ObjectDisposedException' occurred in mscorlib.ni.dll
A first chance exception of type 'System.ObjectDisposedException' occurred in mscorlib.ni.dll
A first chance exception of type 'System.ObjectDisposedException' occurred in mscorlib.ni.dll
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Net.Requests.ni.dll'. Cannot find or open the PDB file.
A first chance exception of type 'System.ObjectDisposedException' occurred in SM.Media.DLL
A first chance exception of type 'System.ObjectDisposedException' occurred in mscorlib.ni.dll
A first chance exception of type 'System.ObjectDisposedException' occurred in mscorlib.ni.dll
A first chance exception of type 'System.ObjectDisposedException' occurred in mscorlib.ni.dll
CallbackReader.ReadAsync() failed: Cannot access a disposed object.
Object name: 'System.Net.Http.HttpClient'.
The thread 0xcd4 has exited with code 259 (0x103).
Thanks
Coordinator
Mar 29, 2014 at 1:38 AM
Which version of the code are your using? I assume this is on WP8..?

If you are testing on an emulator, I would suggest using an image with at least Update 2. There are some known problems with HttpClient on earlier versions of the firmware.

If you are using the latest code and don't need HttpWebRequestWebReader, then I would suggest trying the version tagged with phonesm-1.2.2 (a9aae3929a71). I'm a little suspicious of a1400cfefa74; the change is needed, but may well have introduced some bugs related to startup/shutdown of playback.
Mar 29, 2014 at 10:16 PM
Yes this is on WP8 and I tried on this version (9422b3516d47). Now I will try what you sad. Thanks
Coordinator
Apr 4, 2014 at 1:45 AM
Bajo wrote:
Yes this is on WP8 and I tried on this version (9422b3516d47). Now I will try what you sad. Thanks
Did that work for you?
Apr 4, 2014 at 10:32 AM
I'm sorry for the late reply. I tried on (a9aae3929a71) and I tried on earlier than (a9aae3929a71). It worked. But, It was slower than chancing HLS url source. Maybe It was because I tried on emulator.
Coordinator
Apr 4, 2014 at 12:34 PM
I did some work to improve the time required to switch streams before a9aae3929a71, so it depends on how much earlier than a9aae3929a71 you tried. Nothing I have done since should have had much of an effect on performance. In the near term, I'll be focusing on cleaning up code (e.g., the way the code handles playback startup and shutdown is far too complicated) and fixing some long standing issues (e.g., the inability to handle stream discontinuities).

From what you say, it appears that a1400cfefa74 has broken something. I'll take a look when I get a chance.