You are not logged in.

#1 2026-07-18 06:25:50

CryogEnix
Member
Registered: 2025-12-14
Posts: 35

[SOLVED] Audacity Error code: -9997 Invalid sample rate

This error only appears when I try to record using the default recording device in Audacity.

   $ pactl list sources
Source #56
        State: SUSPENDED
        Name: alsa_output.pci-0000_7c_00.6.analog-stereo.monitor
        Description: Monitor of Ryzen HD Audio Controller Analog Stereo
        Driver: PipeWire
        Sample Specification: s32le 2ch 48000Hz
        Channel Map: front-left,front-right
        Owner Module: 4294967295
        Mute: no
        Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
                balance 0.00
        Base Volume: 65536 / 100% / 0.00 dB
        Monitor of Sink: alsa_output.pci-0000_7c_00.6.analog-stereo
        Latency: 0 usec, configured 0 usec
        Flags: HARDWARE DECIBEL_VOLUME LATENCY
        Properties:
                object.path = "alsa:acp:Generic:4:playback"
                api.alsa.path = "front:1"
                api.alsa.pcm.card = "1"
                api.alsa.pcm.stream = "playback"
                port.group = "playback"
                device.icon_name = "audio-card-analog"
                device.bus = "pci"
                audio.channels = "2"
                audio.position = "[ FL, FR ]"
                device.routes = "2"
                alsa.resolution_bits = "16"
                alsa.card = "1"
                alsa.card_name = "HD-Audio Generic"
                alsa.long_card_name = "HD-Audio Generic at 0xdfa00000 irq 166"
                alsa.driver_name = "snd_hda_intel"
                alsa.mixer_name = "Realtek ALC1220"
                alsa.components = "HDA:10ec1168,1043886b,00100101"
                alsa.id = "Generic"
                device.api = "alsa"
                device.class = "monitor"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "ALC1220 Analog"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.device = "0"
                alsa.sync.id = "00000000:00000000:00000000:00000000"
                device.profile.name = "analog-stereo"
                device.profile.description = "Analog Stereo"
                card.profile.device = "4"
                device.id = "49"
                factory.name = "api.alsa.pcm.sink"
                node.pause-on-idle = "false"
                priority.driver = "1009"
                priority.session = "1009"
                media.class = "Audio/Sink"
                node.name = "alsa_output.pci-0000_7c_00.6.analog-stereo"
                node.nick = "ALC1220 Analog"
                device.description = "Ryzen HD Audio Controller"
                api.alsa.card.name = "HD-Audio Generic"
                api.alsa.card.longname = "HD-Audio Generic at 0xdfa00000 irq 166"
                factory.id = "19"
                clock.quantum-limit = "8192"
                client.id = "47"
                node.driver = "true"
                node.loop.name = "data-loop.0"
                library.name = "audioconvert/libspa-audioconvert"
                object.id = "56"
                object.serial = "56"
                device.enum.api = "udev"
                api.alsa.card = "1"
                device.plugged.usec = "7879635"
                device.bus_path = "pci-0000:7c:00.6"
                sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:7c:00.6/sound/card1"
                device.subsystem = "sound"
                device.vendor.id = "0x1022"
                device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
                device.product.id = "0x15e3"
                device.product.name = "Ryzen HD Audio Controller"
                device.name = "alsa_card.pci-0000_7c_00.6"
                device.nick = "HD-Audio Generic"
                api.alsa.use-acp = "true"
                api.acp.auto-profile = "false"
                api.acp.auto-port = "false"
                api.dbus.ReserveDevice1.Priority = "-20"
                api.alsa.split-enable = "true"
                api.dbus.ReserveDevice1 = "Audio1"
                spa.object.id = "4"
                device.string = "1"
        Ports:
                analog-output-lineout: Line Out (type: Line, priority: 9000, availability group: Legacy 4, available)
                analog-output-headphones: Headphones (type: Headphones, priority: 9900, availability group: Legacy 5, not available)
        Active Port: analog-output-lineout
        Formats:
                pcm

