Rockbox Technical Forums

Support and General Use => Recording => Topic started by: Mmmm on October 16, 2006, 06:49:25 AM

Title: Trigger for SWCODEC players
Post by: Mmmm on October 16, 2006, 06:49:25 AM
I have enabled the trigger function for software codec players (x5 and irivers).

I have also added the options to have the trigger pause and resume or start a new file on a low or high db setting.

It needs a bit of testing though....
give it a go...

http://www.rockbox.org/tracker/task/6194
Title: Re: Trigger for SWCODEC players
Post by: Febs on October 16, 2006, 09:15:28 AM
I haven't had a chance to try the patch yet, though I will definitely try it to record some things I have coming up later this week.  I spent a good part of yesterday morning editing files from a recording I made last week to trim out unnecessary parts between songs, and this patch will be a big time saver for things like that.

Question:  is there any way to override the trigger?  For example, if the recorder is automatically paused between songs, and the next song starts at a level that is too low to trigger a new file, I'd like to be able to manually restart the recording (ideally, with the prerecord time set such that I don't miss the beginning of the song).

Title: Re: Trigger for SWCODEC players
Post by: petur on October 16, 2006, 10:13:43 AM
one probably would also have minimum time limits so that you don't end up with 100 recordings of 5 seconds :) - don't know if the current code does this already....
Title: Re: Trigger for SWCODEC players
Post by: Mmmm on October 16, 2006, 12:31:49 PM
The prerecord doesn't work with pause yet I'm afraid, but it does with stop, you can override the triggered pause by pressing the pause button or the track split button if that it what you're using, also with the track split, you wont get lots of 5 second files because there are two trigger points, a high and a low and a high must be triggered before a low. So if you split on a low then a high must trigger before you can split again on a low...erm, does that make sense? And the current code already has a minimum time before you can have a trigger on a high if you want..
Title: Re: Trigger for SWCODEC players
Post by: Mmmm on October 17, 2006, 05:21:10 AM
I've now added multiple screen support, so it should be finished...just needs some thorough testing on all targets....

See the tracker for latest patch.
Title: Re: Trigger for SWCODEC players
Post by: Mmmm on October 17, 2006, 02:45:27 PM
Hmmm, there doesn't seem to be any documentation on the trigger, so seeing as I just figured out exactly how it works and fixed my patch because it broke some things  ::) , here's what all those options do:

Trigger:
        Once: Apply the trigger once and then switch the trigger off when it reaches the stop state.
        Repeat: Keep the trigger active so that it continually detects trigger events.

Triggertype:
        Stop: Stop the recording when the trigger enters the stop state. Start new file when trigger enters the record state.
        Pause: Pause the recording when the trigger enters the stop state. Resume recording when trigger enters the record state.
        Nf on stp: Start a new file when the trigger enters the stop state (split track). Do nothing (apart from the very first time when it will start recording) when trigger enters the record state.

Prerecord time: Amount of prerecording buffer to use while recording is stopped (max 30secs).

Start above: The minimum number of decibels needed to place the trigger in the record state.

for at least: The amount of time the input must be above the 'Start above' level before the record state is entered.

Stop below: The maximum number of decibels allowed to place the trigger in the stop state.

for at least: The amount of time the input must be below the 'Stop below' level before the record state is entered.

Presplit gap: For this to work the value must be smaller than the the 'Stop below' value. To disable this feature it must be set above the 'Stop below' value.
When the input is below the 'Stop below' value for the amount of time set here, if the input is then increased to be above the 'Start above' value for the amount of time in the Start 'for at least' setting, a new file will start.

Settings example: (for clarity)
Start above = -22db
for at least = 1 sec
Stop below = -41db
for at least = 15 seconds
Presplit gap = 2 seconds
situation: recording from a cd

When the first track starts to play, when the input is above -22 db for 1 second the recording will begin.
At the end of the first track, if there are more that 2 seconds and fewer than 15 seconds under -41db , a new file will begin when the input is above -22 db for 1 second.
If the gap between the songs (less than -41db) is more than 15 seconds or you get to the end of the album, recording will stop.

Phew, it's quite difficult to explain in words... If you can understand that and can make it more obvious then maybe it should be put in the manual (after I commit it of course).

It still needs lots of testing though... anyone?  :)
Title: Re: Trigger for SWCODEC players
Post by: LinusN on October 17, 2006, 02:59:12 PM
There is this page:

http://www.rockbox.org/twiki/bin/view/Main/VolumeTriggeredRecording

and this of course:

http://www.rockbox.org/twiki/bin/view/Main/TriggerManual
Title: Re: Trigger for SWCODEC players
Post by: Mmmm on October 17, 2006, 03:04:25 PM
Oh yeah! :D

I'm just too impatient when looking for info, I just looked in the manual and saw it wasn't there! ::)
Title: Re: Trigger for SWCODEC players
Post by: Mmmm on November 09, 2006, 07:38:12 AM
Well, this is committed so if you want to give it a go and put any comments you have here then that'd be good :)