Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - miyake

#76
Reverse Engineering / Re: High ISO needs more HW resource
September 05, 2012, 06:01:36 PM
I see. Thanx!
#77
Main Builds / Re: 600D Audio TEST release - 2.3 based
September 05, 2012, 05:55:55 PM
Quote from: Kromofone on September 05, 2012, 05:53:32 PM
Yeah I think it's the canon one!
I'll try to reproduce it and catch it on video, will upload as soon as I accomplish it.

Ah, OK....
Maybe I can't solve it. It's not do a negative effect to us. So never mind it.
#78
Main Builds / Re: 600D Audio TEST release - 2.3 based
September 05, 2012, 05:49:19 PM
QuoteI get this blinking bar in the middle of the screen

Ah, Maybe it's a canon menu?right?
I can see it too when I push trash button.  But I can't see when I change override on/off...

Can I see your screen?
#79
Main Builds / Re: 600D Audio TEST release - 2.3 based
September 05, 2012, 05:19:36 PM
Quote from: Kromofone on September 05, 2012, 05:14:04 PM
Awesomee!! :D
I'll begin testing it more with caution, thanks for the info! :)

However , Still problem found on sound recording with video recording together. I already sent patch to alex.
So I will publish next autoexec.bin when my patch is accepted.
#80
Main Builds / Re: 600D Audio TEST release - 2.3 based
September 05, 2012, 05:16:55 PM
Good morning 1%

Quote from: 1% on September 05, 2012, 05:07:41 PM
You can still control output volume like before, right? Just higher default and maximum volume? I've got to work but I'll test when I come back.

I think null wav stream in video still happen but thats better than low bitrate or no sound.

Yes, you can control outout volume same as previously. Previously boost is always -12db. So I changed 0db. The most best way is add a new menu structure which is controlling output volume and this boost together. But now I choose source compatibility for another cameras. It's not so bad.

The "null wav stream" will happen on  FPS override and wav recording toghether. right?? And it's a recorded all null in a file?
In my 600D, the problem was gone. Or another problems?

Anyway, have a good day!
#81
Main Builds / Re: 600D Audio TEST release - 2.3 based
September 05, 2012, 04:39:40 PM
@1% & scrax & Kromofone
PLEASE BE CAREFUL FOR CURRENT 600D AUDIO CODE.
Now I found ML_PLYBAK_BOST_VOL_DEF was -12db. Current code is change to 0db. Then monitoring sound is really loud! :o
It's good to hear monitoring sound for High impedance Headphones.

I think Kromofone don't need to buy Headphone AMP. Yey!!!!!!!!!!!!!!!!
#82
Reverse Engineering / Re: High ISO needs more HW resource
September 05, 2012, 03:15:48 PM
Thank you for your explaining.
Anyway, CBR is not Constant bitrate. We can't set maximum bitrate for CBR. right?
#83
Main Builds / Re: 600D Audio TEST release - 2.3 based
September 05, 2012, 12:59:44 PM
1%

I was cleanup some old codes.
Then I could save FPS override with separate wav audio.Also we don't need to wait in beep.c.
Now our 600D audio_configure is similar time with another model's one.
#84
Reverse Engineering / High ISO needs more HW resource
September 05, 2012, 08:54:46 AM
Is this a well known things?
I just understand it.

CBR 3.0 + ISO3200 = recording stop immediately
CBR 2.6 + ISO3200 = recording stop immediately
CBR 2.4 + ISO3200 = sometime recording stop
CBR 1.0 + ISO 3200 = no problem

CBR 3.0 + ISO200 = no problem
Then push ISO button and ISO change dynamically, will recording stop when we changed to over ISO 1600
#85
Main Builds / Re: 600D Audio TEST release - 2.3 based
September 04, 2012, 08:27:20 AM
@1%
Yay!!
#86
Main Builds / Re: 600D Audio TEST release - 2.3 based
September 04, 2012, 04:13:19 AM
@Alex

This patch will solve WAV writing issue. I confirmed.
- current code has no buffer
- If write speed is not enough, wav data will lost
- This patch adding a queue for reading. and write_q_task will write asyncronous. So It has no data lost.
- But actually write speed is not enough, NotifyBox will telling "Use more faster card"
*Now I can write CBR3.0 and WAV recording together with no data lost.
*tested WAV recording + CBR 2.0 CBR 2.5 CBR 2.8