Source #57
        State: SUSPENDED
        Name: alsa_input.pci-0000_7c_00.6.analog-stereo
        Description: Ryzen HD Audio Controller Analog Stereo
        Driver: PipeWire
        Sample Specification: s32le 2ch 48000Hz
        Channel Map: front-left,front-right
        Owner Module: 4294967295
        Mute: no
        Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
                balance 0.00
        Base Volume: 65536 / 100% / 0.00 dB
        Monitor of Sink: n/a
        Latency: 0 usec, configured 0 usec
        Flags: HARDWARE DECIBEL_VOLUME LATENCY
        Properties:
                object.path = "alsa:acp:Generic:0:capture"
                api.alsa.path = "front:1"
                api.alsa.pcm.card = "1"
                api.alsa.pcm.stream = "capture"
                port.group = "capture"
                device.icon_name = "audio-card-analog"
                device.bus = "pci"
                audio.channels = "2"
                audio.position = "[ FL, FR ]"
                device.routes = "3"
                alsa.resolution_bits = "16"
                alsa.card = "1"
                alsa.card_name = "HD-Audio Generic"
                alsa.long_card_name = "HD-Audio Generic at 0xdfa00000 irq 166"
                alsa.driver_name = "snd_hda_intel"
                alsa.mixer_name = "Realtek ALC1220"
                alsa.components = "HDA:10ec1168,1043886b,00100101"
                alsa.id = "Generic"
                device.api = "alsa"
                device.class = "sound"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "ALC1220 Analog"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.device = "0"
                alsa.sync.id = "00000000:00000000:00000000:00000000"
                device.profile.name = "analog-stereo"
                device.profile.description = "Analog Stereo"
                card.profile.device = "0"
                device.id = "49"
                factory.name = "api.alsa.pcm.source"
                node.pause-on-idle = "false"
                priority.driver = "2009"
                priority.session = "2009"
                media.class = "Audio/Source"
                node.name = "alsa_input.pci-0000_7c_00.6.analog-stereo"
                node.nick = "ALC1220 Analog"
                device.description = "Ryzen HD Audio Controller"
                api.alsa.card.name = "HD-Audio Generic"
                api.alsa.card.longname = "HD-Audio Generic at 0xdfa00000 irq 166"
                factory.id = "19"
                clock.quantum-limit = "8192"
                client.id = "47"
                node.driver = "true"
                node.loop.name = "data-loop.0"
                library.name = "audioconvert/libspa-audioconvert"
                object.id = "57"
                object.serial = "57"
                device.enum.api = "udev"
                api.alsa.card = "1"
                device.plugged.usec = "7879635"
                device.bus_path = "pci-0000:7c:00.6"
                sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:7c:00.6/sound/card1"
                device.subsystem = "sound"
                device.vendor.id = "0x1022"
                device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
                device.product.id = "0x15e3"
                device.product.name = "Ryzen HD Audio Controller"
                device.name = "alsa_card.pci-0000_7c_00.6"
                device.nick = "HD-Audio Generic"
                api.alsa.use-acp = "true"
                api.acp.auto-profile = "false"
                api.acp.auto-port = "false"
                api.dbus.ReserveDevice1.Priority = "-20"
                api.alsa.split-enable = "true"
                api.dbus.ReserveDevice1 = "Audio1"
                spa.object.id = "4"
                device.string = "1"
        Ports:
                analog-input-front-mic: Front Microphone (type: Mic, priority: 8500, availability group: Legacy 1, not available)
                analog-input-rear-mic: Rear Microphone (type: Mic, priority: 8200, availability group: Legacy 2, not available)
                analog-input-linein: Line In (type: Line, priority: 8100, availability group: Legacy 3, not available)
        Active Port: analog-input-front-mic
        Formats:
                pcm

audacity.cfg:

