|
From: | varun pratapsingh |
Subject: | Re: [Linphone-developers] [From External Source] Linphone Player not playing the recorded file |
Date: | Sat, 7 Nov 2020 17:25:35 +0530 |
Hi All, I am creating and using the Linphone player by the following code. The logs show everything fine. The player was created successfully and the player started playing the file successfully. But then there is no Audio in the audio device and there is sound in Simulator. If this a bug in Linphone core library do let me know and the possible other options for developing and audio player to play Linphone recorded files. As native IOS AVPlayer does not play or support the playback of .mkv files. I used the below code to try to play the sample ringback.wav file. player = linphone_core_create_local_player(LC, NULL, NULL, NULL); const char* pbDevice= linphone_core_get_playback_device(LC); NSLog(@"The playback device is %s",pbDevice); bool canPlay = linphone_core_sound_device_can_playback(LC, pbDevice); if(!canPlay) { NSLog(@"The device cannot playback the audio files."); } float currGainVal = linphone_core_get_playback_gain_db(LC); NSLog(@"The Current Gain value of device for playback is %f",currGainVal); if(LC==linphone_player_get_core(player)) { NSLog(@"We are in right core managing the player"); } cbs = linphone_player_get_callbacks(player); linphone_player_set_user_data(player, (__bridge void *)self); linphone_player_cbs_set_eof_reached(cbs, on_eof_reached); file = filePath; NSLog(@"FilePath: %@",file); eofReached = NO; _refreshTimer = nil; : : case LinphonePlayerPaused: NSLog(@"Play"); [_playButton setTitle:@"" forState:UIControlStateNormal]; [_playButton setImage:[UIImage imageFromSystemBarButton:UIBarButtonSystemItemPause:[UIColor blackColor]] forState:UIControlStateNormal]; bool bPlaying = linphone_player_start(player); NSLog(@"The status of the player playing is %d",bPlaying); break; I have highlighted the difference between Run time logs and Simulator logs. It seems that Audio Unit is started well on Simulator but does not on real device. Run time Logs: iPhone Device: 2020-11-07 17:01:21.485773+0530 Revcell[2137:685139] The playback device is AU: Audio Unit Receiver 2020-11-07 17:01:21.486160+0530 Revcell[2137:685139] The Current Gain value of device for playback is 0.000000 2020-11-07 17:01:21.486389+0530 Revcell[2137:685139] We are in right core managing the player 2020-11-07 17:02:00.998863+0530 Revcell[2137:685139] FilePath: /var/mobile/Containers/Data/Application/E4556902-10AA-4C40-884C-A1B7CE6A64A6/Documents/RevcordAudios/1604733547609.mkv 2020-11-07 17:02:32.681788+0530 Revcell[2137:685139] [Message] Opening /var/mobile/Containers/Data/Application/E4556902-10AA-4C40-884C-A1B7CE6A64A6/Documents/RevcordAudios/1604733547609.mkv 2020-11-07 17:02:32.683396+0530 Revcell[2137:685139] [Message] MKVPlayer: opening /var/mobile/Containers/Data/Application/E4556902-10AA-4C40-884C-A1B7CE6A64A6/Documents/RevcordAudios/1604733547609.mkv 2020-11-07 17:02:32.687894+0530 Revcell[2137:685139] [Warning] MKVPlayer: no default video track. Looking for first video track 2020-11-07 17:02:32.688313+0530 Revcell[2137:685139] [Warning] MKVPlayer: no video track found 2020-11-07 17:02:32.696139+0530 Revcell[2137:685139] [Message] Configuring audio session for playback 2020-11-07 17:02:32.709175+0530 Revcell[2137:685139] [Message] MSAURead/MSAUWrite: configureAudioSession() took 13 ms. 2020-11-07 17:02:32.709546+0530 Revcell[2137:685139] [Message] MSAURead/MSAUWrite: AVAudioSession is configured at sample rate 48000. 2020-11-07 17:02:32.709668+0530 Revcell[2137:685139] [Message] ms_filter_link: MSMKVPlayer:0x280f538e0,1-->MSOpusDec:0x280f1f340,0 2020-11-07 17:02:32.709768+0530 Revcell[2137:685139] [Message] ms_filter_link: MSOpusDec:0x280f1f340,0-->MSAUWrite:0x280f1f3e0,0 2020-11-07 17:02:32.711795+0530 Revcell[2137:685139] [Message] Audio session already correctly configured. 2020-11-07 17:02:32.711960+0530 Revcell[2137:685819] [Message] Player priority left to normal. 2020-11-07 17:02:32.712167+0530 Revcell[2137:685139] [Message] MSAURead/MSAUWrite: AVAudioSession is configured at sample rate 48000. 2020-11-07 17:02:32.836133+0530 Revcell[2137:685819] [Warning] Player: We are late of 64 miliseconds. 2020-11-07 17:02:32.903933+0530 Revcell[2137:685819] [Warning] Player: We are late of 51 miliseconds. 2020-11-07 17:02:32.917406+0530 Revcell[2137:685139] [Message] AudioUnit created with type kAudioUnitSubType_RemoteIO. 2020-11-07 17:02:32.917698+0530 Revcell[2137:685139] [Message] configure_audio_unit() now called. 2020-11-07 17:02:32.920072+0530 Revcell[2137:685139] [Message] configure_audio_unit() took 2 ms. 2020-11-07 17:02:32.920317+0530 Revcell[2137:685139] The Player opened the file with status 0 2020-11-07 17:02:32.920417+0530 Revcell[2137:685139] The duration of the file to play is 12321 2020-11-07 17:04:31.824823+0530 Revcell[2137:685139] The status of the player playing is 0 2020-11-07 17:04:32.995836+0530 Revcell[2137:685139] [Message] channel [0x111460000]: keep alive sent to [TLS://revcell-revcord.sip.signalwire.com:5061] 2020-11-07 17:04:33.075599+0530 Revcell[2137:685139] [Message] Background task belle-sip recv channel started. Unknown remaining time since application is not fully in background. 2020-11-07 17:04:33.076063+0530 Revcell[2137:685139] [Message] channel [0x111460000]: starting recv background task with id=[12]. 2020-11-07 17:04:33.076375+0530 Revcell[2137:685139] [Message] channel [0x111460000]: ending recv background task with id=[12]. 2020-11-07 17:04:34.839164+0530 Revcell[2137:685139] [Message] [SHARED] resetSharedCoreLastUpdateTime 2020-11-07 17:04:44.114393+0530 Revcell[2137:685139] EOF reached Simulator 2020-11-07 17:09:29.167958+0530 Revcell[14537:5204492] The playback device is AU: Audio Unit Receiver 2020-11-07 17:09:29.168175+0530 Revcell[14537:5204492] The Current Gain value of device for playback is 0.000000 2020-11-07 17:09:29.168327+0530 Revcell[14537:5204492] We are in right core managing the player 2020-11-07 17:09:37.943709+0530 Revcell[14537:5204492] FilePath: /Users/varunsingh/Library/Developer/CoreSimulator/Devices/666BC5F1-6D4E-4FE9-9247-9636972A9730/data/Containers/Data/Application/C193EB5D-F890-4117-9996-3807FF097E1B/Documents/RevcordAudios/1604568972073.mkv 2020-11-07 17:10:21.958303+0530 Revcell[14537:5204492] [Message] Opening /Users/varunsingh/Library/Developer/CoreSimulator/Devices/666BC5F1-6D4E-4FE9-9247-9636972A9730/data/Containers/Data/Application/C193EB5D-F890-4117-9996-3807FF097E1B/Documents/RevcordAudios/1604568972073.mkv 2020-11-07 17:10:21.960139+0530 Revcell[14537:5204492] [Message] MKVPlayer: opening /Users/varunsingh/Library/Developer/CoreSimulator/Devices/666BC5F1-6D4E-4FE9-9247-9636972A9730/data/Containers/Data/Application/C193EB5D-F890-4117-9996-3807FF097E1B/Documents/RevcordAudios/1604568972073.mkv 2020-11-07 17:10:21.963978+0530 Revcell[14537:5204492] [Warning] MKVPlayer: no default video track. Looking for first video track 2020-11-07 17:10:21.964281+0530 Revcell[14537:5204492] [Warning] MKVPlayer: no video track found 2020-11-07 17:10:21.967778+0530 Revcell[14537:5204492] [Message] Configuring audio session for playback 2020-11-07 17:10:21.968083+0530 Revcell[14537:5204492] [Message] MSAURead/MSAUWrite: configureAudioSession() took 0 ms. 2020-11-07 17:10:21.968297+0530 Revcell[14537:5204492] [Message] MSAURead/MSAUWrite: AVAudioSession is configured at sample rate 48000. 2020-11-07 17:10:21.968500+0530 Revcell[14537:5204492] [Message] ms_filter_link: MSMKVPlayer:0x6000001d0e60,1-->MSOpusDec:0x6000001d5180,0 2020-11-07 17:10:21.968693+0530 Revcell[14537:5204492] [Message] ms_filter_link: MSOpusDec:0x6000001d5180,0-->MSAUWrite:0x6000001cbe80,0 2020-11-07 17:10:21.969010+0530 Revcell[14537:5206310] [Message] Player priority left to normal. 2020-11-07 17:10:21.971389+0530 Revcell[14537:5204492] [Message] Audio session already correctly configured. 2020-11-07 17:10:21.971635+0530 Revcell[14537:5204492] [Message] MSAURead/MSAUWrite: AVAudioSession is configured at sample rate 48000. 2020-11-07 17:10:21.975221+0530 Revcell[14537:5204492] [Message] AudioUnit created with type kAudioUnitSubType_RemoteIO. 2020-11-07 17:10:21.975489+0530 Revcell[14537:5204492] [Message] configure_audio_unit() now called. 2020-11-07 17:10:21.976160+0530 Revcell[14537:5204492] [Message] configure_audio_unit() took 1 ms. 2020-11-07 17:10:21.976401+0530 Revcell[14537:5204492] [Message] start_audio_unit(): about to start audio unit. 2020-11-07 17:10:21.979322+0530 Revcell[14537:5204492] [Message] I/O unit latency [0.000000], quality [64] 2020-11-07 17:10:21.981395+0530 Revcell[14537:5206312] [aurioc] AURemoteIO.h:323:entry: Unable to join I/O thread to workgroup ((null)): 2 2020-11-07 17:10:21.982335+0530 Revcell[14537:5204492] [Message] AudioUnit started, current hw output latency [0.010000] input [0.010000] iobuf[0.021333] hw sample rate [48000.000000] 2020-11-07 17:10:21.982562+0530 Revcell[14537:5204492] [Message] start_audio_unit() took 7 ms. 2020-11-07 17:10:21.982770+0530 Revcell[14537:5204492] [Message] check_audio_unit_is_up(): audio unit is started. 2020-11-07 17:10:21.982929+0530 Revcell[14537:5204492] The Player opened the file with status 0 2020-11-07 17:10:21.983069+0530 Revcell[14537:5204492] The duration of the file to play is 21141 2020-11-07 17:12:28.077396+0530 Revcell[14537:5204492] Play 2020-11-07 17:12:28.131822+0530 Revcell[14537:5204492] The status of the player playing is 0 2020-11-07 17:12:35.129601+0530 Revcell[14537:5204492] [Message] [SHARED] resetSharedCoreLastUpdateTime 2020-11-07 17:12:45.129810+0530 Revcell[14537:5204492] [Message] [SHARED] resetSharedCoreLastUpdateTime 2020-11-07 17:12:49.246405+0530 Revcell[14537:5204492] EOF reached Thanks and Regards Varun
|
[Prev in Thread] | Current Thread | [Next in Thread] |