0
0

Hello,

just implemented a little cd player, everthing works fine.. also the great TOC features is working well. But unfortunatly there is one little anoing thing:

during playback it crackles very often…. i tried also to increase the buffer size with no luck. finally i switched in my FSOUND_INIT() my khz to 48000 … when i do this everthing sounds crystal clear….

brett: is this “audio cd problem” maybe a “mixer problem” in fmod?

it can be quite well reproduced.. when i switch back to 44.1 khz it crackles…. on 48khz not……. strange….

another thing: is there a way to open a CD with just ONE substream instead of multiple substreams? Would be nice to playback (or rip) the complete CD ?

help would be appreciatet on that

Thomas

  • You must to post comments
0
0

Thanks

  • You must to post comments
0
0

i will try this right now… there is still a compiling problem with your fmoddyn.h file…

d:\sources\xxx\fmod\fmoddyn.h(444) : error C2039: ‘FSOUND_CD_Eject’ : is not a member of ‘FMOD_INSTANCE’
d:\sources\mrmp3\fmod\fmoddyn.h(19) : see declaration of ‘FMOD_INSTANCE’

to fix for other users: just comment out the line 444 in file fmoddyn.h

// F_GETPROC(FSOUND_CD_Eject, “_FSOUND_CD_Eject@4”);

  • You must to post comments
0
0

the toc functionality from fmod is perfect now…

i have a little feature request:

is it possible to store beneth the already existing information also the track_type for each track on cd….

‘type_audio’ or ‘type_data’

this would help that a user don’t try to start a data track

[code:18lxlp1c]typedef struct _FSOUND_TOC_TAG
{
char name[4]; /* The string "TOC", just in case this structure is accidentally treated as a string */
int numtracks; /* The number of tracks on the CD */
int min[100]; /* The start offset of each track in minutes */
int sec[100]; /* The start offset of each track in seconds */
int frame[100]; /* The start offset of each track in frames */
int type[100]; /* this could hold the type of the track */

} FSOUND_TOC_TAG;[/code:18lxlp1c]

by the way: your toc is perfect.. before i use mci to generate the toc. now the disc-id’s get generated correctly even when i try Disc’s with data-tracks. thats not possible with mci. (to detect those data tracks).

thx alot

  • You must to post comments
0
0

[quote:jzwxu1c8]is it possible to store beneth the already existing information also the track_type for each track on cd….

‘type_audio’ or ‘type_data’

this would help that a user don’t try to start a data track [/quote:jzwxu1c8]

FMOD already skips data tracks when it builds the CDDA stream so it’s impossible to play them.

  • You must to post comments
0
0

Have you tried enabling jitter correction? See the docs on FSOUND_Stream_Open for how to do this. As for having just one substream, no, just play each one after the other.

  • You must to post comments
0
0

[quote="andrew":lbhw0csr]FMOD already skips data tracks when it builds the CDDA stream so it’s impossible to play them.[/quote:lbhw0csr]

but in my list view – i offer the user to “play” it… and if he does the engine gives out parts of some track on the disc…

thx for help

  • You must to post comments
0
0

Ok, after looking into my dictionary we have here hiss noise…and stuttering…

but why is it gone when i put my outputrate to 48 khz ?
and yes – i did turn jitter correction on and off several times with no effect at all.. also when i turn down the khz rate to 22050 we have this hiss noise…

a small bug:

                [code:2ydagoq8]FSOUND_Stream_FindTagField(stream, 0, "CD_TOC", (void **)&toc, 0))[/code:2ydagoq8]

the result int it gets always accumulated… if i have a cd with eg 11 tracks… i do another call to this founction i will get 22 tracks and so on..
would be nice to delete this before calculation.

why i cannot pass my own buffer to FindTag / GetTag functions?

  • You must to post comments
0
0

Use FSOUND_Stream_GetNumSubStreams to get the number of tracks on the disc and then use FSOUND_Stream_SetSubStream, FSOUND_Stream_Play/Ex to play a track. The TOC tag is for generating disc id type stuff only, not for showing to the user.

[quote:339meqky]and if he does the engine gives out parts of some track on the disc… [/quote:339meqky]

Can you clarify what you mean here? Are you saying it plays parts of a different track than the one you specify? How are you playing it?

  • You must to post comments
0
0

[quote="andrew":28lktfgj]Have you tried enabling jitter correction? See the docs on FSOUND_Stream_Open for how to do this. As for having just one substream, no, just play each one after the other.[/quote:28lktfgj]