PrefsVersion=1.1.1r1
SelectionFormat=hh:mm:ss + milliseconds
AudioTimeFormat=hh:mm:ss
FrequencySelectionFormatName=Hz
BandwidthSelectionFormatName=octaves
MenuBar=File,Edit,Select,View,Transport,Tracks,Generate,Effect,Analyze,Tools,Optional,Help
StatusBarFieldRegistry=state,main,rate
NumericConverterRegistry=parsed
SnapFunctions=beats,time,frames
Importers=AUP,PCM,OGG,FLAC,MP3,LOF,WavPack,portsmf,FFmpeg,Opus
Exporters=PCM,MP3,OGG,Opus,FLAC,WavPack,FFmpeg,MP2,CommandLine
Preferences=Device,Playback,Recording,MidiIO,Quality,GUI,Tracks,ImportExport,Library,Directories,Effects,KeyConfig,Module
ImportExportPreferences=LabelStyle,AllegroTimeOption
LibraryPreferences=MP3,FFmpeg
DefaultOpenType=All files
LastOpenType=
[GUI]
IntroOrderStart=0
ShowSplashScreen=0
SelectAllOnNone=0
EnableCutLines=0
EditClipCanMove=0
PasteAsNewClips=0
CircularTrackNavigation=0
TypeToCreateLabel=0
DialogForNameNewLabel=0
Solo=Multi
AudioTrackPastePolicy=Ask
TracksFitVerticallyZoomed=0
CollapseToHalfWave=0
AutoScroll=1
DefaultViewModeChoiceNew=Waveform
DefaultWaveformScaleChoice=Linear
SampleViewChoice=StemPlot
ZoomPreset1Choice=ZoomDefault
ZoomPreset2Choice=FourPixelsPerSample
Theme=light
EnvdBRange=60
ShowExtraMenus=0
BeepOnCompletion=0
RetainLabels=0
RtlWorkaround=1
PreferNewTrackRecord=0
[GUI/ToolBars]
[GUI/ToolBars/Tools]
MultiToolActive=0
DockV2=1
Dock=1
Path=0,0
Show=1
X=-1
Y=-1
W=67
H=63
[GUI/ToolBars/Audio\ Setup]
DockV2=1
Dock=1
Path=0,0,0,0
Show=1
X=-1
Y=-1
W=113
H=63
[GUI/ToolBars/CombinedMeter]
DockV2=1
Dock=0
Show=0
X=-1
Y=-1
W=338
H=31
[GUI/ToolBars/Control]
DockV2=1
Dock=1
Path=0
Show=1
X=-1
Y=-1
W=417
H=63
[GUI/ToolBars/CutCopyPaste]
DockV2=1
Dock=0
Show=0
X=-1
Y=-1
W=67
H=63
[GUI/ToolBars/Device]
DockV2=1
Dock=0
Show=0
X=-1
Y=-1
W=883
H=31
[GUI/ToolBars/Edit]
DockV2=1
Dock=1
Path=0,0,0
Show=1
X=-1
Y=-1
W=148
H=63
[GUI/ToolBars/PlayMeter]
DockV2=1
Dock=1
Path=0,0,0,0,1
Show=1
X=-1
Y=-1
W=290
H=31
[GUI/ToolBars/RecordMeter]
DockV2=1
Dock=1
Path=0,0,0,0,0
Show=1
X=-1
Y=-1
W=290
H=31
[GUI/ToolBars/Selection]
DockV2=2
Dock=2
Path=0,0,0,0
Show=1
X=-1
Y=-1
W=240
H=63
[GUI/ToolBars/Snapping]
DockV2=2
Dock=2
Path=0,0
Show=1
X=-1
Y=-1
W=171
H=63
[GUI/ToolBars/SpectralSelection]
DockV2=2
Dock=0
Show=0
X=-1
Y=-1
W=262
H=63
[GUI/ToolBars/Time]
DockV2=2
Dock=2
Path=0,0,0
Show=1
X=-1
Y=-1
W=250
H=63
[GUI/ToolBars/TimeSignature]
DockV2=2
Dock=2
Path=0
Show=1
X=-1
Y=-1
W=230
H=63
[GUI/ToolBars/Transcription]
DockV2=2
Dock=2
Path=0,0,0,0,0
Show=1
X=-1
Y=-1
W=191
H=31
[GUI/TrackNames]
RecordingNameCustom=0
RecodingTrackName=Recorded_Audio
TrackNumber=0
DateStamp=0
TimeStamp=0
[Version]
Major=3
Minor=7
Micro=8
[Directories]
TempDir=/var/tmp/audacity-nocia
[Directories/Open]
Default=
LastUsed=/home/nocia/Downloads
[Directories/Save]
Default=
[Directories/Import]
Default=
[Directories/Export]
Default=
[Directories/MacrosOut]
Default=
[Module]
mod-aup=1
mod-cl=1
mod-ffmpeg=1
mod-flac=1
mod-lof=1
mod-midi-import-export=1
mod-mp2=1
mod-mp3=1
mod-mpg123=1
mod-ogg=1
mod-opus=1
mod-pcm=1
mod-script-pipe=4
mod-wavpack=1
[ModulePath]
mod-aup=/usr/lib/audacity/modules/mod-aup.so
mod-cl=/usr/lib/audacity/modules/mod-cl.so
mod-ffmpeg=/usr/lib/audacity/modules/mod-ffmpeg.so
mod-flac=/usr/lib/audacity/modules/mod-flac.so
mod-lof=/usr/lib/audacity/modules/mod-lof.so
mod-midi-import-export=/usr/lib/audacity/modules/mod-midi-import-export.so
mod-mp2=/usr/lib/audacity/modules/mod-mp2.so
mod-mp3=/usr/lib/audacity/modules/mod-mp3.so
mod-mpg123=/usr/lib/audacity/modules/mod-mpg123.so
mod-ogg=/usr/lib/audacity/modules/mod-ogg.so
mod-opus=/usr/lib/audacity/modules/mod-opus.so
mod-pcm=/usr/lib/audacity/modules/mod-pcm.so
mod-script-pipe=/usr/lib/audacity/modules/mod-script-pipe.so
mod-wavpack=/usr/lib/audacity/modules/mod-wavpack.so
[ModuleDateTime]
mod-aup=2026-06-11T12:28:17
mod-cl=2026-06-11T12:28:17
mod-ffmpeg=2026-06-11T12:28:17
mod-flac=2026-06-11T12:28:17
mod-lof=2026-06-11T12:28:17
mod-midi-import-export=2026-06-11T12:28:17
mod-mp2=2026-06-11T12:28:17
mod-mp3=2026-06-11T12:28:17
mod-mpg123=2026-06-11T12:28:17
mod-ogg=2026-06-11T12:28:17
mod-opus=2026-06-11T12:28:17
mod-pcm=2026-06-11T12:28:17
mod-script-pipe=2026-06-11T12:28:17
mod-wavpack=2026-06-11T12:28:17
[FFmpeg]
Enabled=1
[AudioIO]
RecordingDevice=default
Host=ALSA
PlaybackDevice=default
RecordChannels=2
Duplex=1
SWPlaythrough=0
SoundActivatedRecord=0
SilenceLevel=-50
PreRoll=5
Crossfade=10
EffectsPreviewLen=6
CutPreviewBeforeLen=2
CutPreviewAfterLen=1
SeekShortPeriod=1
SeekLongPeriod=15
Microfades=0
UnpinnedScrubbing=1
LatencyDuration=100
LatencyCorrection=-130
RecordingSource=
RecordingSourceIndex=-1
PlaybackSource=
[SamplingRate]
DefaultProjectSampleRate=48000
DefaultProjectSampleFormatChoice=Format32BitFloat
[Snap]
To=bar_1_8
[MenuBar]
[MenuBar/Optional]
[MenuBar/Optional/Extra]
Part1=Transport,Tools,Mixer,Edit,PlayAtSpeed,Seek,Device,Select,Import-Export
Part2=Navigation,Focus,Cursor,Track,Scriptables1,Scriptables2,Misc
[MenuBar/Optional/Extra/Part2]
Scriptables1=SelectTime,SelectFrequencies,SelectTracks,SetTrackStatus,SetTrackAudio,SetTrackVisuals,GetPreference,SetPreference,SetClip,SetEnvelope,SetLabel,SetProject
Scriptables2=Select,SetTrack,GetInfo,Message,Help,Import2,Export2,OpenProject2,SaveProject2,Drag,CompareAudio
[MenuBar/Optional/Extra/Part1]
Transport=Play,Stop,PlayOneSec,PlayToSelection,PlayBeforeSelectionStart,PlayAfterSelectionStart,PlayBeforeSelectionEnd,PlayAfterSelectionEnd,PlayBeforeAndAfterSelectionStart,PlayBeforeAndAfterSelectionEnd,PlayCutPreview,KeyboardScrubbing
Edit=DeleteKey,DeleteKey2,TimeShift
PlayAtSpeed=PlayAtSpeed,PlayAtSpeedCutPreview,PlayAtSpeedLooped,PlaySpeedDec,PlaySpeedInc,SetPlaySpeed
Select=SnapToOff,SnapToNearest,SnapToPrior,SelStart,SelEnd,SelExtLeft,SelExtRight,SelSetExtLeft,SelSetExtRight,SelCntrLeft,SelCntrRight,MoveToLabel
[MenuBar/View]
Windows=UndoHistory,MixerBoard
Other=Toolbars,ShowExtraMenus,ShowClipping,ShowRMS
[MenuBar/View/Other]
Toolbars=Toolbars,Timeline
[MenuBar/View/Other/Toolbars]
[MenuBar/View/Other/Toolbars/Toolbars]
Other=ShowTransportTB,ShowToolsTB,ShowRecordMeterTB,ShowPlayMeterTB,ShowEditTB,ShowCutCopyPasteTB,ShowTranscriptionTB,ShowDeviceTB,ShowSelectionTB,ShowTimeTB,ShowSpectralSelectionTB,ShowAudioSetupTB,ShowSnappingTB,ShowTimeSignatureTB
[MenuBar/Analyze]
[MenuBar/Analyze/Analyzers]
Windows=ContrastAnalyser,PlotSpectrum
[MenuBar/Transport]
Basic=Play,Record,Scrubbing,Cursor
[MenuBar/Transport/Basic]
Record=Record1stChoice,Record2ndChoice,TimerRecord,PunchAndRoll,Pause
Cursor=CursSelStart,CursSelEnd,CursTrackStart,CursTrackEnd,Clip,CursProjectStart,CursProjectEnd
[MenuBar/Transport/Other]
[MenuBar/Transport/Other/Options]
Part2=PinnedHead,Overdub,SWPlaythrough
[MenuBar/Tracks]
[MenuBar/Tracks/Add]
Add=NewMonoTrack,NewStereoTrack,NewLabelTrack,NewTimeTrack
[MenuBar/File]
[MenuBar/File/Import-Export]
ExportOther=ExportLabels,ExportMIDI
Import=ImportAudio,ImportMIDI,ImportLabels,ImportRaw
[MenuBar/Edit]
Other=Clip,LabelEditMenus,EditMetaData
[MenuBar/Edit/Other]
Clip=ChangePitchAndSpeed,PitchDown,PitchUp,RenameClip,RenderPitchAndSpeed
[MenuBar/Select]
Basic=SelectAll,SelectNone,Tracks,Region,Spectral,Clip
[MenuBar/Tools]
Manage=ManageTools,Macros
[MenuBar/Help]
[MenuBar/Help/Other]
Diagnostics=DeviceInfo,MidiDeviceInfo,Log,CrashReport
[ActiveProjects]
1=/var/tmp/audacity-nocia/New Project 2026-07-18 03-22-36 N-1.aup3unsaved
[Window]
X=22
Y=52
Width=3396
Height=1366
Maximized=0
Normal_X=22
Normal_Y=52
Normal_Width=3396
Normal_Height=1366
Iconized=0
[Preferences]
Tracks=TracksBehaviors,Spectrum
[Prefs]
Width=1037
Height=480
PrefsCategory=0
[Prefs/KeyConfig]
ViewBy=tree
[Effects]
GroupBy=default
RealtimeGroupBy=groupby:type:publisher
SkipEffectsScanAtStartup=0
[ExtendedImport]
OverrideExtendedImportByOpenFileDialogChoice=1
[FileFormats]
LabelStyleChoice=Standard
AllegroStyleChoice=Seconds
MusicFileImportSettingChoice=Ask
MusicFileImportOnExistingProjectSettingChoice=MatchIfBeatsAndMeasures
[Spectrum]
ColorScheme=SpecColorNew
MaxFreq=20000
Algorithm=0
EnableSpectralSelection=1
ScaleType=2
WindowType=3
ZeroPaddingFactor=2
FFTSize=2048
FrequencyGain=0
Gain=20
Range=80
MinFreq=0
[Locale]
Language=System
[Quality]
LibsoxrSampleRateConverterChoice=BestQuality
DitherAlgorithmChoice=None
LibsoxrHQSampleRateConverterChoice=BestQuality
HQDitherAlgorithmChoice=Shaped
[MidiIO]
Host=ALSA
SynthLatency=5
PlaybackDevice=ALSA: Midi Through Port-0
[Warnings]
DropoutDetected=1
[WaveTrackMenu]
[WaveTrackMenu/SubViews]
Extra=WaveColor,SpectrogramSettings
[RecentFiles]
file01=/home/nocia/Downloads/C418 - Shuniji.mp3
[RecentFiles/RecentFiles]
file01=/home/nocia/Downloads/C418 - Shuniji.mp3

