Use MAXCHANNELS define in mwindow.C
Rest of CinGG seems to use it: guest@slax:/dev/shm/cinelerra/cinelerra-5.1/cinelerra$ grep 'MAXCHANNELS' *.C arender.C: for( int i=0; i<MAXCHANNELS; ++i ) { arender.C: for( int i=0; i<MAXCHANNELS; ++i ) delete buffer[i]; arender.C: meter_history->init(MAXCHANNELS, calculate_history_size()); arender.C: for( int i=0; i<MAXCHANNELS; ++i ) { arender.C: for( int i=0; i<MAXCHANNELS; ++i ) { arender.C: for(int i = 0; i < MAXCHANNELS; i++) arender.C: for(int i = 0; i < MAXCHANNELS; i++) assetedit.C: (int)MAXCHANNELS, x, y, xS(50)) audioconfig.C: CLAMP(oss_in_channels, 1, MAXCHANNELS); audioconfig.C: CLAMP(oss_duplex_channels, 1, MAXCHANNELS); convert.C: for( int i=0; i < MAXCHANNELS; ++i ) pan_auto->values[i] = 0; convert.C: if( atrack >= MAXCHANNELS ) atrack = 0; dcoffset.C: for(int i = 0; i < MAXCHANNELS; i++) dc_offset[i] = 0; edlsession.C: for(int i = 0; i < MAXCHANNELS; i++) edlsession.C: for(int i = 0; i < MAXCHANNELS; i++) { edlsession.C: for( int i=0; i<MAXCHANNELS; ++i ) { edlsession.C: for(int i = 0; i < MAXCHANNELS; i++) { edlsession.C: for(int i = 0; i < MAXCHANNELS; i++) edlsession.C: for(int i = 0; i < MAXCHANNELS; i++) { edlsession.C: Workarounds::clamp(audio_channels, 0, MAXCHANNELS - 1); edlsession.C: Workarounds::clamp(video_channels, 1, MAXCHANNELS - 1); edlsession.C: for(int i = 0; i < MAXCHANNELS; i++) edlsession.C: for(int i = 0; i < MAXCHANNELS; i++) { fileformat.C: : BC_TumbleTextBox(fwindow, (int)atol(text), (int)1, (int)MAXCHANNELS, x, y, 50) mwindowedit.C: for( int i=0; i < MAXCHANNELS; ++i ) { panauto.C: bzero(values, MAXCHANNELS * sizeof(float)); panauto.C: bzero(values, MAXCHANNELS * sizeof(float)); panauto.C: memcpy(this->values, pan_auto->values, MAXCHANNELS * sizeof(float)); preferences.C: while( channels < MAXCHANNELS ) { preferences.C: for( int i=0; i<MAXCHANNELS; ++i ) { preferences.C: for( int i = 0; i < MAXCHANNELS; i++ ) { record.C: for( int i=0; i<MAXCHANNELS; ++i ) { record.C: for( int i=0; i<MAXCHANNELS; ++i ) { recordgui.C: for( int i=0; i<MAXCHANNELS; ++i ) { renderengine.C: for( int i=0; i<MAXCHANNELS; ++i ) { resourcethread.C: for(int i = 0; i < MAXCHANNELS; i++) resourcethread.C: for(int i = 0; i < MAXCHANNELS; i++) resourcethread.C: for( int i=0; i<MAXCHANNELS; ++i ) { setformat.C: CLAMP(new_channels, 1, MAXCHANNELS); setformat.C: add_subwindow(new BC_ITumbler(channels, 0, MAXCHANNELS, setformat.C: int new_channels = CLIP(atoi(get_text()), 0, MAXCHANNELS); tracking.C: double output_levels[MAXCHANNELS]; virtualanode.C: for(int i = 0; i < MAXCHANNELS; i++) vtracking.C: double output_levels[MAXCHANNELS]; vwindowgui.C: Samples *samples[MAXCHANNELS]; vwindowgui.C: while( ch < MAXCHANNELS ) samples[ch++] = 0; guest@slax:/dev/shm/cinelerra/cinelerra-5.1/cinelerra$ grep 'MAXCHANNELS' *.h arender.h: Samples *audio_out[MAXCHANNELS]; arender.h: Samples *buffer[MAXCHANNELS]; arender.h: int buffer_allocated[MAXCHANNELS]; dcoffset.h: int dc_offset[MAXCHANNELS], dc_offset_total[MAXCHANNELS], dc_offset_count; edlsession.h: int achannel_positions[MAXCHANNELS]; edlsession.h: int vchannel_x[MAXCHANNELS]; edlsession.h: int vchannel_y[MAXCHANNELS]; maxchannels.h:#ifndef MAXCHANNELS maxchannels.h:#define MAXCHANNELS 32 panauto.h: float values[MAXCHANNELS]; preferences.h: int channel_positions[MAXCHANNELS][MAXCHANNELS]; record.h: int64_t dc_offset[MAXCHANNELS]; recordgui.h: RecordGUIDCOffsetText *dc_offset_text[MAXCHANNELS]; recordgui.h: BC_Meter *meter[MAXCHANNELS]; virtualanode.h: Auto *pan_before[MAXCHANNELS], *pan_after[MAXCHANNELS]; so I used it for max number of channels for auto-created project (was just 6): diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index f245018a..690c7ef8 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -5088,7 +5107,7 @@ int MWindow::select_asset(Asset *asset, int vstream, int astream, int delete_tra int channels = 0; for( uint64_t mask=channel_mask; mask!=0; mask>>=1 ) channels += mask & 1; if( channels < 1 ) channels = 1; - if( channels > 6 ) channels = 6; + if( channels > MAXCHANNELS ) channels = MAXCHANNELS; session->audio_tracks = session->audio_channels = channels; int *achannel_positions = preferences->channel_positions[session->audio_channels-1]; =====
Hi Andrew! I think it was right as before. If understand well, that max number of channels is 6 because 5.1 (=6) channel surround (home theatre system). There is also 7.1 channel surround but I think it is so extreme. https://www.crutchfield.com/S-fh0nbRGnCAa/learn/learningcenter/home/homethea... IgorBeg Il 19/11/2020 03:07, Andrew Randrianasulu via Cin ha scritto:
so I used it for max number of channels for auto-created project (was just 6):
diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index f245018a..690c7ef8 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -5088,7 +5107,7 @@ int MWindow::select_asset(Asset *asset, int vstream, int astream, int delete_tra int channels = 0; for( uint64_t mask=channel_mask; mask!=0; mask>>=1 ) channels += mask& 1; if( channels< 1 ) channels = 1; - if( channels> 6 ) channels = 6; + if( channels> MAXCHANNELS ) channels = MAXCHANNELS; session->audio_tracks = session->audio_channels = channels;
Max channels per audio tracks is 32. see: https://www.cinelerra-gg.org/forum/tutorials/introducing-video-editing-for-b... (the last reply)
32 is the Max Audio channels for the Project (no max audio tracks of course), but I think that code is referred to the number of audio channels that a video source has in Resources (and it was at max 6 for 5.1). I can wrong, I don't understand the codes, but Andrew know. IgorBeg Il 19/11/2020 11:12, Andrea paz ha scritto:
Max channels per audio tracks is 32.
see: https://www.cinelerra-gg.org/forum/tutorials/introducing-video-editing-for-b...
(the last reply)
Andrew and all, Here an example because I think it was right as before. In the screencast I am using a video file by Pierre ( http://www.gvgdevelopers.com/K2DevGuide/Clips2/NTSC_SD_DV25_colorbar.avi ) to show what I said. The source video "NTSC_SD_DV25_colorbar.avi" has 8 audio stereo channels. So, with your change, Cinelerra-GG will create 16 audio channels instead of 6, because MAXCHANNELS=32. IMHO, I think it would be too much. You can confirm or less if that code is for that feature. Screencast to https://streamable.com/woem2b Thanks! IgorBeg Il 19/11/2020 03:07, Andrew Randrianasulu via Cin ha scritto:
so I used it for max number of channels for auto-created project (was just 6):
diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index f245018a..690c7ef8 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -5088,7 +5107,7 @@ int MWindow::select_asset(Asset *asset, int vstream, int astream, int delete_tra int channels = 0; for( uint64_t mask=channel_mask; mask!=0; mask>>=1 ) channels += mask& 1; if( channels< 1 ) channels = 1; - if( channels> 6 ) channels = 6; + if( channels> MAXCHANNELS ) channels = MAXCHANNELS; session->audio_tracks = session->audio_channels = channels;
int *achannel_positions = preferences->channel_positions[session->audio_channels-1];
=====
В сообщении от Saturday 21 November 2020 14:06:48 Igor BEGHETTO via Cin написал(а):
Andrew and all, Here an example because I think it was right as before. In the screencast I am using a video file by Pierre ( http://www.gvgdevelopers.com/K2DevGuide/Clips2/NTSC_SD_DV25_colorbar.avi ) to show what I said. The source video "NTSC_SD_DV25_colorbar.avi" has 8 audio stereo channels. So, with your change, Cinelerra-GG will create 16 audio channels instead of 6, because MAXCHANNELS=32. IMHO, I think it would be too much.
well, today you can hide/fold them behind gang mode ...? But yes, I did this change especially due to this file. Most of those channels in this specific file are empty (only 4 are carrying sound), but for me this showed fact files with more than 6 ch. exist, and so loading them will raise '?' in user .... I even saw talk about something like 20+ ch. surround audio at ffmpeg-devel (but I have no such file yet to test). https://en.wikipedia.org/wiki/MPEG-H_3D_Audio (I don't think Cin can do real 3d sound, it all confined to single horizontal plane, yet such strangeness [128 core + 64 loudspeakers max!] now exist .....) You always can delete unneeded tracks, but from what I recall loading 4ch audio + 1 ch. video file to 1 vid ch/2 aud. ch project will result in some reposition of audio tracks, enlarging project's total timeline .... But to be honest right now I'm unsure and much more concerned about who will land any of those mods .... this particular change can be dropped, but who will apply others ....
You can confirm or less if that code is for that feature. Screencast to https://streamable.com/woem2b Thanks!
IgorBeg
Il 19/11/2020 03:07, Andrew Randrianasulu via Cin ha scritto:
so I used it for max number of channels for auto-created project (was just 6):
diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index f245018a..690c7ef8 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -5088,7 +5107,7 @@ int MWindow::select_asset(Asset *asset, int vstream, int astream, int delete_tra int channels = 0; for( uint64_t mask=channel_mask; mask!=0; mask>>=1 ) channels += mask& 1; if( channels< 1 ) channels = 1; - if( channels> 6 ) channels = 6; + if( channels> MAXCHANNELS ) channels = MAXCHANNELS; session->audio_tracks = session->audio_channels = channels;
int *achannel_positions = preferences->channel_positions[session->audio_channels-1];
=====
Andrew/Igor/Andrea: Good suggestions and discussion with multiple input is exactly what we need. I agree that it should stay the way it is for now, but I have never heard of 3d sound - ( ;
But to be honest right now I'm unsure and much more concerned about who will land any of those mods .... this particular change can be dropped, but who will apply others ....
For now, which could change at any minute, I would like to continue to test mods as a check on my laptop as I had been doing and attempt to check them into GIT. I will let you know how this goes. ...Phyllis
В сообщении от Saturday 21 November 2020 21:25:23 Phyllis Smith via Cin написал(а):
Andrew/Igor/Andrea:
Good suggestions and discussion with multiple input is exactly what we need. I agree that it should stay the way it is for now, but I have never heard of 3d sound - ( ;
But to be honest right now I'm unsure and much more concerned about who will land any of those mods .... this particular change can be dropped, but who will apply others ....
For now, which could change at any minute, I would like to continue to test mods as a check on my laptop as I had been doing and attempt to check them into GIT. I will let you know how this goes. ...Phyllis
I really, really hope nothing newly bad is on horizon for you, Phyllis ... THANKS a lot for staying with us.
Andrew, thanks for confirm the code about. Yes it is true, you can delete audio tracks and change number of channels in Setting->Format, and use GangChannel/GangMedia. As you saw in my example CinelerraGG always create all audio tracks that the clip contains (in the example there are empty audio tracks) and that is right. Audio Channels are not audio tracks and I would leave max channels to 6. I think it may be a good standard when there are more than 6 channels. Phyllis wrote:
For now, which could change at any minute, I would like to continue to test mods as a check on my laptop as I had been doing and attempt to check them into GIT. I will let you know how this goes. Phyllis, I am glad you are here. Thanks!
IgorBeg
В сообщении от Sunday 22 November 2020 11:39:25 Igor BEGHETTO via Cin написал(а):
Andrew, thanks for confirm the code about. Yes it is true, you can delete audio tracks and change number of channels in Setting->Format, and use GangChannel/GangMedia. As you saw in my example CinelerraGG always create all audio tracks that the clip contains (in the example there are empty audio tracks) and that is right. Audio Channels are not audio tracks and I would leave max channels to 6. I think it may be a good standard when there are more than 6 channels.
There is 7.1 setup on my audiocard: aplay -L null Discard all samples (playback) or generate zero samples (capture) jack JACK Audio Connection Kit sysdefault:CARD=SB HDA ATI SB, ALC892 Analog Default Audio Device front:CARD=SB,DEV=0 HDA ATI SB, ALC892 Analog Front speakers surround21:CARD=SB,DEV=0 HDA ATI SB, ALC892 Analog 2.1 Surround output to Front and Subwoofer speakers surround40:CARD=SB,DEV=0 HDA ATI SB, ALC892 Analog 4.0 Surround output to Front and Rear speakers surround41:CARD=SB,DEV=0 HDA ATI SB, ALC892 Analog 4.1 Surround output to Front, Rear and Subwoofer speakers surround50:CARD=SB,DEV=0 HDA ATI SB, ALC892 Analog 5.0 Surround output to Front, Center and Rear speakers surround51:CARD=SB,DEV=0 HDA ATI SB, ALC892 Analog 5.1 Surround output to Front, Center, Rear and Subwoofer speakers surround71:CARD=SB,DEV=0 HDA ATI SB, ALC892 Analog 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers Anyway, my point was you can't see if track/ch is empty or full before you load it. In unmodified case you better to check media info in asset window and then abjust channels for newly-created project. Some manual work. Also, using same define for all codebase allow you to change things in one central place, without remembering this special number in this specific file. And finally, my change shouldn't affect your usual files. And really pathological/broken files with 1000 channels still will be cut down to reasonable amount of channels. You can manipulate all tracks via GUI, but this *6* number must be changed in code and Cin recompiled - some time on user end, if user will be curious enough to investigate this limitation. But again, I can carry this patch locally and dealt with consequences too ...
Phyllis wrote:
For now, which could change at any minute, I would like to continue to test mods as a check on my laptop as I had been doing and attempt to check them into GIT. I will let you know how this goes. Phyllis, I am glad you are here. Thanks!
IgorBeg
I don't think we should arbitrarily limit Cinélerra-GG's ability to use and display track/ch sound. Cin-GG presents itself as an NLE for pro-users or professional users. If a new model of sound environment (more channels) is introduced, it is certain that daring users will want to experiment with it and Cin-GG should allow it. To the extent that it is possible to keep track/ch management and display easy, I don't think we should limit them simply to what is currently the most common... Pierre Le 20-11-22 à 04 h 32, Andrew Randrianasulu via Cin a écrit :
В сообщении от Sunday 22 November 2020 11:39:25 Igor BEGHETTO via Cin написал(а):
Andrew, thanks for confirm the code about. Yes it is true, you can delete audio tracks and change number of channels in Setting->Format, and use GangChannel/GangMedia. As you saw in my example CinelerraGG always create all audio tracks that the clip contains (in the example there are empty audio tracks) and that is right. Audio Channels are not audio tracks and I would leave max channels to 6. I think it may be a good standard when there are more than 6 channels.
There is 7.1 setup on my audiocard:
aplay -L null Discard all samples (playback) or generate zero samples (capture) jack JACK Audio Connection Kit sysdefault:CARD=SB HDA ATI SB, ALC892 Analog Default Audio Device front:CARD=SB,DEV=0 HDA ATI SB, ALC892 Analog Front speakers surround21:CARD=SB,DEV=0 HDA ATI SB, ALC892 Analog 2.1 Surround output to Front and Subwoofer speakers surround40:CARD=SB,DEV=0 HDA ATI SB, ALC892 Analog 4.0 Surround output to Front and Rear speakers surround41:CARD=SB,DEV=0 HDA ATI SB, ALC892 Analog 4.1 Surround output to Front, Rear and Subwoofer speakers surround50:CARD=SB,DEV=0 HDA ATI SB, ALC892 Analog 5.0 Surround output to Front, Center and Rear speakers surround51:CARD=SB,DEV=0 HDA ATI SB, ALC892 Analog 5.1 Surround output to Front, Center, Rear and Subwoofer speakers surround71:CARD=SB,DEV=0 HDA ATI SB, ALC892 Analog 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
Anyway, my point was you can't see if track/ch is empty or full before you load it. In unmodified case you better to check media info in asset window and then abjust channels for newly-created project. Some manual work.
Also, using same define for all codebase allow you to change things in one central place, without remembering this special number in this specific file.
And finally, my change shouldn't affect your usual files. And really pathological/broken files with 1000 channels still will be cut down to reasonable amount of channels. You can manipulate all tracks via GUI, but this *6* number must be changed in code and Cin recompiled - some time on user end, if user will be curious enough to investigate this limitation.
But again, I can carry this patch locally and dealt with consequences too ...
Phyllis wrote:
For now, which could change at any minute, I would like to continue to test mods as a check on my laptop as I had been doing and attempt to check them into GIT. I will let you know how this goes. Phyllis, I am glad you are here. Thanks!
IgorBeg
added as git diff file attached to this mail. I am not sure that consensus was, but I see even dvd can contain up to 7.1 audio, and even this mpeg multichannel encoder I just rediscovered had some support/experiments in this direction, in 1990s) вс, 22 нояб. 2020 г., 16:00 Pierre autourduglobe via Cin < [email protected]>:
I don't think we should arbitrarily limit Cinélerra-GG's ability to use and display track/ch sound.
Cin-GG presents itself as an NLE for pro-users or professional users. If a new model of sound environment (more channels) is introduced, it is certain that daring users will want to experiment with it and Cin-GG should allow it.
To the extent that it is possible to keep track/ch management and display easy, I don't think we should limit them simply to what is currently the most common...
Pierre
Le 20-11-22 à 04 h 32, Andrew Randrianasulu via Cin a écrit :
В сообщении от Sunday 22 November 2020 11:39:25 Igor BEGHETTO via Cin написал(а):
Andrew, thanks for confirm the code about. Yes it is true, you can delete audio tracks and change number of channels in Setting->Format, and use GangChannel/GangMedia. As you saw in my example CinelerraGG always create all audio tracks that the clip contains (in the example there are empty audio tracks) and that is right. Audio Channels are not audio tracks and I would leave max channels to 6. I think it may be a good standard when there are more than 6 channels.
There is 7.1 setup on my audiocard:
aplay -L null Discard all samples (playback) or generate zero samples (capture) jack JACK Audio Connection Kit sysdefault:CARD=SB HDA ATI SB, ALC892 Analog Default Audio Device front:CARD=SB,DEV=0 HDA ATI SB, ALC892 Analog Front speakers surround21:CARD=SB,DEV=0 HDA ATI SB, ALC892 Analog 2.1 Surround output to Front and Subwoofer speakers surround40:CARD=SB,DEV=0 HDA ATI SB, ALC892 Analog 4.0 Surround output to Front and Rear speakers surround41:CARD=SB,DEV=0 HDA ATI SB, ALC892 Analog 4.1 Surround output to Front, Rear and Subwoofer speakers surround50:CARD=SB,DEV=0 HDA ATI SB, ALC892 Analog 5.0 Surround output to Front, Center and Rear speakers surround51:CARD=SB,DEV=0 HDA ATI SB, ALC892 Analog 5.1 Surround output to Front, Center, Rear and Subwoofer speakers surround71:CARD=SB,DEV=0 HDA ATI SB, ALC892 Analog 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
Anyway, my point was you can't see if track/ch is empty or full before you load it. In unmodified case you better to check media info in asset window and then abjust channels for newly-created project. Some manual work.
Also, using same define for all codebase allow you to change things in one central place, without remembering this special number in this specific file.
And finally, my change shouldn't affect your usual files. And really pathological/broken files with 1000 channels still will be cut down to reasonable amount of channels. You can manipulate all tracks via GUI, but this *6* number must be changed in code and Cin recompiled - some time on user end, if user will be curious enough to investigate this limitation.
But again, I can carry this patch locally and dealt with consequences too ...
Phyllis wrote:
For now, which could change at any minute, I would like to continue to test mods as a check on my laptop as I had been doing and attempt to check them into GIT. I will let you know how this goes. Phyllis, I am glad you are here. Thanks!
IgorBeg
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
Patch will be checked into GIT. I read all of the email again and it seems to at least be limited to 32 in most cases, but I find that if you use Settings->Format, you can create more than 32 channels anyway as I set it to 36 and it did not complain. This is confusing though, when I load: http://www.gvgdevelopers.com/K2DevGuide/Clips2/NTSC_SD_DV25_colorbar.avi into CinGG, it shows 16 audio tracks!, but ffprobe, mediainfo, and Resources window info/details shows 8! I am not sure that consensus was, but I see even dvd can contain up to 7.1
audio, and even this mpeg multichannel encoder I just rediscovered had some support/experiments in this direction, in 1990s)
чт, 25 янв. 2024 г., 20:45 Phyllis Smith <[email protected]>:
Patch will be checked into GIT. I read all of the email again and it seems to at least be limited to 32 in most cases, but I find that if you use Settings->Format, you can create more than 32 channels anyway as I set it to 36 and it did not complain.
This is confusing though, when I load:
http://www.gvgdevelopers.com/K2DevGuide/Clips2/NTSC_SD_DV25_colorbar.avi into CinGG, it shows 16 audio tracks!, but ffprobe, mediainfo, and Resources window info/details shows 8!
may be someone (ffmpeg devs, mediainfo devs) also reasoned most files will be <=8 channels? Or may be file a bit corrupt ....? I once (recently) created audio file with 1024 channels ;) by means of coding error
I am not sure that consensus was, but I see even dvd can contain up to 7.1
audio, and even this mpeg multichannel encoder I just rediscovered had some support/experiments in this direction, in 1990s)
participants (5)
-
Andrea paz -
Andrew Randrianasulu -
Igor BEGHETTO -
Phyllis Smith -
Pierre autourduglobe