Running Audacity switch PulseAudio to 44100 until PC restart

Help for Audacity 2.x.x on GNU/Linux.

ImageThis forum is for Audacity 2.x.x on GNU/Linux and Unix-like operating systems.
Please state which version of Linux you are using, the exact three-section version number of Audacity from Help > About Audacity... and whether you installed your distribution's release or daily version of Audacity or compiled Audacity from source code.

Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.

Running Audacity switch PulseAudio to 44100 until PC restart

Permanent link to this post Posted by deniskx » Wed Aug 30, 2017 1:29 pm

Hi. I have Audigy 2 ZS sound card, which poorly played 44100 Hz because of bad quality hardware resampling. Only 48000 Hz plays normally. Therefore I set up /etc/pulse/daemon.conf
Code: Select all
default-sample-format = s16le
default-sample-rate = 48000
alternate-sample-rate = 48000
default-sample-channels = 2
default-channel-map = front-left,front-right

And now PulseAudio does resampling. I attached a test file to check resampling. No distortion. However, when I run Audacity looks like PulseAudio force switching to 44100 Hz because then I hear distortion in all applications on 44100 and 48000 files. Looks like Audacity test and break sound system when loading. Closing Audacity does not help. Only restart computer.
I use Xubuntu 16.04 LTS 32 bit. Audacity 2.1.2-1 from repo. On Windows XP there is no problem, only on Linux.
How can prevent samplerate switch?
Attachments
SB test 44.wav
44100 Hz test WAV file. Open in audio player after launch Audacity.
(473.78 KiB) Downloaded 17 times
SB test 48.wav
48000 Hz test WAV file. Open in audio player after launch Audacity.
(515.67 KiB) Downloaded 16 times
deniskx
 
Posts: 15
Joined: Wed Aug 30, 2017 12:54 pm
Operating System: Linux *buntu

Re: Running Audacity switch PulseAudio to 44100 until PC res

Permanent link to this post Posted by steve » Wed Aug 30, 2017 2:31 pm

You can set the default sample rate in "Edit menu > Preferences > Quality".

Note that importing a file into a new, empty project may override the default sample rate. You can see when this occurs because the project sample rate (the "Project Rate") is displayed in the lower left corner of the main Audacity window.

Note also that the sample rate of exported files is taken from the "Project Rate". If you want to export with a different sample rate (for example, if you want to export as 44100 Hz for making an audio CD), then you will need to temporarily change the "Project Rate" setting before exporting.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 45328
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Running Audacity switch PulseAudio to 44100 until PC res

Permanent link to this post Posted by deniskx » Wed Aug 30, 2017 3:40 pm

I set 48000 in project, it does not matter, unfortunately.
deniskx
 
Posts: 15
Joined: Wed Aug 30, 2017 12:54 pm
Operating System: Linux *buntu

Re: Running Audacity switch PulseAudio to 44100 until PC res

Permanent link to this post Posted by deniskx » Wed Aug 30, 2017 3:46 pm

default sample rate in "Edit menu > Preferences > Quality"

Does not affect either. Distortions remain.
deniskx
 
Posts: 15
Joined: Wed Aug 30, 2017 12:54 pm
Operating System: Linux *buntu

Re: Running Audacity switch PulseAudio to 44100 until PC res

Permanent link to this post Posted by deniskx » Thu Aug 31, 2017 2:37 am

I set up Pulse resampler. But, if you output directly to alsa (bypassing Pulse), you need to configure resampler in alsa too. I believe in alsa default 44100. Therefore input 44100 and 48000 will be resampled to 44100, and afterwards hardware resampled to 48000 again = distortion every time.
Maybe Audacity at boot disables Pulse or change it into a strange mode and only work alsa before rebooting?

Audacity changes the sound settings at startup, it's not normal. If your sound card has a high quality resampler - you will not notice a problem. But Audigy 2 ZS is a litmus test. You can configure alsa to 48 kHz I suppose. But this does not change the strange behavior of Audacity.

I suggest test: Set up Pulse resampler to 48 kHz. Run Audacity and close. Open audio file RMAA tones 48 kHz in audio player like Audacious. Connect the line output - to the line input of another sound card of another computer, record and check the spectrum. 22 kHz (44.1 kHz) or 24 kHz (48 kHz) actually plays the computer with Audacity.
deniskx
 
Posts: 15
Joined: Wed Aug 30, 2017 12:54 pm
Operating System: Linux *buntu

Re: Running Audacity switch PulseAudio to 44100 until PC res

Permanent link to this post Posted by steve » Thu Aug 31, 2017 12:37 pm

deniskx wrote:But Audigy 2 ZS is a litmus test

Yes, there are well known problems with several of the Audigy cards on Linux. Unfortunately, if the manufacturer don't supply drivers or enough technical information for the Linux community to develop good drivers, then we're stuck with (sometimes buggy) reverse engineered drivers.

