PDA

View Full Version : What is a SBE?


irishcrazy2005
2005-01-09, 06:52 PM
This may be a stuipd question, but I did a search on TTD and on Google and I couldn't really figure it out. What is a sector boundary error? Thanks for the help in advance.

-Phil

Five
2005-01-10, 12:15 AM
Sector Boundary Errors occur when an audio cdr is burned. If the original files aren't cut in just the right place, then you'll get a pop sound between tracks.

**a more technical explanation is sure to follow**

oldbrokentapes
2005-01-10, 05:40 AM
Audio CDs hold data in minimum block ("sector") sizes of 1/75th second (0.01333 seconds / 2352 bytes of data / 588 stereo samples). If you try to burn an audio file to an audio CD, and its length is not an exact number of sectors, the last sector will usually be padded with digital silence (zeros). This gap is referred to as a "sector boundary error" because it is an error caused by a large audio file having been split into individual tracks at places other than sector boundaries (1/75th second intervals).

As such, an SBE is a silence of less-than-but-not-equal-to 1/75th second found "between" audio tracks on a CD. I say "between" because technically it is at the end of the preceeding track and has nothing to do with the one that follows. In some cases, this flaw could be completely unnoticeable, as it could be only one sample, and could fit neatly into the current flow of samples. However, more likely it will leave an audible silence, or an audible click. The click is caused when the silence interrupts a "loud" part of the waveform, i.e. one that is not close to digital silence. The waveform makes a sudden jump from a loud value to silence, and then back up again to carry on when it left off. I'll add some images in a minute for clarification.

Once you burn an audio CD with SBEs, the silences become part of the audio data - they won't disappear again if/when you extract back to your computer. An audio file extracted from a CD can never have an SBE because it's come from a CD and is as such sector-boundary-aligned.

It should be noted that "SBE" has falsely become something of a catch-all term for anything that has a short (non-two-second) silence between tracks. There was an Ozric Tentacles show seeded on STG over summer straight from the master, which had silences at the end of each track that were maybe 0.05-0.1 seconds in length. I've no idea what the taper did to achieve these, but I've seen the show on tradelists noting "quite a large SBE between each track" - there's no such thing as a "large" SBE - it's by definition less than 1/75th second in length.

If you wish to avoid creating files with SBEs, split using CDWave (http://www.cdwave.com). For assured reliability, don't actually split the files - just save the cuesheet and burn using software that can handle cuesheets (CDRWin, newer versions of Nero etc).

Thankfully, pure SBEs don't damage the audio data in any way, they just interrupt it, so with care can can be perfectly fixed by just removing the silence. The waveforms either side of the silence should automatically line up perfectly. TAO, and especially mp3 gaps, are not so easy to remedy as small parts of the audio data can be lost in the gap generation process.

I think that's pretty much everything!
see also http://www.cdrfaq.org and http://www.ambfaq.cjb.net

RainDawg
2005-01-10, 11:05 AM
There's nothing I can add to that explanation, and so I'll chime in to say "what he said" :).

TheMamba
2005-01-10, 11:26 AM
Nice one, Rob.

Five
2005-01-10, 12:17 PM
yes, very comprehensive!

other programs like CEP/Audition and GoldWave can also cut on sector boundaries. The thing is, these aren't freeware (and neither is CDWave). Another way to align the sector boundaries is to split a show to separate WAV files for each track, then compress to FLAC using FLAC frontend with the option "align on sector boundaries" enabled.

oldbrokentapes
2005-01-10, 12:49 PM
Cheers guys - glad to know the time I spend avoiding revision isn't completely wasted ;) However, Five's mention of Goldwave has made me realise I forgot something.