Please test this on your side.

diff -r ae36c8b5889b src/beep.c
--- a/src/beep.c        Sun Sep 02 02:50:47 2012 +0900
+++ b/src/beep.c        Tue Sep 04 11:33:29 2012 +0900
@@ -322,12 +322,73 @@
     return ans;
}

+
+
+typedef struct _write_q {
+    int multiplex;
+    void *buf;
+    struct _write_q *next;
+}WRITE_Q;
+
+#define QBUF_SIZE 4
+#define QBUF_MAX 20
+WRITE_Q *rootq;
+
+static void add_write_q(void *buf){
+    WRITE_Q *tmpq = rootq;
+    WRITE_Q *newq;
+
+    int i=0;
+    while(tmpq->next){
+        tmpq = tmpq->next;
+        i++;
+    }
+    if(i > QBUF_MAX){
+        NotifyBox(2000,"Lost WAV data\nUse more faster card");
+        return;
+    }
+
+    if(tmpq->multiplex < QBUF_SIZE){
+        if(!tmpq->buf){
+            tmpq->buf = alloc_dma_memory(WAV_BUF_SIZE*QBUF_SIZE);
+        }
+        int offset = WAV_BUF_SIZE * tmpq->multiplex;
+        memcpy(tmpq->buf + offset,buf,WAV_BUF_SIZE);
+        tmpq->multiplex++;
+    }else{
+        newq = AllocateMemory(sizeof(WRITE_Q));
+        memset(newq,0,sizeof(WRITE_Q));
+        newq->buf = alloc_dma_memory(WAV_BUF_SIZE*QBUF_SIZE);
+        memcpy(newq->buf ,buf,WAV_BUF_SIZE);
+        newq->multiplex++;
+        tmpq->next = newq;
+    }
+}
+
+static void write_q_dump(){
+    WRITE_Q *tmpq = rootq;
+    WRITE_Q *prevq;
+
+    while(tmpq->next){
+        prevq = tmpq;
+        tmpq = tmpq->next;
+        FIO_WriteFile(file, UNCACHEABLE(tmpq->buf), WAV_BUF_SIZE * tmpq->multiplex);
+        free_dma_memory(tmpq->buf);
+        prevq->next = tmpq->next;
+        FreeMemory(tmpq);
+        tmpq = prevq;
+    }
+}
+
+
+
+
static void asif_rec_continue_cbr()
{
     if (file == INVALID_PTR) return;

     void* buf = wav_buf[wav_ibuf];
-    FIO_WriteFile(file, UNCACHEABLE(buf), WAV_BUF_SIZE);
+    add_write_q(buf);

     if (audio_recording == 2)
     {
@@ -504,6 +565,21 @@
static void wav_playback_do();
static void wav_record_do();

+
+static void write_q_task()
+{
+    TASK_LOOP
+    {
+        if (audio_recording==1 || rootq->next)
+        {
+            write_q_dump();
+        }
+        msleep(500);
+    }
+}
+
+TASK_CREATE( "write_q_task", write_q_task, 0, 0x16, 0x1000 );
+
static void beep_task()
{
     TASK_LOOP
@@ -846,7 +922,10 @@
{
     wav_buf[0] = alloc_dma_memory(WAV_BUF_SIZE);
     wav_buf[1] = alloc_dma_memory(WAV_BUF_SIZE);
-
+    rootq = AllocateMemory(sizeof(WRITE_Q));
+    memset(rootq,0,sizeof(WRITE_Q));
+    rootq->multiplex=100;
+
     beep_sem = create_named_semaphore( "beep_sem", 0 );
     menu_add( "Audio", beep_menus, COUNT(beep_menus) );
     find_next_wav(0,1);



@1%
I just found your post now. Anyway, I can done without shoot_malloc. Do you know where is already described what is difference of AllocateMemory /allocate_dma_memory/shoot_malloc....
I know only these malloc is getting different memory spaces. But I don't know which one is best to use something.
#87
Main Builds / Re: 600D Audio TEST release - 2.3 based
September 03, 2012, 06:17:29 PM
Ah, 1%.
If you use my codes. I'm not merged current Alex's codes. You may try to use after finishing mergeing.
BTW,,, how many times I need to merge work for it? What is point of merge to main repo?

#88
Main Builds / Re: 600D Audio TEST release - 2.3 based
September 03, 2012, 05:54:18 PM
Now 600D code is overriding audio ic setting, and we can get sound without canon setting.
So , "canon audio disable" means only H264 without audio.
we can get WAV sound with disabled canon audio now.

We need to talk this kind of default actions.
#89
Main Builds / Re: 600D Audio TEST release - 2.3 based
September 03, 2012, 05:03:06 PM
@1% and alex

Maybe this patch solved CBR3.0 and WAV record issue.
Previously I only to test on my KINGMAX SD card.

Now I have 2 SD cards.
- KINGMAX 32GB SDHC
-SANDISK EXTREME PRO 64GB SDXC

my code provide to solve CBR 3.0 + WAV record using SANDISK. But I can't confirm normal writting method using KINGMAX.
So I don't say correct thing.
Anyway, writing speed is depend the reason of  lost audio segment.

We need to add asynchronous read/write for storing WAV sound.
#90
Main Builds / Re: 600D Audio TEST release - 2.3 based
September 03, 2012, 01:24:44 PM
I want to record CBR 3.0 with WAV sound.
Current code is sometime lost audio buffer when finish writting to file.
I guess, WAV write is waiting(blocking) to finish MVR write. Then , audio buffer will renewal to newest raw data.

Then I make a patch for testing. If we aggregate writing part, we can success writing together or not.
#91
Main Builds / Re: 600D Audio TEST release - 2.3 based
September 03, 2012, 12:55:23 PM
This is wav writting buffering patch.

diff -r ae36c8b5889b src/beep.c
--- a/src/beep.c        Sun Sep 02 02:50:47 2012 +0900
+++ b/src/beep.c        Mon Sep 03 19:53:43 2012 +0900
@@ -172,7 +172,10 @@
static FILE* file = INVALID_PTR;
#define WAV_BUF_SIZE 8192
static int16_t* wav_buf[2] = {0,0};
+#define WBUF_SIZE 16
+static int16_t* write_buf[WBUF_SIZE];
static int wav_ibuf = 0;
+static int write_ibuf = 0;

static void asif_continue_cbr()
{
@@ -327,7 +330,18 @@
     if (file == INVALID_PTR) return;

     void* buf = wav_buf[wav_ibuf];
-    FIO_WriteFile(file, UNCACHEABLE(buf), WAV_BUF_SIZE);
+    memcpy(write_buf[write_ibuf],buf,WAV_BUF_SIZE);
+    if (write_ibuf==(WBUF_SIZE-1)){
+        int i;
+        for(i=0;i<WBUF_SIZE;i++){
+            void* writebuf = write_buf[i];
+            FIO_WriteFile( file, UNCACHEABLE(writebuf), WAV_BUF_SIZE );
+        }
+        write_ibuf=0;
+    }else{
+        wav_ibuf = !wav_ibuf;
+        write_ibuf++;
+    }

     if (audio_recording == 2)
     {
@@ -338,7 +352,6 @@
         return;
     }
     SetNextASIFADCBuffer(buf, WAV_BUF_SIZE);
-    wav_ibuf = !wav_ibuf;
}

void WAV_Record(char* filename, int show_progress)
@@ -358,7 +371,7 @@
     SetSamplingRate(48000, 1);
     MEM(0xC092011C) = 4; // SetASIFADCModeSingleINT16

-    wav_ibuf = 0;
+    wav_ibuf=0;
     StartASIFDMAADC(buf1, WAV_BUF_SIZE, buf2, WAV_BUF_SIZE, asif_rec_continue_cbr, 0);
     while (audio_recording)
     {
@@ -846,6 +859,10 @@
{
     wav_buf[0] = alloc_dma_memory(WAV_BUF_SIZE);
     wav_buf[1] = alloc_dma_memory(WAV_BUF_SIZE);
+    int i=0;
+    for(i=0;i<WBUF_SIZE;i++){
+        write_buf[i] = alloc_dma_memory(WAV_BUF_SIZE);
+    }

     beep_sem = create_named_semaphore( "beep_sem", 0 );
     menu_add( "Audio", beep_menus, COUNT(beep_menus) );



But result is not so good.
sound is some time lost and memcpy overhead increase CPU& mem.
You can change buffer size (how many buffers aggreate to write) by WBUF_SIZE ....


MSG added
This code is just only provide a write aggregation.
Not providing async write/read.
#92
Main Builds / Re: 600D Audio TEST release - 2.3 based
September 03, 2012, 07:59:45 AM
Thanks for your testing.

Need to add simple buffer function for testing. And recording time is most sensibly for usage of CPU/mem.
Full ringbuffer implementation need a lot of CPUs.

hmm, how to share my codes. I don't wanna add testing code to my 600D audio repo.
made a patch for it

MSG added
hmm, how to asynchronous read/write impliment? need to more research on audio buffer...
#93
Main Builds / Re: 600D Audio TEST release - 2.3 based
September 03, 2012, 06:31:58 AM
My English question was poor. but My understanding is  correct. I know GOP and it's architecture.
BTW, All user need to ALL I frames when they want to record WAV.
Adding Buffer function is more better I think. Because it's don't need to care about WAV with GOP.
Anyway, need more testing for it. And I have no repo for merged your codes. Can you try it?


BTW, it's a little difficult to collaborate code with another cameras.
I think WAV related functions need to implement another camera first. Then we will add 600D optimization after finishing them.
Now I can write all of your request, but I think it's not good for another cameras.
It's not only 600D functions (It's a global function), I think it's not good to write 600Daudio repos.
So I think we will talk more with Alex.
(Need to create new repo which is  WAV record with MVR-no-sound recording for creating patches.)
#94
Main Builds / Re: 600D Audio TEST release - 2.3 based
September 03, 2012, 06:15:50 AM
What you mean "gop 1"?
GOP only 1frame? Is this writing each GOP? Then H264 stream will write more small chunk on each frames?
right?
#95
Main Builds / Re: 600D Audio TEST release - 2.3 based
September 03, 2012, 04:35:38 AM
hmm,
My guess.
- h264 stream and voice data writing together.
- voice data writing gets blocking when finish previous writing.
-->On chip audio raw data is discard, and we can read next buffer.

I think canon audio data function using ring buffer, so I think we had it problem.
Then I think we also use memory buffer to read it.

BTW, I'm not testing voice tag functions yet  ;D

#96
Main Builds / Re: 600D Audio TEST release - 2.3 based
September 02, 2012, 05:31:07 AM
@1%
I see your work. And some people want to record sound FPS override. So we need to think about good UI for sound recording.

If we turn on "wave recording togeter"
-Automatically disable canon audio, if it enabled
-get current recording file name and then change extension to WAV for recording sound file.
-start wav recording when we push MVR record button.(Actually start recording after override setting will finish , I think.)

BTW, FPS override person is what is talking? I think FPS override need a lot of time for recording. Are they want to record all of time for recording FPS overriding video recording????
I think they only need few second for post.
#98
Main Builds / Re: 600D Audio TEST release - 2.3 based
September 02, 2012, 02:43:43 AM
QuoteI got echoes sometimes like there is a delay if BR gets too high but I need to test more. Right now I'm starting it manually.

What is "BR"?

QuoteI dunno if clocking is related as wav audio is separate from MVR and shouldn't be affected by it. Have not tried with FPS override which does change clocking.
The clocking is just my guess, I don't know correct point. And MVR with audio need to more CPU/Buffer, because H264 ?clocking? is faster than normal recording. So audio need to fit . It's need a cpu and buffer . So it will stop, I guess.

-Menu things
As your said some combinations.
But I think, only Hi-Bitrate need to record audio .
I think , don't need to record sound on FPS override.

If so,  I will add "With WAV record on/off" menu in Bitrate submenu. Then actual code in audio.c , I imagine.
How do you think?
#99
Main Builds / Re: 600D Audio TEST release - 2.3 based
September 01, 2012, 07:56:56 PM
Confirmed on my code too. I also recording CBR 2.0 + wav sound.
Check my repo. And I also check your repo .
BTW, I feel recorded sound is a little fast. The bitrate setting is related with clock or some h264 clocking to be fast?
Then, If we found how to solve clock? things, we can record normal recording path, I guess.

Anyway, I will think about best user interface for it.
I think  add some more options for doing this , and override when start recording.
#100
Main Builds / Re: 600D Audio TEST release - 2.3 based
September 01, 2012, 06:41:54 PM
@1%
Let me confirm your will.
- You want to use audio recording when audio off in canon menu. right?
-You want to use remote shot when audio off in canon menu. right?