protyposis / LocalAudioBroadcast

Streams local Windows audio playback into a UPnP network
Apache License 2.0
34 stars 3 forks source link

Internal Server Error #6

Closed Stephanowicz closed 8 months ago

Stephanowicz commented 5 years ago

Hi,

first of all: thank You VERY much - I was trying and looking so much for a WORKING solution like this without result.

Well - I still get this error when trying to start the Playback - BUT luckily if I skip over it it DOES work :D

so - the error is from

StackTrace = " bei OpenSource.UPnP.UPnPService.InvokeSync(String MethodName, UPnPArgument[] InVarArr) in c:\Users\Public\Downloads\DeveloperToolsForUPnP\Global\UPnP\UPnPService.cs:Zeile 3331.\r\n bei LocalAudioBroadcast.ControlPoint.SetAVTransportURI() in C:...

seems to be in Your precompiled dll ??

the return says: UPNP = {"Action Failed"}

I got this error with other apps, too.

so I put the service.InvokeSync("SetAVTransportURI", args); in a try/catch and it's working…

Can You tell me please, where You got this opensource.upnp lib from - so I may take a look at it to resolve the issue...

Thanks & cheers,

Stephan

EDIT: Another thing is, that I have to select WAV at first, start the Playback (but I don't get Sound) - then stop Playback, switch to LPCM and start Playback...

Stephanowicz commented 5 years ago

Hi,

so meanwhile I think the Problem Comes from 'wrong' args, Maybe...?

As I wrote above I 1st have to start with WAV as Streaming Format -

when I start I get following Output:

GET http://192.168.178.35:10610/capture HTTP/1.1 User-Agent: Music Player Daemon 0.21 Icy-Metadata: 1 remote_addr: 192.168.178.77 remote_port: 60594

Default Playback Capture: Lautsprecher (Realtek High Definition Audio) loopback capture source format: 16 bit PCM: 96kHz 2 channels (2,9 Mb/s) MetadataEmbedder:SetTrackInfo Metadata set: StreamTitle='N/A'; ICY OK audio/wav TransferMode.DLNA.ORG: Streaming Server: UPnP/1.0 DLNADOC/1.50 LAB/1.0 icy-name: Local Audio Broadcast icy-metaint: 192000

MetadataEmbedder:SetTrackInfo Metadata set: StreamTitle='N/A'; Ausnahme ausgelöst: "System.Net.Sockets.SocketException" in System.dll Ausnahme ausgelöst: "System.IO.IOException" in System.dll sending 38444 bytes = 0,10 secs sending 42240 bytes = 0,11 secs Der Thread 0x5a78 hat mit Code 0 (0x0) geendet. Ausnahme ausgelöst: "System.Net.Sockets.SocketException" in System.dll Ausnahme ausgelöst: "System.IO.IOException" in System.dll request processing finished AVTransport Event 1 urn:upnp-org:serviceId:AVTransport

after this it stops But if I switch to PCM and start I still get an internal Server error but the Transport is working…

seems like it's hooking onto the initial WAV Transport... Ausnahme ausgelöst: "OpenSource.UPnP.UPnPInvokeException" in UPnP.dll

GET http://192.168.178.35:10610/capture HTTP/1.1 User-Agent: Music Player Daemon 0.21 Icy-Metadata: 1 remote_addr: 192.168.178.77 remote_port: 60612

Default Playback Capture: Lautsprecher (Realtek High Definition Audio) loopback capture source format: 16 bit PCM: 96kHz 2 channels (2,9 Mb/s) MetadataEmbedder:SetTrackInfo Metadata set: StreamTitle='N/A'; ICY OK audio/L16;rate=96000;channels=2 TransferMode.DLNA.ORG: Streaming Server: UPnP/1.0 DLNADOC/1.50 LAB/1.0 icy-name: Local Audio Broadcast icy-metaint: 192000

sending 38400 bytes = 0,10 secs TransportState Change: PLAYING sending 38400 bytes = 0,10 secs sending 38400 bytes = 0,10 secs sending 38400 bytes = 0,10 secs sending 38433 bytes = 0,10 secs sending 38400 bytes = 0,10 secs sending 42240 bytes = 0,11 secs sending 38400 bytes = 0,10 secs sending 38400 bytes = 0,10 secs sending 38401 bytes = 0,10 secs ...

Stephanowicz commented 5 years ago

Hello again ;)

Well, finally I found that my upnp renderer doesn't support L16... they say it supports wav/pcm...

Hmm?

So I dunno - I don't want to dig too deep into the code - after some Experiments I have a Workaround:

I created a new streamingformat in order not to break the former

        class PCMFormat : StreamingFormat {

            public override string Id {
                get { return "pcm"; }
            }

            public override string Name {
                get { return "PCM"; }
            }

            public override string GetFormatDescriptor(int sampleRate, int channels) {
               return "audio/l16;rate=" + sampleRate + ";channels=" + channels;
            }

            public override string GetNetworkFormatDescriptor(int sampleRate, int channels) {
                return "http-get:*:audio/x-wav:*";

            }

            public override bool BigEndian { 
                get { return false; }
            }
        }

as You can see I changed the return value for the networkformatdescriptor to "http-get:*:audio/x-wav:*"

BigEndian is false

I set/left the FormatDescriptor to the L16 descriptor "audio/l16;rate=" + sampleRate + ";channels=" + channels; -- it is working - and as I said, I don't want to dig deeper, BUT if I use the WAV descriptor here, it is NOT working...

This seemed to be the same Problem with other Tools like SWYH... Maybe

Cheers,

Stephan

ltguillaume commented 5 years ago

That sounds great! Might help with the issue I have with an old XBOX and XBMC. Could you perhaps share the binaries, so I can try?

Stephanowicz commented 5 years ago

@ltGuillaume : I forked the Project and put the binaries here:

https://github.com/Stephanowicz/LocalAudioBroadcast/blob/master/LocalAudioBroadcast_AirLinoFix.zip

Dunno if it will help with xbox - which one do You have? I've also an 'old' xbox 360... ;)

ltguillaume commented 5 years ago

Thanks! I'll get back to you as soon as I've unpacked (I moved) and tried out. I sometimes use an (even older) XBOX, first generation, which is connected by TOSLink to my receiver.

Stephanowicz commented 5 years ago

@ltGuillaume : well, I tried it with mine - but it doesn't show up in the list… :/ Maybe I'll check this next time

protyposis commented 8 months ago

Closing due to repo archival.