I'm 99% sure Goldwave can NOT split at sector boundaries, and I'm not entirely sure Cool Edit can either but I think it can but anyway. Goldwave can split at zero-crossings, but this is not the same as sector boundaries and can often be confused. Splitting at zero-crossings (i.e. when the waveform is at digital silence, as I mentioned earlier) will mean you don't get clicks, because there won't be a sudden jump in the sound level. However, you will still get a silence, which is infact almost inevitable if you use zero-crossings because the chances of a randomly place marker magically landing on a sector boundary are obviously severely limited if you insist the marker lands at zero amplitude.

There we go, can't think of anything else missing now. I promised pictures but I still haven't done them, although I have managed to read some more about management control as ethically problematic :geek: :D If anyone else wants to do some while I'm being all academic please feel free :)

Five
2005-01-10, 01:36 PM
with all due respect...

trust me, I've tried it with GoldWave and CEP, then double-checked the end result with FLAC frontend's align on sector boundary feature. If it didn't work with these progs I wouldn've had my ass nailed to the wall by now for seeding shows with SBEs! ;)

ps demonstrations can be arranged!

oldbrokentapes
2005-01-10, 02:14 PM
oops! :redface: Ah well, always healthy to be proven wrong once in a while! (and hey, I saved myself a 1% error margin anyway :D)

Where's the feature in Goldwave? I use that for a lot of my editing and it could come in useful. I had a quick look around to check before posting the above and couldn't spot anything :rolleyes:

Five
2005-01-10, 03:04 PM
For GoldWave it's in the cuelist section somewhere... there's a function to split a WAV on the cues and a little checkbox-type thing to make cd compatable tracks (I'm not at home right now, so I'm just going by memory).

For CEP, when you go to the cuelist there's a dropdown that lets you select cue types, I think they call it "track".

I can up screenshots tomorrow if my descriptions are a little vague! Like I said, not at home right now.