deniskx wrote:I attached a test file to check resampling

What exactly are those files?

deniskx wrote:But, if you output directly to alsa (bypassing Pulse), you need to configure resampler in alsa too. I believe in alsa default 44100. Therefore input 44100 and 48000 will be resampled to 44100, and afterwards hardware resampled to 48000 again = distortion every time.

I don't understand your logic.
If you set preferences in Audacity to 48000Hz sample rate, then Audacity will send audio data to the selected audio device at 48000Hz, provided that the device reports that it supports that rate.

Let's have a look at what your sound system looks like to Audacity:
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 45328
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Running Audacity switch PulseAudio to 44100 until PC res

Permanent link to this post Posted by deniskx » Sat Sep 02, 2017 10:15 am

There are well known problems with several of the Audigy cards on Linux

I have no problems with Audigy 2 ZS in other applications, except Audacity. Therefore
I had to go in Ocenaudio and ?? for synchronize tracks in films and audio processing.

What exactly are those files?

Shows quality of resampling (if used) 44.1>48 and 48>44.1. If resampling is high-quality or not used, you will hear only pure tones. If resampling is bad-quality, you will hear tones and distortions (jingle or screech).

Attach the txt file to your reply

Attached, but there is nothing interesting. Sound card reports that it supports 44100, but in very bad quality actually.

If you set preferences in Audacity to 48000Hz sample rate, then Audacity will send audio data to the selected audio device at 48000Hz, provided that the device reports that it supports that rate.

It is not true. 44100 is always used. That's the point. Let me tell you in bug report style:

Description:
- Audacity 2 ZS sound card support 44100 in very bad quality.
- Therefore I set up /etc/pulse/daemon.conf sample-rate=48000
- I'm using Audacious (not to be confused with Audacity) audio player with PulseAudio output plugin for music listening. Most of MP3 and FLAC 44.1, a little bit Opus 48.
- Everything is great until...
- Audacity (not to be confused with Audacious) set up at 48000, of course.

Steps to reproduce:
1. Turn on the computer.
2. Run Audacious (not to be confused with Audacity further) and play 44.1 and 48 audio files (for example test audio files) > no distortions, everything is great.
3. Close Audacious (not necessary).
4. Run Audacity.
5. Open in Audacity 44.1 and 48 test files > distortions is always (it means sound card operating at 44100 now). I will remind you Audacity set up at 48000. In fact, it's enough just run Audacity.
6. Close Audacity.
7. Run Audacious and play 44.1 and 48 audio files (for example test audio files) > distortions is always (it means sound card still operating at 44100).
8. Audacious (and ALL other applications I suppose) operating at 44100 UNTIL PC restart.
9. PC restart
10. Run Audacious and play 44.1 and 48 audio files (for example test audio files) > no distortions, everything is great.
Attachments
audacity.log
(9.61 KiB) Downloaded 12 times
audacity_terminal.log
(3.69 KiB) Downloaded 12 times
Last edited by deniskx on Mon Sep 04, 2017 11:32 am, edited 1 time in total.
deniskx
 
Posts: 15
Joined: Wed Aug 30, 2017 12:54 pm
Operating System: Linux *buntu

Re: Running Audacity switch PulseAudio to 44100 until PC res

Permanent link to this post Posted by steve » Sun Sep 03, 2017 7:59 pm

deniskx wrote:Shows quality of resampling (if used) 44.1>48 and 48>44.1. If resampling is high-quality or not used, you will hear only pure tones. If resampling is bad-quality, you will hear tones and distortions (jingle or screech).

What's the story with the high frequency noise in the range 19 to 20 kHz?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 45328
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Running Audacity switch PulseAudio to 44100 until PC res

Permanent link to this post Posted by steve » Sun Sep 03, 2017 8:07 pm

deniskx wrote:audacity_terminal.log

Unfortunately the interesting part of the log only appears with debug builds. With a debug build, Audacity prints a debug message that says exactly what sample rate is used on playback. Any chance you could try running a debug build of Audacity? (you would need to build it from the source code).
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 45328
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Running Audacity switch PulseAudio to 44100 until PC res

Permanent link to this post Posted by deniskx » Sun Sep 03, 2017 8:35 pm

steve wrote:What's the story with the high frequency noise in the range 19 to 20 kHz?

Test drive (complex material) for resampler. Noise will not be heard. I found this file a long time ago to check SB cards.
steve wrote:Any chance you could try running a debug build of Audacity? (you would need to build it from the source code).

I can try if you give instructions. I was build source codes before, but the process is not pleasant.
deniskx
 
Posts: 15
Joined: Wed Aug 30, 2017 12:54 pm
Operating System: Linux *buntu

Next

Return to GNU/Linux and Unix-like



Who is online

Users browsing this forum: No registered users and 2 guests