~/.config/pipewire/pipewire.conf.d/sample-rate.conf

context.properties = {
    default.clock.allowed-rates = [ 44100 48000 88200 96000 176400 192000 352800 384000 ]
}
   $ grep -E 'Codec|Audio Output|rates' /proc/asound/card*/codec#*
/proc/asound/card0/codec#0:Codec: ATI R6xx HDMI
/proc/asound/card0/codec#0:    rates [0x70]: 32000 44100 48000
/proc/asound/card0/codec#0:Node 0x02 [Audio Output] wcaps 0x221: Stereo Digital Stripe
/proc/asound/card0/codec#0:Node 0x04 [Audio Output] wcaps 0x221: Stereo Digital Stripe
/proc/asound/card0/codec#0:Node 0x06 [Audio Output] wcaps 0x221: Stereo Digital Stripe
/proc/asound/card0/codec#0:Node 0x08 [Audio Output] wcaps 0x221: Stereo Digital Stripe
/proc/asound/card1/codec#0:Codec: Realtek ALC1220
/proc/asound/card1/codec#0:    rates [0x5f0]: 32000 44100 48000 88200 96000 192000
/proc/asound/card1/codec#0:Node 0x02 [Audio Output] wcaps 0x41d: Stereo Amp-Out
/proc/asound/card1/codec#0:    rates [0x7e0]: 44100 48000 88200 96000 176400 192000
/proc/asound/card1/codec#0:Node 0x03 [Audio Output] wcaps 0x41d: Stereo Amp-Out
/proc/asound/card1/codec#0:    rates [0x7e0]: 44100 48000 88200 96000 176400 192000
/proc/asound/card1/codec#0:Node 0x04 [Audio Output] wcaps 0x41d: Stereo Amp-Out
/proc/asound/card1/codec#0:    rates [0x7e0]: 44100 48000 88200 96000 176400 192000
/proc/asound/card1/codec#0:Node 0x05 [Audio Output] wcaps 0x41d: Stereo Amp-Out
/proc/asound/card1/codec#0:    rates [0x7e0]: 44100 48000 88200 96000 176400 192000
/proc/asound/card1/codec#0:Node 0x06 [Audio Output] wcaps 0x611: Stereo Digital
/proc/asound/card1/codec#0:    rates [0x5f0]: 32000 44100 48000 88200 96000 192000
/proc/asound/card1/codec#0:    rates [0x7e0]: 44100 48000 88200 96000 176400 192000
/proc/asound/card1/codec#0:    rates [0x7e0]: 44100 48000 88200 96000 176400 192000
/proc/asound/card1/codec#0:Node 0x25 [Audio Output] wcaps 0x41d: Stereo Amp-Out
/proc/asound/card1/codec#0:    rates [0x7e0]: 44100 48000 88200 96000 176400 192000

