Audio Codec Channel not Supported

An android phone is producing codec
audio/opus, 48000, channel: 1 and the router is showing media codec not supported.

1 Like

Please specify whether you mean mediasoup-client JS lib or libmediasoupclient C++ lib. Also paste please a SDP generated by it.

I also have same problem, on some android device. I reach canConsume() return false

AFAIR this was already discussed in this forum. No, I cannot look for the specific topic. The thing is that Chrome in Android fails for the first createOffer (it lacks some codecs) but it works if called a second time.

This is however NOT related to mediasoup-client and should be reported in Chrome issue tracker, so I hope someone will do it instead of just doing the hack in his own application.

I checked the code of supported codecs, it is failing due to “channel: 1”. The audio codec is allowed only for “channel: 2”.

I asked for the SDP, you didn’t provide it.

It’s a nodejs code on the server-side and on client-side android c++ lib.

this is transportCreated

 {
 	"params": {
 		"id": "919dfad3-1e3f-4e69-999b-e8b78072d8bc",
 		"iceParameters": {
 			"iceLite": true,
 			"password": "........masked.......",
 			"usernameFragment": "........masked......."
 		},
 		"iceCandidates": [{
 			"foundation": "udpcandidate",
 			"ip": "........masked.......",
 			"port": 10019,
 			"priority": 1076302079,
 			"protocol": "udp",
 			"type": "host"
 		}, {
 			"foundation": "tcpcandidate",
 			"ip": "........masked.......",
 			"port": 10094,
 			"priority": 1076302079,
 			"protocol": "tcp",
 			"tcpType": "passive",
 			"type": "host"
 		}],
 		"dtlsParameters": {
 			"fingerprints": [{
 				"algorithm": "sha-1",
 				"value": "AB:39:C0:97:B5:64:A1:85:98:51:CB:49:12:5A:C6:86:70:59:76:EC"
 			}, {
 				"algorithm": "sha-224",
 				"value": "8D:CE:27:8D:C1:6F:77:94:03:39:80:CF:30:C2:B3:18:6C:27:75:D1:AF:8F:84:1F:FE:57:10:6B"
 			}, {
 				"algorithm": "sha-256",
 				"value": "7F:24:14:52:C7:A1:3F:19:36:11:0C:EE:F3:56:E7:E8:66:E6:73:28:1A:C9:53:8D:79:18:AB:07:9A:6B:6B:20"
 			}, {
 				"algorithm": "sha-384",
 				"value": "E3:00:5B:A8:00:0F:86:0A:2C:2A:9C:C2:6F:7E:A8:15:EE:F3:29:73:2F:BD:1C:DC:C4:40:5E:79:64:2A:FB:85:D7:8F:27:E9:59:A5:E2:79:03:FB:EE:DC:8E:2F:40:D7"
 			}, {
 				"algorithm": "sha-512",
 				"value": "5B:A0:BC:F9:D2:7A:96:30:11:3D:0B:52:CB:E4:0A:CC:1D:0C:37:43:CC:E0:65:1D:C6:CB:C0:BB:2A:A9:E4:10:53:7B:6A:5E:20:F5:02:59:4B:1D:1E:8E:39:3F:52:40:63:70:4E:19:85:10:8C:1B:ED:D1:20:F4:DD:F0:53:2C"
 			}],
 			"role": "auto"
 		}
 	},
 	"type": "producer"
 }

and this is produce

{
	"transportId": "919dfad3-1e3f-4e69-999b-e8b78072d8bc",
	"kind": "audio",
	"rtpParameters": {
		"codecs": [{
			"clockRate": 48000,
			"mimeType": "audio/opus",
			"parameters": {
				"minptime": 10,
				"useinbandfec": 1
			},
			"payloadType": 111,
			"rtcpFeedback": [{
				"parameter": "",
				"type": "transport-cc"
			}]
		}],
		"encodings": [{
			"dtx": false,
			"ssrc": 388832791
		}],
		"headerExtensions": [{
			"encrypt": false,
			"id": 4,
			"parameters": {},
			"uri": "urn:ietf:params:rtp-hdrext:sdes:mid"
		}, {
			"encrypt": false,
			"id": 2,
			"parameters": {},
			"uri": "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"
		}, {
			"encrypt": false,
			"id": 3,
			"parameters": {},
			"uri": "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"
		}, {
			"encrypt": false,
			"id": 1,
			"parameters": {},
			"uri": "urn:ietf:params:rtp-hdrext:ssrc-audio-level"
		}],
		"mid": "0",
		"rtcp": {
			"cname": "",
			"reducedSize": true
		}
	},
	"appData": "{}",
	"callId": "4e784604-8bbd-4257-a839-4ee43f429b5d"
}

and this is the error I am getting.

UnsupportedError: unsupported codec [mimeType:audio/opus, payloadType:111]
    at Object.getProducerRtpParametersMapping (/home/ubuntu/conference/node_modules/mediasoup/lib/ortc.js:504:19)
    at WebRtcTransport.produce (/home/ubuntu/conference/node_modules/mediasoup/lib/Transport.js:242:33)
    at MediaRoom.produce (/home/ubuntu/conference/dist/xstream/mediasoup.js:35:42)

Well, this is the problem. Opus always announces 2 channels, no matter the audio is mono or sgtereo or surround or whatever. This is how Opus negotiation is defined in its RFC. So fix your client app to properly announce channels: 2 in the Opus codec.

1 Like

Okay, so this is probably from the webrtc client I am using at the app’s end.
Thanks, I will try to figure out how to do this.
:+1:

Hi, did you solve the issue and how? because I’m facing the same issue.
Thanks

hi mayank.
can you please share the solution? i tried my self by i can’t figure out how to fix this problem, there is no channel: 2 in the rtpParams of onProduce.
i will be thanksfull if you say anything about it.