RainDawg
2005-01-10, 03:11 PM
Yes, CEP (and Goldwave I guess, though I don't use it) can be configured to split on SBs, but it is not set that way by default and is sometime more diifcult to configure than it's worth. You have to set selection block sizes so that it will only permit selections on every 588 samples instead of the default, which is 1. The just select>cut>paste and it'll be SB aligned. Still, this is not the default, and if you didn't set this up the chances are that you're not cutting on SBs with CEP.

Again, I am guessing that Goldwave and Soundforge are similar in this respect. Audacity, which is freeware, I believe can be configured to split on SBs in this way, though I have not tried it yet.

Always, always do shntool sbe check before burning just to MAKE SURE it wasn't screwed up because, as Rob said, once you burn it that way, the click is there for good.

Five
2005-01-10, 04:41 PM
GoldWave and CEP/Audition (at least more recent versions) can be set to cut on sector boundaries without inputing the 588 jazz... I'll post some screenshots and stuff in the next while. If anybody knows about how to do this with Soundforge, & Audacity, please post here.

lucasweb
2005-01-10, 04:56 PM
So say i found a show on TTD that a multiple SBE's lik this one (scroll down to my post where i show shntool results):

http://www.thetradersden.org/forums/showthread.php?t=2335

Does that mean it would be pulled?

Five
2005-01-10, 05:07 PM
I believe this has to be pulled... hopefully the SBEs will get fixed and this will be reseeded. I'll call everyone's attention to this right away, thanks for letting us know.

lucasweb
2005-01-10, 05:17 PM
Or maybe we could just make a note for people to correct the SBE's before they burn to cd and leave the thread as is because it aleady has 42 completes

Tate
2005-01-10, 09:48 PM
I got a question about SBEs. Sometimes, when I work on my files, like deleting the ticks and pops at the start of the track (and they have no SBEs to begin with), I then notice with 'shntool' that the WAV file now has a SBE (that infamous -b- appears). So I run shntool fix on the file and the -b- is gone. But, when I look at the WAV closely with Cool Edit, and I zoom in at the end, I can see a little tiny flat line.

When the file has the SBE, I see no flat line at the end. But when I fix it, it appears. I don't understand why? It has happened to me a few times. Anyone know what the problem is?

bstover
2005-12-02, 10:34 AM
I got a question about SBEs. Sometimes, when I work on my files, like deleting the ticks and pops at the start of the track (and they have no SBEs to begin with), I then notice with 'shntool' that the WAV file now has a SBE (that infamous -b- appears). So I run shntool fix on the file and the -b- is gone. But, when I look at the WAV closely with Cool Edit, and I zoom in at the end, I can see a little tiny flat line.

When the file has the SBE, I see no flat line at the end. But when I fix it, it appears. I don't understand why? It has happened to me a few times. Anyone know what the problem is?

You must be zoomed *way* in. You see the little tiny flat line because shntool has padded the file with a little tiny tad of silence.

Five
2005-12-02, 10:45 AM
yes, you've got to fix the entire set at once, so shntool can take a bit of the next track instead of padding with silence (unless, of course, it is the last track in which case it should be padded).

U2Lynne
2005-12-02, 11:47 AM
Since this thread has been bumped and it's about SBEs, I'll post here....

I was just looking at a show for sbes and the beginning and end look like this:

length expanded size cdr WAVE problems filename
2:00.68 21329148 -b- -- ---xx u22001-12-02d1t01.shn
5:21.65 56777324 --- -- ---xx u22001-12-02d1t02.shn
4:44.45 50203484 --- -- ---xx u22001-12-02d1t03.shn
...
7:28.42 79126028 --- -- ---xx u22001-12-02d2t09.shn
1:06.63 11790620 --- -- ---xx u22001-12-02d2t10.shn
9:26.68 100001804 -b- -- ---xx u22001-12-02d2t11.shn
121:10.32 1282504868 B (totals for 23 files, 0.7049 overall compression ratio)

I know an SBE is OK on the last track, but is it OK at the beginning track? And actually, when you see that there is an SBE, how do you know if the problem is at the beginning of the track or at the end of the track?

ColinM
2005-12-02, 12:16 PM
I've split a couple dozen shows with Goldwave and they always come out having no SBEs.

I'm make sure to test it before I seed it.

Five
2005-12-02, 03:11 PM
Since this thread has been bumped and it's about SBEs, I'll post here....

I was just looking at a show for sbes and the beginning and end look like this:

length expanded size cdr WAVE problems filename
2:00.68 21329148 -b- -- ---xx u22001-12-02d1t01.shn
5:21.65 56777324 --- -- ---xx u22001-12-02d1t02.shn
4:44.45 50203484 --- -- ---xx u22001-12-02d1t03.shn
...
7:28.42 79126028 --- -- ---xx u22001-12-02d2t09.shn
1:06.63 11790620 --- -- ---xx u22001-12-02d2t10.shn
9:26.68 100001804 -b- -- ---xx u22001-12-02d2t11.shn
121:10.32 1282504868 B (totals for 23 files, 0.7049 overall compression ratio)

I know an SBE is OK on the last track, but is it OK at the beginning track? And actually, when you see that there is an SBE, how do you know if the problem is at the beginning of the track or at the end of the track?
well, shntool presumes the problem is at the end of the track but in this case the best thing to do would be to pad the beginning and end of the disc with the correct number of silent samples. If you dump all of these tracks in shntool and tell it to fix the sbes, it will take < 588 samples from track 2 and paste it on the end of track 1, thereby creating a SBE on track 2, so it has to take a bit from track 3 to fix this and so on and so on until the last track which will get padded at the end.

can you run a preview of the shntool fix and post the results?

U2Lynne
2005-12-02, 03:33 PM
Thanks for answering, Jamie. But, um, can you run a preview of the shntool fix and post the results. :hmm: I have no clue what you are talking about here. xACT has these options for shntool: len, info, join, split, cmp, cue and then I can also fix the SBEs. I could do something in terminal mode if I knew what I was doing.

Five
2005-12-02, 04:15 PM
that's funny that xact has join split and cue (which TLH doesn't!)

but TLH has fix preview