While I have audio playing in the background:

   $ grep rate: /proc/asound/card?/pcm??/sub?/hw_params
/proc/asound/card1/pcm0p/sub0/hw_params:rate: 48000 (48000/1)

Last edited by CryogEnix (2026-07-18 09:05:34)

Offline

#2 2026-07-18 07:34:18

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,836

Re: [SOLVED] Audacity Error code: -9997 Invalid sample rate

https://wiki.archlinux.org/title/PipeWi … ample_rate
https://wiki.archlinux.org/title/PipeWi … le_rate(s)

Though google suggests audacity just says that whenever there's *any* problem w/ opening the recording device - can you "arecord -f cd > /tmp/wtf.wav"?

Offline

#3 2026-07-18 07:43:25

CryogEnix
Member
Registered: 2025-12-14
Posts: 35

Re: [SOLVED] Audacity Error code: -9997 Invalid sample rate

   $ arecord -f cd > /tmp/wtf.wav
arecord: set_params:1462: Unable to install hw params:
ACCESS: RW_INTERLEAVED
FORMAT: S16_LE
SUBFORMAT: STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 44100
PERIOD_TIME: 125000
PERIOD_SIZE: (5512 5513)
PERIOD_BYTES: 22050
PERIODS: 4
BUFFER_TIME: 500000
BUFFER_SIZE: 22050
BUFFER_BYTES: 88200
TICK_TIME: [0 0]

