Hi everybody,
I need some help about sample rate settings.
I would like to use my SPDIF Out with Pd. Unfortunately it looks like either the soundcard or the audio system (OSS) starts up with 48,000 Hz while Pd is set to use 44,100 Hz (that's necessary because of the samples being at 44.1k).
Does anybody know where or how I can set the PCM sample rate to match Pd's sample rate?
None of the soundcard mixers I was checking have an option to set the sample rate and I don't know where the OSS files are located.
Thanks! Ingo
Hi Ingo
On Thu, 2011-11-10 at 13:10 +0100, Ingo wrote:
Hi everybody,
I need some help about sample rate settings.
I would like to use my SPDIF Out with Pd. Unfortunately it looks like either the soundcard or the audio system (OSS) starts up with 48,000 Hz while Pd is set to use 44,100 Hz (that's necessary because of the samples being at 44.1k).
Does anybody know where or how I can set the PCM sample rate to match Pd's sample rate?
None of the soundcard mixers I was checking have an option to set the sample rate and I don't know where the OSS files are located.
I don't know about your soundcard, but many (cheap) soundcards only support 48kHz. You probably won't notice it with ALSA, since ALSA is capable of resampling the sound before pushing it to the card, but if you really are using old-school OSS, I think there is no way to resample.
Just in case, you're sound card really only supports 48kHz, would resampling your audio files be an option? At least then you have some control over the resampling quality.
Roman
Thanks Roman,
but no - the soundcard supports up to 192k sampling rate and I do get it to playback at 44.1k every once in a while. When I switch PCM on/off a couple of times all the sudden it starts working correctly. I can see it on my RME-HDSP. It shows 48k at startup with no sound and after switching it on an off and resetting the samplerate in Pd a number of times it picks up the correct sample rate. The HDSP shows 44.1k and there is sound. So it does support 44.1k.
The question is: How do I set this samplerate at system startup in Natty? I just read about a way how to do it in OSS4 but I'm still using the older OSS ( OSS 3 ? ) because of the MIDI support.
Ingo
Hi Ingo
On Thu, 2011-11-10 at 13:10 +0100, Ingo wrote:
Hi everybody,
I need some help about sample rate settings.
I would like to use my SPDIF Out with Pd. Unfortunately it looks like
either
the soundcard or the audio system (OSS) starts up with 48,000 Hz while
Pd is
set to use 44,100 Hz (that's necessary because of the samples being at 44.1k).
Does anybody know where or how I can set the PCM sample rate to match
Pd's
sample rate?
None of the soundcard mixers I was checking have an option to set the
sample
rate and I don't know where the OSS files are located.
I don't know about your soundcard, but many (cheap) soundcards only support 48kHz. You probably won't notice it with ALSA, since ALSA is capable of resampling the sound before pushing it to the card, but if you really are using old-school OSS, I think there is no way to resample.
Just in case, you're sound card really only supports 48kHz, would resampling your audio files be an option? At least then you have some control over the resampling quality.
Roman
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2011-11-10 13:10, Ingo wrote:
Hi everybody,
I need some help about sample rate settings.
I would like to use my SPDIF Out with Pd. Unfortunately it looks like either the soundcard or the audio system (OSS) starts up with 48,000 Hz while Pd is set to use 44,100 Hz (that's necessary because of the samples being at 44.1k).
i was going to say: you can change the samplerate of Pd to 48kHz using the Media->Audio menu. it will magically shorten each sample from (1/44.1)ms to (1/48)ms, so you don't need to worry about that.
but then, maybe you meant your soundfiles?
fgamsdr IOhannes
Concerning your soundcard, you sould have HdspConf installed, no? There you can simply choose the samplerate with buttons. I don't have any experience with SPDIF, but I did recently started using an ADAT (optical) device with the HDSP/Hammerfall, for inputs. In my case, you have to set the ADAT device to 48 or 44.1 with a physical switch on the back, and have the soundcard sync to that. (also a setting in HdspConf) However, it seems like at 44.1kHz it's a lot less stable, it keeps losing sync and resyncing all the time, at least that's what the gui shows, but afaict it has no effect on the sound... Lastly: I wonder if there isn't a way to downsample some subpatches to playback the 44.1kHz soundfiles in a 48kHz environment? gr, Tim
2011/11/10 IOhannes m zmoelnig zmoelnig@iem.at
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2011-11-10 13:10, Ingo wrote:
Hi everybody,
I need some help about sample rate settings.
I would like to use my SPDIF Out with Pd. Unfortunately it looks like
either
the soundcard or the audio system (OSS) starts up with 48,000 Hz while
Pd is
set to use 44,100 Hz (that's necessary because of the samples being at 44.1k).
i was going to say: you can change the samplerate of Pd to 48kHz using the Media->Audio menu. it will magically shorten each sample from (1/44.1)ms to (1/48)ms, so you don't need to worry about that.
but then, maybe you meant your soundfiles?
fgamsdr IOhannes -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk677vgACgkQkX2Xpv6ydvTm8wCdEhwpG+04NEttfTb2+SPN9Cmg MB0AoIUPlTey1lb5lJ5ji0f4o3fz74e6 =2RQo -----END PGP SIGNATURE-----
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On 2011-11-10 13:10, Ingo wrote: Hi everybody,
I need some help about sample rate settings.
I would like to use my SPDIF Out with Pd. Unfortunately it looks like
either
the soundcard or the audio system (OSS) starts up with 48,000 Hz while
Pd is
set to use 44,100 Hz (that's necessary because of the samples being at 44.1k).
i was going to say: you can change the samplerate of Pd to 48kHz using the Media->Audio menu. it will magically shorten each sample from (1/44.1)ms to (1/48)ms, so you don't need to worry about that.
but then, maybe you meant your soundfiles?
fgamsdr IOhannes
Yep, I was talking about the soundfiles. It's a sample player synth. Changing the samplerate of Pd will detune all instruments.
The funny thing is that my older mainboard simply accepted the sample rate from Pd. The new one doesn't. So it looks like it needs to be set up before Pd gets started. This has to be stored within a file somewhere. I've read somewhere that OSS defaults to 48k. So it might actually be the absence of a configuration file which makes it a bit more difficult to find.
Analogue outs work normally. Although I suspect there is resampling going on inside the soundcard. It's a realtek. They tend to do stuff like that.
Ingo
It's not the HDSP that's causing the problems. It's a realtek onboard souncard. The HDSP was used on another (WinXP) computer and only served as an input to check the output of the linux machine.
Ingo
Von: pd-list-bounces@iem.at [mailto:pd-list-bounces@iem.at] Im Auftrag von tim vets Gesendet: Donnerstag, 10. November 2011 17:15 An: IOhannes m zmoelnig Cc: pd-list@iem.at Betreff: Re: [PD] Natty SPDIF samplerate 44.1k / 48k problem (OSS)
Concerning your soundcard, you sould have HdspConf installed, no? There you can simply choose the samplerate with buttons. I don't have any experience with SPDIF, but I did recently started using an ADAT (optical) device with the HDSP/Hammerfall, for inputs. In my case, you have to set the ADAT device to 48 or 44.1 with a physical switch on the back, and have the soundcard sync to that. (also a setting in HdspConf) However, it seems like at 44.1kHz it's a lot less stable, it keeps losing sync and resyncing all the time, at least that's what the gui shows, but afaict it has no effect on the sound... Lastly: I wonder if there isn't a way to downsample some subpatches to playback the 44.1kHz soundfiles in a 48kHz environment? gr, Tim
2011/11/10 IOhannes m zmoelnig zmoelnig@iem.at -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2011-11-10 13:10, Ingo wrote:
Hi everybody,
I need some help about sample rate settings.
I would like to use my SPDIF Out with Pd. Unfortunately it looks like
either
the soundcard or the audio system (OSS) starts up with 48,000 Hz while Pd
is
set to use 44,100 Hz (that's necessary because of the samples being at 44.1k).
i was going to say: you can change the samplerate of Pd to 48kHz using the Media->Audio menu. it will magically shorten each sample from (1/44.1)ms to (1/48)ms, so you don't need to worry about that.
but then, maybe you meant your soundfiles?
fgamsdr IOhannes
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Problem solved!
There is a switch at the soundcard mixer (I'm using "gamix") that is labeled "PCM Default Playback Switch".
So, recalling a mixer preset with this switch set to "ON" and changing the desired sample rate via Pd's audio dialog afterwards does the trick.
Since the sample rate is output at start up of Pd the audio dialog needs to be set once more after recalling the mixer preset or the audio mixer preset needs to be loaded before Pd starts.
Ingo
-----Ursprüngliche Nachricht----- Von: pd-list-bounces@iem.at [mailto:pd-list-bounces@iem.at] Im Auftrag von Ingo Gesendet: Donnerstag, 10. November 2011 17:34 An: 'IOhannes m zmoelnig'; pd-list@iem.at Betreff: Re: [PD] Natty SPDIF samplerate 44.1k / 48k problem (OSS)
On 2011-11-10 13:10, Ingo wrote: Hi everybody,
I need some help about sample rate settings.
I would like to use my SPDIF Out with Pd. Unfortunately it looks like
either
the soundcard or the audio system (OSS) starts up with 48,000 Hz while
Pd is
set to use 44,100 Hz (that's necessary because of the samples being at 44.1k).
i was going to say: you can change the samplerate of Pd to 48kHz using the Media->Audio menu. it will magically shorten each sample from (1/44.1)ms to (1/48)ms, so you don't need to worry about that.
but then, maybe you meant your soundfiles?
fgamsdr IOhannes
Yep, I was talking about the soundfiles. It's a sample player synth. Changing the samplerate of Pd will detune all instruments.
The funny thing is that my older mainboard simply accepted the sample rate from Pd. The new one doesn't. So it looks like it needs to be set up before Pd gets started. This has to be stored within a file somewhere. I've read somewhere that OSS defaults to 48k. So it might actually be the absence of a configuration file which makes it a bit more difficult to find.
Analogue outs work normally. Although I suspect there is resampling going on inside the soundcard. It's a realtek. They tend to do stuff like that.
Ingo
On Thu, 2011-11-10 at 17:14 +0100, tim vets wrote:
.. Lastly: I wonder if there isn't a way to downsample some subpatches to playback the 44.1kHz soundfiles in a 48kHz environment?
Why would you want to run an [osc~ 440] at a different samplerate, when it plays a 440Hz anyway?
Regarding audio samples, you can use [tabread4~] fed by a [line~] instead of [tabplay~] for up- or downsampling.
Roman
2011/11/10 Roman Haefeli reduzent@gmail.com
On Thu, 2011-11-10 at 17:14 +0100, tim vets wrote:
.. Lastly: I wonder if there isn't a way to downsample some subpatches to playback the 44.1kHz soundfiles in a 48kHz environment?
Why would you want to run an [osc~ 440] at a different samplerate, when it plays a 440Hz anyway?
Regarding audio samples, you can use [tabread4~] fed by a [line~] instead of [tabplay~] for up- or downsampling.
it was just a thought, I can imagine if you would have based some sophisticated sample playback on a whole bunch of tabplay~'s or readsf~'s, that maybe you wouldn't want or have time to change all that... I checked [switch~] again and indeed you can enter 0.5 to downsample by factor 2, does that mean you could enter 0.91875000000000007 to downsample from 48 to 44.1?
Roman
I think if you are using a mixed patch with osc and samples only the samples would play correctly and any osc~ might get detuned. Not sure?
But anyway, as far as I know you can only up or downsample by the power of two.
I did try to use a frequency multiplier of 0.91875 and it was playing in tune but that still gave me a samplerate of 48k at the SPDIF out instead of the 44.1k which was what I wanted.
Anyway, I suspect that some instabilities as well as certain losses of sound quality may happen if the sample rate of Pd conflicts with the sample rate of the sound card. This is because of the resampling that the sound card needs to do. So getting Pd's sample rate matched up with the rate of the hardware might have advantages even if you are using only analogue outs.
Ingo
2011/11/10 Roman Haefeli reduzent@gmail.com On Thu, 2011-11-10 at 17:14 +0100, tim vets wrote:
.. Lastly: I wonder if there isn't a way to downsample some subpatches to playback the 44.1kHz soundfiles in a 48kHz environment?
Why would you want to run an [osc~ 440] at a different samplerate, when it plays a 440Hz anyway?
Regarding audio samples, you can use [tabread4~] fed by a [line~] instead of [tabplay~] for up- or downsampling. it was just a thought, I can imagine if you would have based some sophisticated sample playback on a whole bunch of tabplay~'s or readsf~'s, that maybe you wouldn't want or have time to change all that... I checked [switch~] again and indeed you can enter 0.5 to downsample by factor 2, does that mean you could enter 0.91875000000000007 to downsample from 48 to 44.1? Roman
On 11/10/2011 05:14 PM, tim vets wrote:
Lastly: I wonder if there isn't a way to downsample some subpatches to playback the 44.1kHz soundfiles in a 48kHz environment?
proper resampling between two unrelated samplerates is something non-trivial (and usually adds quite some latency).
if possible you should therefore use whatever offlline re-sampling tools you have, sox comes to my mind.
fgmasdr IOhannes
On 11/11/2011 01:18 AM, tim vets wrote:
it was just a thought, I can imagine if you would have based some sophisticated sample playback on a whole bunch of tabplay~'s or readsf~'s, that maybe you wouldn't want or have time to change all that... I checked [switch~] again and indeed you can enter 0.5 to downsample by factor 2, does that mean you could enter 0.91875000000000007 to downsample from 48 to 44.1?
no. you can only enter power-of-2 numbers, e.g. 4, 2, 1, 0.5, 0.25, 0.125
in my other mail i mentioned that it is hard to do "proper" resampling, i meant that it is hard to do resampling without getting hearable artefacts.
the 2nd thing that prohibits resampling by an arbitrary amount (as opposed to the power-of-2 resampling that is already there) is, that Pd is not really multi-rate capable. it's obviously quite trivial to reblock a 64 sample block into 128 samples (you just emit a block every other input block), but things get a bit hairy when you want to reblock to 77 while caring for speed.
fmgasdr IOhannes
Also, make sure that the Realtek chip does native 44.1... I feed my MOTU card from the SPDIF output of a Creative Audigy* and I had to change my workflow to 48k because the Audigy turned out to "fake" 44.1 by constant upsampling/downsampling around its fixed-48k DSP.
all the time
Andras
On Fri, Nov 11, 2011 at 04:38, Ingo ingo@miamiwave.com wrote:
I think if you are using a mixed patch with osc and samples only the samples would play correctly and any osc~ might get detuned. Not sure?
But anyway, as far as I know you can only up or downsample by the power of two.
I did try to use a frequency multiplier of 0.91875 and it was playing in tune but that still gave me a samplerate of 48k at the SPDIF out instead of the 44.1k which was what I wanted.
Anyway, I suspect that some instabilities as well as certain losses of sound quality may happen if the sample rate of Pd conflicts with the sample rate of the sound card. This is because of the resampling that the sound card needs to do. So getting Pd's sample rate matched up with the rate of the hardware might have advantages even if you are using only analogue outs.
Ingo
2011/11/10 Roman Haefeli reduzent@gmail.com On Thu, 2011-11-10 at 17:14 +0100, tim vets wrote:
.. Lastly: I wonder if there isn't a way to downsample some subpatches to playback the 44.1kHz soundfiles in a 48kHz environment?
Why would you want to run an [osc~ 440] at a different samplerate, when it plays a 440Hz anyway?
Regarding audio samples, you can use [tabread4~] fed by a [line~] instead of [tabplay~] for up- or downsampling.
it was just a thought, I can imagine if you would have based some sophisticated sample playback on a whole bunch of tabplay~'s or readsf~'s, that maybe you wouldn't want or have time to change all that... I checked [switch~] again and indeed you can enter 0.5 to downsample by factor 2, does that mean you could enter 0.91875000000000007 to downsample from 48 to 44.1? Roman
Also, make sure that the Realtek chip does native 44.1... I feed my MOTU card from the SPDIF output of a Creative Audigy* and I had to change my workflow to 48k because the Audigy turned out to "fake" 44.1 by constant upsampling/downsampling around its fixed-48k DSP.
- because the FireWire connection is so fragile and the damn MOTU freezes
all the time
Andras
I used to have lots of sample rate problems with one of the older EMU cards because of that sound chip (back with Windows 98).
It's a known problem with the Creative cards which is why I'm staying away from them. They are set to a fixed rate of 48k. The Realtek actually supports all standard rates up to 192k. Which means it simply can't be fixed like the Creative cards.
Anyway, after finding the "PCM Default Playback Switch" and turning it on so it follows the software's sample rate it works fine.
Ingo