if you can move the show (on a cdrw or whatever) over to your pc you can open up TLH, select the fix SBEs tab and it is in preview mode by default (drop down menu on the right). it will give a report of what it wants to do and from that output I can give you exact instructions on how to fix the first and last tracks without touching the other 21 tracks (which is preferable!).

rherron
2005-12-02, 04:54 PM
To split on sector boundaries in Gold Wave:

1. Insert all of your Cue Points
2. Click “Split File” button in Cue Point dialog box
3. Make sure the button “Use CD compatible wave format and alignment” is checked
4. Split the file

Rob

ffooky
2005-12-02, 05:03 PM
Thanks for answering, Jamie. But, um, can you run a preview of the shntool fix and post the results. :hmm: I have no clue what you are talking about here. xACT has these options for shntool: len, info, join, split, cmp, cue and then I can also fix the SBEs. I could do something in terminal mode if I knew what I was doing.

If you want an easy way to run shntool in the terminal without installing binaries, changing your $PATH etc, try this.

Right (cntrl) click on the xACT application and select Show Package Contents. At the next window, double click the Contents folder, next window double click Resources, next window double click Binaries. You should now see a single folder named bin. Open a Terminal window and type:

cd <drag the bin folder here>

(That's, cd-space-drag folder) and hit Enter.

The command prompt should now look something like:

<your computer's name>:/Applications/xACT.app/Contents/Resources/Binaries/bin u2lynne$

You can type:

shnfix -h

Which will show you the options for the fix mode but for this test you probably just need to run:

shnfix -o wav -order -p <select and drag in all the files to be fixed>

You can drag 'em all in at once and edit the order correctly afterwards or just drag them in to the Terminal window one at a time in order before hitting Enter.

ff

U2Lynne
2005-12-02, 05:34 PM
Thanks ffooky. I found my way to the bin folder and I was reading on the etree shntool page about what to do, but I never realized I could just drag files in there. :disbelief

But, I get told:
-bash: shnfix: command not found

And, I tried saying shntool fix -o wav etc and got told shntool: command not found. I've been using xACT just fine though and I know shntool exists and works. :hmm:

ffooky
2005-12-02, 05:56 PM
Hmm...does the command prompt look like I suggested it might ?

If it does, try entering:

ls

You should get a list of all the binaries in that folder, including shntool. If you don't then something has gone amiss on the way. The output you're getting suggests that you are not actually in the right folder but the output from "ls" will tell us where you are.

U2Lynne
2005-12-02, 06:09 PM
Oh yeah, it's there, I can see it in the bin folder (both in the finder and by typing ls in the terminal). That's why it's so weird.

Could it be a permissions thing?

ffooky
2005-12-02, 06:44 PM
I think you may be right. I just tried the same process in my kid's account on the same machine and got the old "command not found" routine. My account is the Admin's account, is yours ?

Five
2005-12-02, 07:10 PM
well from command line on pc I think it would be:

type "cd" (no quotes) then a space

drag and drop the folder that has the files in it, hit enter

shntool fix -o wav -order -p *.shn > shntool_fix_preview.txt

and the .txt file will appear with the info

I think the problem might be in the typing of "shnfix" when it should be "shntool fix"

ffooky
2005-12-02, 07:14 PM
I think the problem might be in the typing of "shnfix" when it should be "shntool fix"

Nah, either form is kosher.

freezer
2005-12-02, 07:16 PM
Does any of this above discussion pertain to shows transferred to cd-r on a stand-alone burner?

I'm concerned, because a stand-alone is what I use to transfer shows from 30+ year old master cassettes, and some of those cassettes will be forever "retired" directly after the transfer.

I don't want to introduce any new noises to these shows, as I did that while recording. ;)



Does any of the discussion pertain to shows initially recorded/captured on a stand-alone burner?

Five
2005-12-02, 07:32 PM
good question!

anything originally recorded on a standalone will be guaranteed free from sector boundary errors (anybody please correct me if I'm wrong).

U2Lynne
2005-12-02, 10:15 PM
I think you may be right. I just tried the same process in my kid's account on the same machine and got the old "command not found" routine. My account is the Admin's account, is yours ?
I'm the only user on this computer, so of course I'm the Admin.

These permissions look correct, right? I don't see anything wrong with them.

-rwxrwxr-x 1 Lynne admin 304032 Jun 27 2004 shnfix
-rwxrwxr-x 1 Lynne admin 304032 Jun 27 2004 shninfo
-rwxrwxr-x 1 Lynne admin 304032 Jun 27 2004 shnjoin
-rwxrwxr-x 1 Lynne admin 304032 Jun 27 2004 shnlen
-rwxrwxr-x 1 Lynne admin 304032 Jun 27 2004 shnmd5
-rwxrwxr-x 1 Lynne admin 304032 Jun 27 2004 shnpad
-rwxrwxr-x 1 Lynne admin 304032 Jun 27 2004 shnsplit
-rwxrwxr-x 1 Lynne admin 304032 Jun 27 2004 shnstrip
-rwxr-xr-x 1 Lynne admin 272820 May 7 2005 shntool

ffooky
2005-12-03, 02:40 AM
I am such an idiot.

I've just realised that the reason it has worked for me is that I have the same (later versions in same cases) binaries in my $PATH.

I should have told you to prefix all the commands with "./", i.e:

./shnfix blah blah blah

Please hit me.

If it hadn't worked for me, I'd have remembered the ./ thing earlier...very sorry about that.

Anyway, you'll now be able to use shntool to its full capabilities, though for ease's sake you might want to duplicate all the binaries and put the dupes in a new folder (you must remove the " copy" from the names afterwards). For some reason Scott didn't include conv mode in xACT which is great for batch converting SHN/APE files. Remember to set any -d arguments to a suitable folder (which you can just drag into the command).

BTW, Open Terminal Here <http://www.entropy.ch/software/applescript/welcome.html> is a neat little helper for doing this kind of thing.

Sorry for misleading you, ff

U2Lynne
2005-12-03, 10:36 AM
Well, now I'm getting a different error for all the files. I'll have to tackle this later on, it's soccer tournement weekend.

shnfix: warning: could not read data from file '/Users/Lynne/Music/Torrenting Now/u22001-12-02/u22001-12-02d1t01.shn' using the 'shn' format module - possible causes:
shnfix: + decoder program 'shorten' may not have been found - verify it is installed and in your PATH
shnfix: + this file may be unsupported, truncated or otherwise corrupt

ffooky
2005-12-03, 11:21 AM
Darn, the little bugger can't find the shorten binary. I'm not sure if shntool needs at least sox in order to use WAV files. If it doesn't then you could decode to wave first of all and then try ./shnfix etc. on them.

If you'd rather just set things up properly so you can run all manner of goodies from the command line I can give you the relevant commands. It's a lot easier than you might think :)

Five
2005-12-03, 01:27 PM
Lynne, when you get the chance it would be great if you could work out the kinks here. If you need to get this particular show fixed soon you can always send me

u22001-12-02d1t01.shn
u22001-12-02d2t11.shn

via yousendit.com in a pm and I can fix & return the tracks to you.

all this jazz with the path really gave me a headache at first but it has somehow been sorted out since I installed TLH on my pc.

thanks ffooky for all the great posts you've made (and will still make) here its good to have a commandline guru in the house!

ffooky
2005-12-03, 01:41 PM
Steady on Five, I'm somewhere between an embryo and a foetus on the developmental path to command line guruhood but I know just enough to be dangerous. :)

bato
2005-12-03, 02:33 PM
Does any of this above discussion pertain to shows transferred to cd-r on a stand-alone burner?

I'm concerned, because a stand-alone is what I use to transfer shows from 30+ year old master cassettes, and some of those cassettes will be forever "retired" directly after the transfer.

I don't want to introduce any new noises to these shows, as I did that while recording. ;)



Does any of the discussion pertain to shows initially recorded/captured on a stand-alone burner?

That's an excellent question Freezer. I'm not an expert on SBEs and don't burn with a stand-alone but can report the following.

I checked for SBEs on the WWOZ October 2004 Pledge Drive set that you transfered and that JCrab66 converted and seeded. There are no SBEs in the log. Check with JCrab66 to see if he had to fix SBEs when he converted. If he didn't, transfering using a stand alone should be okay. (He didn't mention fixing SBEs in the release notes.) Can anyone with more experience/knowledge of stand-alones confirm that Freezer's transfers would be problem free using his stand-alone?