Offline

#4 2026-07-18 07:57:06

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,836

Re: [SOLVED] Audacity Error code: -9997 Invalid sample rate

arecord --dump-hw-params > /dev/null

Did you check the linked wiki entries?

Offline

#5 2026-07-18 08:01:31

CryogEnix
Member
Registered: 2025-12-14
Posts: 35

Re: [SOLVED] Audacity Error code: -9997 Invalid sample rate

   $ arecord --dump-hw-params > /dev/null
Warning: Some sources (like microphones) may produce inaudible results
         with 8-bit sampling. Use '-f' argument to increase resolution
         e.g. '-f S16_LE'.
HW Params of device "alsa_capture.aplay":
--------------------
ACCESS: MMAP_INTERLEAVED MMAP_NONINTERLEAVED RW_INTERLEAVED RW_NONINTERLEAVED
FORMAT: U8 S16_LE S24_LE S32_LE FLOAT_LE S24_3LE S24_3BE
SUBFORMAT: STD MSBITS_MAX MSBITS_20 MSBITS_24
SAMPLE_BITS: [8 32]
FRAME_BITS: [8 4096]
CHANNELS: [1 128]
RATE: [1 384000]
PERIOD_TIME: (0 4294967295)
PERIOD_SIZE: (0 2097152]
PERIOD_BYTES: [128 2097152]
PERIODS: [2 1024]
BUFFER_TIME: (2 4294967295]
BUFFER_SIZE: [1 4194304]
BUFFER_BYTES: [256 4194304]
TICK_TIME: ALL
--------------------
arecord: set_params:1462: Unable to install hw params:
ACCESS: RW_INTERLEAVED
FORMAT: U8
SUBFORMAT: STD
SAMPLE_BITS: 8
FRAME_BITS: 8
CHANNELS: 1
RATE: 8000
PERIOD_TIME: 125000
PERIOD_SIZE: 1000
PERIOD_BYTES: 1000
PERIODS: 4
BUFFER_TIME: 500000
BUFFER_SIZE: 4000
BUFFER_BYTES: 4000
TICK_TIME: [0 0]

The first link points to a non-recommended change, and switching default sample rate to 44100 in both sample-rate.conf and Audacity does nothing to resolve the issue... and as for the second one, I've just shown the changes I've made from that article section.

   $ pactl list sources
