Good, this is a lot more complicated than I first thought. I'm currently reowkring the source to deal with this, but it might only be working by wednesday. The problem is that we have actually three different period. - the period expressed at the samplerate of the wave file on disk - the period expressed at the playingrate of the soundcard - the period expressed at 44100, as stored in the index files. The various convertions between those different types are somewhat delicate and require some testing before it will work properly.
Yes, this is because the index files measure the tempo expressed at a samplerate of 44100 Hz, so if you play it then at 48000Hz you get some problems. The best manner to solve this is leave the index files at 44100 Hz and convert it when the index file is loaded, which is tricky, since at certain places we use the current period to dump it back to an index file. I need to think a bit about this. I'll keep you posted.
Ok, it solved the Jack issue with starting, but now everything is playing too fast (new speed = correct speed x 48000/44100)... :)
I might. There are some places where the wavrate is still 44100 and where it should remain like that. Especially when writing data to the index files, so that these can be exchanged between different versions of bpmdj. Your fix is all that is necessary for the jack stuff. The other ones I should read carefully myself, so I leave this bug open.
I had a look into the code and there are several places, where 44100 is used as a fixed constant where I think WAVRATE should be in order to adept to changes in player-core.h. The containing files are: ao-som-beatgraph.cpp bpm-analyzer.cpp bpmclock.cpp bpmcount.cpp bpm.cpp dsp-jack.cpp fragment-creator.cpp player-core.cpp player.cpp rhythm-analyzer.cpp wavelet-analyzer.cpp scripts.h type-operations.h When fixing dsp-jack.cpp line 242 to WAVRATE it works. Will you have a look at all the files and change what needs to be changes? Regards, Stefan
Hi Werner, I built a new version with the modified player-core.h as you said (no errors, just some warnings), but it doesn't seem to have an effect on the jack part. When setting up bpmplay it still complains with the same error 'engine sample rate: 48000 Please be sure jackd is running at 44100' When I configure Jack to run at 44100 with my internal sound card bpmplay does not complain, so it still seems to use 44100Hz...
Hello, normally this shouldn't be a problme. You can modify the WAVRATE variable in player-core.h, which should then automatically affect all relevant sources as well. Can you try this and verify it ? If there are unexpected errors it shouldn't be hard for me to help you fix them.
Hello, why can't I use 48000Hz sampling rates in bpmdj? I would like to use Jack with my USB Soundcard which can only do 48000Hz (as most cheap USB cards I assume). When using Jack I can't (and shouldn't want to) use the USB device via plughw to get the 44100Hz bpmdj desires. I would like to see support for the common 48kHz sampling rate. Keep up the great work! Stefan