U2Lynne
2005-12-03, 05:44 PM
Darn, the little bugger can't find the shorten binary. I'm not sure if shntool needs at least sox in order to use WAV files. If it doesn't then you could decode to wave first of all and then try ./shnfix etc. on them.

If you'd rather just set things up properly so you can run all manner of goodies from the command line I can give you the relevant commands. It's a lot easier than you might think :)
If you want to help me set it up, that would be fine with me. I don't mind doing things throught the terminal anymore. I think I started getting a bit more comfortable with the command line stuff once I had to start dealing with the servers using it.

ffooky
2005-12-03, 06:29 PM
I can't remember if a default OS X installation comes with a /usr/local directory but if not you need to run:

$ sudo mkdir /usr/local

and then:

$ sudo mkdir /usr/local/bin

Now you need to add this directory to your $PATH:

% echo 'PATH=$PATH:/usr/local/bin' >> ~/.bash_profile
% source .bash_profile
(Two separate commands)

You can check to see if you've successfully added /usr/local/bin by running:

% echo $PATH

You should see it somewhere in the string of directories, separated by colons.

Now you can just add all the duplicated binaries from the bin folder within xACT.app, either by dragging them in via Finder or by running:

$ sudo cp <select and drag all of them here at once> /usr/local/bin

Everything *should* now be tickety-boo.