Source #56
        State: SUSPENDED
        Name: alsa_output.pci-0000_7c_00.6.analog-stereo.monitor
        Description: Monitor of Ryzen HD Audio Controller Analog Stereo
        Driver: PipeWire
        Sample Specification: s32le 2ch 48000Hz
        Channel Map: front-left,front-right
        Owner Module: 4294967295
        Mute: no
        Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
                balance 0.00
        Base Volume: 65536 / 100% / 0.00 dB
        Monitor of Sink: alsa_output.pci-0000_7c_00.6.analog-stereo
        Latency: 0 usec, configured 0 usec
        Flags: HARDWARE DECIBEL_VOLUME LATENCY
        Properties:
                object.path = "alsa:acp:Generic:4:playback"
                api.alsa.path = "front:1"
                api.alsa.pcm.card = "1"
                api.alsa.pcm.stream = "playback"
                port.group = "playback"
                device.icon_name = "audio-card-analog"
                device.bus = "pci"
                audio.channels = "2"
                audio.position = "[ FL, FR ]"
                device.routes = "2"
                alsa.resolution_bits = "16"
                alsa.card = "1"
                alsa.card_name = "HD-Audio Generic"
                alsa.long_card_name = "HD-Audio Generic at 0xdfa00000 irq 156"
                alsa.driver_name = "snd_hda_intel"
                alsa.mixer_name = "Realtek ALC1220"
                alsa.components = "HDA:10ec1168,1043886b,00100101"
                alsa.id = "Generic"
                device.api = "alsa"
                device.class = "monitor"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "ALC1220 Analog"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.device = "0"
                alsa.sync.id = "00000000:00000000:00000000:00000000"
                device.profile.name = "analog-stereo"
                device.profile.description = "Analog Stereo"
                card.profile.device = "4"
                device.id = "49"
                factory.name = "api.alsa.pcm.sink"
                node.pause-on-idle = "false"
                priority.driver = "1009"
                priority.session = "1009"
                media.class = "Audio/Sink"
                node.name = "alsa_output.pci-0000_7c_00.6.analog-stereo"
                node.nick = "ALC1220 Analog"
                device.description = "Ryzen HD Audio Controller"
                api.alsa.card.name = "HD-Audio Generic"
                api.alsa.card.longname = "HD-Audio Generic at 0xdfa00000 irq 156"
                factory.id = "19"
                clock.quantum-limit = "8192"
                client.id = "47"
                node.driver = "true"
                node.loop.name = "data-loop.0"
                library.name = "audioconvert/libspa-audioconvert"
                object.id = "56"
                object.serial = "56"
                device.enum.api = "udev"
                api.alsa.card = "1"
                device.plugged.usec = "7819220"
                device.bus_path = "pci-0000:7c:00.6"
                sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:7c:00.6/sound/card1"
                device.subsystem = "sound"
                device.vendor.id = "0x1022"
                device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
                device.product.id = "0x15e3"
                device.product.name = "Ryzen HD Audio Controller"
                device.name = "alsa_card.pci-0000_7c_00.6"
                device.nick = "HD-Audio Generic"
                api.alsa.use-acp = "true"
                api.acp.auto-profile = "false"
                api.acp.auto-port = "false"
                api.dbus.ReserveDevice1.Priority = "-20"
                api.alsa.split-enable = "true"
                api.dbus.ReserveDevice1 = "Audio1"
                spa.object.id = "4"
                device.string = "1"
        Ports:
                analog-output-lineout: Line Out (type: Line, priority: 9000, availability group: Legacy 4, available)
                analog-output-headphones: Headphones (type: Headphones, priority: 9900, availability group: Legacy 5, not available)
        Active Port: analog-output-lineout
        Formats:
                pcm

Source #57
        State: SUSPENDED
        Name: alsa_input.pci-0000_7c_00.6.analog-stereo
        Description: Ryzen HD Audio Controller Analog Stereo
        Driver: PipeWire
        Sample Specification: s32le 2ch 48000Hz
        Channel Map: front-left,front-right
        Owner Module: 4294967295
        Mute: no
        Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
                balance 0.00
        Base Volume: 65536 / 100% / 0.00 dB
        Monitor of Sink: n/a
        Latency: 0 usec, configured 0 usec
        Flags: HARDWARE DECIBEL_VOLUME LATENCY
        Properties:
                object.path = "alsa:acp:Generic:0:capture"
                api.alsa.path = "front:1"
                api.alsa.pcm.card = "1"
                api.alsa.pcm.stream = "capture"
                port.group = "capture"
                device.icon_name = "audio-card-analog"
                device.bus = "pci"
                audio.channels = "2"
                audio.position = "[ FL, FR ]"
                device.routes = "3"
                alsa.resolution_bits = "16"
                alsa.card = "1"
                alsa.card_name = "HD-Audio Generic"
                alsa.long_card_name = "HD-Audio Generic at 0xdfa00000 irq 156"
                alsa.driver_name = "snd_hda_intel"
                alsa.mixer_name = "Realtek ALC1220"
                alsa.components = "HDA:10ec1168,1043886b,00100101"
                alsa.id = "Generic"
                device.api = "alsa"
                device.class = "sound"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "ALC1220 Analog"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.device = "0"
                alsa.sync.id = "00000000:00000000:00000000:00000000"
                device.profile.name = "analog-stereo"
                device.profile.description = "Analog Stereo"
                card.profile.device = "0"
                device.id = "49"
                factory.name = "api.alsa.pcm.source"
                node.pause-on-idle = "false"
                priority.driver = "2009"
                priority.session = "2009"
                media.class = "Audio/Source"
                node.name = "alsa_input.pci-0000_7c_00.6.analog-stereo"
                node.nick = "ALC1220 Analog"
                device.description = "Ryzen HD Audio Controller"
                api.alsa.card.name = "HD-Audio Generic"
                api.alsa.card.longname = "HD-Audio Generic at 0xdfa00000 irq 156"
                factory.id = "19"
                clock.quantum-limit = "8192"
                client.id = "47"
                node.driver = "true"
                node.loop.name = "data-loop.0"
                library.name = "audioconvert/libspa-audioconvert"
                object.id = "57"
                object.serial = "57"
                device.enum.api = "udev"
                api.alsa.card = "1"
                device.plugged.usec = "7819220"
                device.bus_path = "pci-0000:7c:00.6"
                sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:7c:00.6/sound/card1"
                device.subsystem = "sound"
                device.vendor.id = "0x1022"
                device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
                device.product.id = "0x15e3"
                device.product.name = "Ryzen HD Audio Controller"
                device.name = "alsa_card.pci-0000_7c_00.6"
                device.nick = "HD-Audio Generic"
                api.alsa.use-acp = "true"
                api.acp.auto-profile = "false"
                api.acp.auto-port = "false"
                api.dbus.ReserveDevice1.Priority = "-20"
                api.alsa.split-enable = "true"
                api.dbus.ReserveDevice1 = "Audio1"
                spa.object.id = "4"
                device.string = "1"
        Ports:
                analog-input-front-mic: Front Microphone (type: Mic, priority: 8500, availability group: Legacy 1, not available)
                analog-input-rear-mic: Rear Microphone (type: Mic, priority: 8200, availability group: Legacy 2, not available)
                analog-input-linein: Line In (type: Line, priority: 8100, availability group: Legacy 3, not available)
        Active Port: analog-input-front-mic
        Formats:
                pcm
   $ grep rate: /proc/asound/card?/pcm??/sub?/hw_params