i have many mix-cd’s the have cue points but would be played much smother without needing to start the next track after the other one stops..

for ripping those CD’s it is also needed. i could save the cue point in “index_tag’s” or anywhere else in my database. the user is still able to cue in a ripped and encoded file…

  • You must to post comments
0
0

[quote="andrew":35f4bknm]Use FSOUND_Stream_GetNumSubStreams to get the number of tracks on the disc and then use FSOUND_Stream_SetSubStream, FSOUND_Stream_Play/Ex to play a track. The TOC tag is for generating disc id type stuff only, not for showing to the user.[/quote:35f4bknm]

I use the Toc to build up a List View Control with all Tracks on Disc. Double Click does a FSOUND_Stream_Play(track) call.

Now i will add your mentioned FSOUND_Stream_GetNumSubStreams() call to check if the toc contains maybe a datatrack. if, i will add only numtracks-1.
when i do this, i neve will send a FSOUND_Stream_Play(num) with num one higher then available substreams…(which causes the strange sound_output) thx for this solution.

your complete TOC is very fine to calculate the CORRECT Disc ID – AND for freedb you need also all cue points (including the data track) to build up the correct query.. the correct disc id alone is not enough when we are dealing with audio-cd’s that contain a data track.

if somebody wants to test the following query string:
try: [url:35f4bknm]http://freedb.freedb.org/~cddb/cddb.cgi?cmd=cddb+query+5a091a08+8+150+19005+37878+60451+77947+98317+114681+145256+2332&hello=Tom+pctom+MyCDDB+1.0&proto=5[/url:35f4bknm]

the CD contains 7 audio tracks and 1 data track… the last is the cuepoint of the leadout and finally the length of all tracks in seconds.

before fmod i was NOT able to calculate the correct DISCID and this string because i used mci to get the id. mci skips all data tracks :-( But -> fmod!!!!!!!!!!!!!!!!!!!!!!!!! :-)

thx again!

  • You must to post comments
0
0

the hiss noise is gone… i just forgot in my cd-player instance of fmod
to set the buffer to >50

but the toc problem is still there…

  • You must to post comments
0
0

[quote:3fq20gi0]Double Click does a FSOUND_Stream_Play(track) call. [/quote:3fq20gi0]

I assume you mean FSOUND_Stream_SetSubStream(stream, track) followed by FSOUND_Stream_Play.

[quote:3fq20gi0]Now i will add your mentioned FSOUND_Stream_GetNumSubStreams() call to check if the toc contains maybe a datatrack. if, i will add only numtracks-1.
when i do this, i neve will send a FSOUND_Stream_Play(num) with num one higher then available substreams…(which causes the strange sound_output) thx for this solution.
[/quote:3fq20gi0]

FSOUND_Stream_GetNumSubStreams tells you how many audio tracks are on the CD. You don’t need to do any “numtracks-1” stuff, just use the number that FSOUND_Stream_GetNumSubStreams gives you.

As I said, the TOC tag is for generating disc id type stuff only – you do not need to use it to find out how many audio tracks are on the CD.

  • You must to post comments
0
0

[quote="mdd":3spqbgw9]the result int it gets always accumulated… if i have a cd with eg 11 tracks… i do another call to this founction i will get 22 tracks and so on..
would be nice to delete this before calculation.

why i cannot pass my own buffer to FindTag / GetTag functions?[/quote:3spqbgw9]

I just tested it and it returns a pointer to exactly the same data each time – it must be getting accumulated in your code somewhere.
If you want a copy of the data in your own buffer why don’t you just memcpy it?

  • You must to post comments
0
0

Was the popping CD audio fixed? I’m getting the same problem even if I bump the rate up to 48.

  • You must to post comments
0
0

[quote="andrew":33z98k6c]I just tested it and it returns a pointer to exactly the same data each time – it must be getting accumulated in your code somewhere.
If you want a copy of the data in your own buffer why don’t you just memcpy it?[/quote:33z98k6c]

The following code…:

[code:33z98k6c]bool CCDPlayer::GetToc(char driveletter)
{
bool ret = false;
char drive[6] = "d:*?";
drive[0] = driveletter;
char *cd_error;

if(stream)
{
    fmod3->FSOUND_Stream_Close(stream);
    stream = NULL;
}


TRACE("Getting Toc of '%c'\n", driveletter);

stream = fmod3->FSOUND_Stream_Open(drive, FSOUND_NORMAL | FSOUND_NONBLOCKING, 0, 0);
if (!stream)
{
    TRACE("ERROR: %s\n", FMOD_ErrorString(fmod3->FSOUND_GetError()));
    return false;
}

fmod3->FSOUND_Stream_SetSubStream(stream, 1);

bool running = true;

do
{
    int this_openstate = fmod3->FSOUND_Stream_GetOpenState(stream);
    if (this_openstate == -3)
    {
        if (fmod3->FSOUND_Stream_FindTagField(stream, 0, "CD_ERROR", (void **)&cd_error, 0))
        {
            TRACE("%s\n", cd_error);
        }
        else
        {
            TRACE("ERROR: Couldn't open CDDA stream\n");
        }
        fmod3->FSOUND_Stream_Close(stream);
        stream = false;
        running = false;
    }
    else if (this_openstate == 0)
    {

        if (fmod3->FSOUND_Stream_FindTagField(stream, 0, "CD_TOC", (void **)&toc, 0))
        {
            running = false;
            TRACE("Toc Read complete!\n");
        }
        else
        {
            TRACE("No Audio CD Inserted\n");
            running = false;
        }
    }
    Sleep(10);

} while(running);

if(toc)
{
    last_open_letter = driveletter;
    TRACE("Toc found!! 0x%lx %ld\n", toc, toc->numtracks);
    ret = true;
    int channel = fmod3->FSOUND_Stream_PlayEx(FSOUND_FREE, stream, 0, TRUE);
    fmod3->FSOUND_SetPaused(channel, FALSE);
}
else
{
    last_open_letter = 0;
}
return ret;

}[/code:33z98k6c]

produces the following debug output:

[code:33z98k6c]Getting Toc of ‘E’
Toc Read complete!
Toc found!! 0x66f45cb 11
Getting Toc of ‘G’
No Audio CD Inserted
Getting Toc of ‘E’
Toc Read complete!
Toc found!! 0x66f45cb 22
Getting Toc of ‘G’
No Audio CD Inserted
Getting Toc of ‘E’
Toc Read complete!
Toc found!! 0x66f45cb 33
Getting Toc of ‘G’
No Audio CD Inserted
Getting Toc of ‘E’
Toc Read complete!
Toc found!! 0x66f45cb 44
Getting Toc of ‘G’
No Audio CD Inserted[/code:33z98k6c]

in drive e: i have a audio cd, in drive e not. all i do is Getting toc from E: and then trying from G: and again….

have you any ideas?

edit:

i added the code to copy the toc i receive and right after it i memset it to zero…. and STIL i get 22, 33, 44 tracks and so on….

please help!

  • You must to post comments
0
0

Please try the first two suggestions from the FAQ :

[url:3uux9zmi]http://www.fmod.org/forum/viewtopic.php?t=2838[/url:3uux9zmi]

If it’s still skipping then download cddatest :

[url:3uux9zmi]http://www.fmod.org/files/cddatest.zip[/url:3uux9zmi]

…and send me the results.

  • You must to post comments
0
0

Hi,

i’ve exactly the same problem with the new FSOUND_Stream_FindTagField(stream, 0, “CD_TOC”, (void **)&toc, 0))
function. I’ve taken out the code from the ‘cdda’ sample and i don’t manipulate the FSOUND_TOC_TAG *toc in any way.

Maybe related to that is that fmod crashes when calling this function a lot of times. (Try to reproduce this).

Another situation where fmod is crashing, is the sample/fmod.exe program. When clicking “Load CD” button multiple times, then fmod crashes reproduceable. It seems to me that this is related to the number of tracks on a CD. I’ve tried with a CD that has 9 Tracks then fmod crashed with the 7’th retry. A CD with 16 Trackes crashes with the 4’th cd-load.

Hope this helps.
Kind regards
Lothar Joeckel

  • You must to post comments
0
0

[quote="darkchrono4":1oh9vwt7]Was the popping CD audio fixed? I’m getting the same problem even if I bump the rate up to 48.[/quote:1oh9vwt7]

no problems anymore..just try to set the Stream_Buffer_Size with
FSOUND_Stream_SetBufferSize(2000); and do at least a FSOUND_SetBufferSize(100); before the FSOUND_Init()

this should work… initially the buffersize (the one before init) is set to 50 which causes the problems…

  • You must to post comments
0
0

brett: are you on those problems?

  • You must to post comments
Showing 19 results
Your Answer

Please first to submit.