ff

U2Lynne
2005-12-04, 11:29 AM
OK, everything is now tickety-boo. Thanks ffooky! (fyi, user/local/bin did already exist and I love the expresion tickety-boo!).

Now, when I run the shnfix command, I get back a list of my files and then the following options:
Commands:

swap a b (swaps positions a and b)
move a b (moves position a to position b, shifting everything in between)
begin a (moves position a to the beginning of the list)
end a (moves position a to the end of the list)
done (quits this editor, and continues with processing)
quit (quits shnfix [you can also use Ctrl-C])

and I am once again stumped about what I want to do here.

ffooky
2005-12-04, 12:33 PM
Delighted to hear it went well. xACT is great but the command line is just faster for some things.

I just tried running the command with -order in it....it's, er, a bit complicated isn't it ? :-)

Assuming your SHN files are named consecutively then you can just cd to their directory (or use Open Terminal Here) and run:

shntool fix -o wav -p *.shn
That should definitely do the trick...allegedly, heheh.

p.s. This tutorial (http://www.etree.org/shnutils/shntool/doc/TUTORIAL) is worth a gander when you have time.

Five
2005-12-04, 05:29 PM
the reason why I asked for the preview is that shntool will report how many samples are missing from t01

shntool will want to put them at the end but we must be crafty and put them at the beginning!

U2Lynne
2005-12-04, 05:30 PM
Ah, OK....

Five, here is the output fro the first couple of lines:

shntool [fix]: warning: no shift direction specified - assuming backward shift

Preview of changes:
-------------------

Track breaks will be shifted backward when necessary.

u22001-12-02d1t01.shn --> u22001-12-02d1t01.wav
- beginning of track will remain unchanged
- data size will decrease by 1168 bytes

u22001-12-02d1t02.shn --> u22001-12-02d1t02.wav
- beginning of track will be moved backward by 1168 bytes
- data size will remain unchanged


Perhaps if I did a forward shift them all the files would not need to be changed?