/proc/asound/card1/pcm0p/sub0/hw_params:rate: 48000 (48000/1)

Last edited by CryogEnix (2026-07-18 08:26:03)

Offline

#6 2026-07-18 08:34:03

CryogEnix
Member
Registered: 2025-12-14
Posts: 35

Re: [SOLVED] Audacity Error code: -9997 Invalid sample rate

Audio device info gathered from Help --> Diagnostics:           https://paste.c-net.org/CoercedMoron

Device ID: 10
Device name: default
Host name: ALSA
Recording channels: 128
Playback channels: 128
Low Recording Latency: 0.00870748
Low Playback Latency: 0.00870748
High Recording Latency: 0.0348299
High Playback Latency: 0.0348299
Supported Playback Rates:
    8000
    9600
    11025
    12000
    15000
    16000
    22050
    24000
    32000
    44100
    48000
    88200
    96000
    176400
    192000
    352800
    384000
Supported Capture Rates:

The default device has no capture rates...
I tried other devices, but the ones you've mentioned in your post after this one barely record anything audible, though the error message would no longer show up.
Still, the original problem has been solved by switching to something else than this default ALSA one.

EDIT:
I'm not exactly sure what happened, but re-plugging my headphones in my Mic out port and clicking "Rescan Audio Devices" in Audacity has changed the ALSA default device to now have the correct capture rates, which cleanly records everything on my system. Some tinkering in pulsemixer may have also contributed to this: all I did was switching the input to "Monitor of Ryzen HD Audio Controller Analog Stereo".

==============================
Device ID: 9
Device name: default
Host name: ALSA
Recording channels: 128
Playback channels: 128
Low Recording Latency: 0.00870748
Low Playback Latency: 0.00870748
High Recording Latency: 0.0348299
High Playback Latency: 0.0348299
Supported Playback Rates:
    8000
    9600
    11025
    12000
    15000
    16000
    22050
    24000
    32000
    44100
    48000
    88200
    96000
    176400
    192000
    352800
    384000
Supported Capture Rates:
    8000
    9600
    11025
    12000
    15000
    16000
    22050
    24000
    32000
    44100
    48000
    88200
    96000
    176400
    192000
    352800
    384000
==============================
Device ID: 10
Device name: Ryzen HD Audio Controller Analog Stereo
Host name: JACK Audio Connection Kit
Recording channels: 4
Playback channels: 2
Low Recording Latency: 0.022
Low Playback Latency: 0.0213333
High Recording Latency: 0.022
High Playback Latency: 0.0213333
Supported Playback Rates:
    44100
    48000
Supported Capture Rates:
    44100
    48000
==============================

Last edited by CryogEnix (2026-07-18 10:15:09)

Offline

#7 2026-07-18 08:43:09

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,836

Re: [SOLVED] Audacity Error code: -9997 Invalid sample rate

Default recording device number: 10
==============================
Device ID: 10
Device name: default
Host name: ALSA
Recording channels: 128
Playback channels: 128
Low Recording Latency: 0.00870748
Low Playback Latency: 0.00870748
High Recording Latency: 0.0348299
High Playback Latency: 0.0348299
Supported Playback Rates:
    8000
    9600
    11025
    12000
    15000
    16000
    22050
    24000
    32000
    44100
    48000
    88200
    96000
    176400
    192000
    352800
    384000
Supported Capture Rates:
==============================
==============================
Device ID: 4
Device name: HD-Audio Generic: ALC1220 Analog (hw:1,0)
Host name: ALSA
Recording channels: 2
Playback channels: 0
Low Recording Latency: 0.00870748
Low Playback Latency: -1
High Recording Latency: 0.0348299
High Playback Latency: -1
Supported Capture Rates:
    44100
    48000
    88200
    96000
    176400
    192000
==============================
Device ID: 5
Device name: HD-Audio Generic: ALC1220 Alt Analog (hw:1,2)
Host name: ALSA
Recording channels: 2
Playback channels: 0
Low Recording Latency: 0.00870748
Low Playback Latency: -1
High Recording Latency: 0.0348299
High Playback Latency: -1
Supported Capture Rates:
    44100
    48000
    88200
    96000
    176400
    192000
==============================

Offline

Board footer

Powered by FluxBB