An update on my investigations. This is on a freshly re-flashed instance with nothing installed except python3-pyaudio
which is needed for Dusty’s script. This is also running directly on the host from the Desktop.
Here is the output from Dusty’s code:
$ python list_audio_devices.py
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib confmisc.c:1369:(snd_func_refer) Unable to find definition 'cards.2.pcm.hdmi.0:CARD=2,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM hdmi
ALSA lib confmisc.c:1369:(snd_func_refer) Unable to find definition 'cards.2.pcm.hdmi.0:CARD=2,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM hdmi
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib pcm_dmix.c:1005:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
AUDIO DEVICES:
0: NVIDIA Jetson AGX Orin HDA: HDMI 1 (hw:0,7) (inputs=0 outputs=8 sampleRate=44100)
1: NVIDIA Jetson AGX Orin HDA: HDMI 2 (hw:0,8) (inputs=0 outputs=8 sampleRate=44100)
2: NVIDIA Jetson AGX Orin HDA: HDMI 3 (hw:0,9) (inputs=0 outputs=8 sampleRate=44100)
3: NVIDIA Jetson AGX Orin APE: - (hw:1,0) (inputs=16 outputs=16 sampleRate=44100)
4: NVIDIA Jetson AGX Orin APE: - (hw:1,1) (inputs=16 outputs=16 sampleRate=44100)
5: NVIDIA Jetson AGX Orin APE: - (hw:1,2) (inputs=16 outputs=16 sampleRate=44100)
6: NVIDIA Jetson AGX Orin APE: - (hw:1,3) (inputs=16 outputs=16 sampleRate=44100)
7: NVIDIA Jetson AGX Orin APE: - (hw:1,4) (inputs=16 outputs=16 sampleRate=44100)
8: NVIDIA Jetson AGX Orin APE: - (hw:1,5) (inputs=16 outputs=16 sampleRate=44100)
9: NVIDIA Jetson AGX Orin APE: - (hw:1,6) (inputs=16 outputs=16 sampleRate=44100)
10: NVIDIA Jetson AGX Orin APE: - (hw:1,7) (inputs=16 outputs=16 sampleRate=44100)
11: NVIDIA Jetson AGX Orin APE: - (hw:1,8) (inputs=16 outputs=16 sampleRate=44100)
12: NVIDIA Jetson AGX Orin APE: - (hw:1,9) (inputs=16 outputs=16 sampleRate=44100)
13: NVIDIA Jetson AGX Orin APE: - (hw:1,10) (inputs=16 outputs=16 sampleRate=44100)
14: NVIDIA Jetson AGX Orin APE: - (hw:1,11) (inputs=16 outputs=16 sampleRate=44100)
15: NVIDIA Jetson AGX Orin APE: - (hw:1,12) (inputs=16 outputs=16 sampleRate=44100)
16: NVIDIA Jetson AGX Orin APE: - (hw:1,13) (inputs=16 outputs=16 sampleRate=44100)
17: NVIDIA Jetson AGX Orin APE: - (hw:1,14) (inputs=16 outputs=16 sampleRate=44100)
18: NVIDIA Jetson AGX Orin APE: - (hw:1,15) (inputs=16 outputs=16 sampleRate=44100)
19: NVIDIA Jetson AGX Orin APE: - (hw:1,16) (inputs=16 outputs=16 sampleRate=44100)
20: NVIDIA Jetson AGX Orin APE: - (hw:1,17) (inputs=16 outputs=16 sampleRate=44100)
21: NVIDIA Jetson AGX Orin APE: - (hw:1,18) (inputs=16 outputs=16 sampleRate=44100)
22: NVIDIA Jetson AGX Orin APE: - (hw:1,19) (inputs=16 outputs=16 sampleRate=44100)
23: PowerConf S3: USB Audio (hw:2,0) (inputs=1 outputs=2 sampleRate=48000)
24: sysdefault (inputs=128 outputs=128 sampleRate=48000)
25: front (inputs=0 outputs=2 sampleRate=48000)
26: surround40 (inputs=0 outputs=2 sampleRate=48000)
27: iec958 (inputs=0 outputs=2 sampleRate=48000)
28: spdif (inputs=1 outputs=2 sampleRate=48000)
29: samplerate (inputs=128 outputs=128 sampleRate=44100)
30: speexrate (inputs=128 outputs=128 sampleRate=44100)
31: pulse (inputs=32 outputs=32 sampleRate=44100)
32: upmix (inputs=8 outputs=8 sampleRate=48000)
33: vdownmix (inputs=6 outputs=6 sampleRate=48000)
34: demixer (inputs=0 outputs=128 sampleRate=48000)
35: dmix (inputs=0 outputs=2 sampleRate=48000)
36: default (inputs=32 outputs=32 sampleRate=44100)
Specifically
24: PowerConf S3: USB Audio (hw:2,0) (inputs=1 outputs=0 sampleRate=48000)
Here are more details:
$ cat /proc/asound/cards
0 [HDA ]: tegra-hda - NVIDIA Jetson AGX Orin HDA
NVIDIA Jetson AGX Orin HDA at 0x3518000 irq 122
1 [APE ]: tegra-ape - NVIDIA Jetson AGX Orin APE
Unknown-NVIDIAJetsonAGXOrinDeveloperKit-NotSpecified
2 [S3 ]: USB-Audio - PowerConf S3
Anker PowerConf S3 at usb-3610000.usb-4.1, full speed
Why does is state Unknown-NVIDIAJetsonAGXOrinDeveloperKit-NotSpecified
for the APE device? Looking at this documentation shows the output on a Jetson AGX Xavier. I would expect it to show the APE dvice relative to the Orin AGX, and not Unknown-NVIDIAJetsonAGXOrinDeveloperKit-NotSpecified
.
When I try to play the audio specifying the device on the host (not in a container):
$ aplay -Dhw:S3,0 test-mic.wav
Playing WAVE 'test-mic.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
aplay: set_params:1358: Channels count non available
$ aplay -l
...
card 2: S3 [PowerConf S3], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
$ aplay -Dhw:2,0 test-mic.wav
Playing WAVE 'test-mic.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
aplay: set_params:1358: Channels count non available
$ aplay -Dhw:S3,0 -c 1 test-mic.wav
Playing WAVE 'test-mic.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
aplay: set_params:1358: Channels count non available
Playing the audio using the default card as set from the Desktop Settings → Sound, it works:
$ aplay test-mic.wav
Playing WAVE 'test-mic.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
[PLAYS AUDIO]
When the default is set through Desktop Settings, I get a resource busy when I specify the device:
$ aplay -Dhw:S3,0 -c 1 test-mic.wav
aplay: main:831: audio open error: Device or resource busy
More debug infomation:
$ amixer -c 2 contents
numid=3,iface=MIXER,name='PCM Playback Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on
numid=4,iface=MIXER,name='PCM Playback Volume'
; type=INTEGER,access=rw---R--,values=1,min=0,max=7248,step=0
: values=5943
| dBminmax-min=-28.37dB,max=-0.06dB
numid=5,iface=MIXER,name='Mic Capture Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on
numid=6,iface=MIXER,name='Mic Capture Volume'
; type=INTEGER,access=rw---R--,values=1,min=0,max=7248,step=0
: values=7248
| dBminmax-min=-28.37dB,max=-0.06dB
numid=2,iface=PCM,name='Capture Channel Map'
; type=INTEGER,access=r----R--,values=1,min=0,max=36,step=0
: values=2
| container
| chmap-fixed=MONO
numid=1,iface=PCM,name='Playback Channel Map'
; type=INTEGER,access=r----R--,values=2,min=0,max=36,step=0
: values=0,0
| container
| chmap-fixed=FL,FR
Finally, I found a tone.py
script. When I run it:
$ python tone.py
init_audio: Create PyAudio object
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib confmisc.c:1369:(snd_func_refer) Unable to find definition 'cards.2.pcm.hdmi.0:CARD=2,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM hdmi
ALSA lib confmisc.c:1369:(snd_func_refer) Unable to find definition 'cards.2.pcm.hdmi.0:CARD=2,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM hdmi
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib pcm_dmix.c:1005:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
init_audio: Open stream
Expression 'paInvalidSampleRate' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2048
Expression 'PaAlsaStreamComponent_InitialConfigure( &self->playback, outParams, self->primeBuffers, hwParamsPlayback, &realSr )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2721
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2842
Traceback (most recent call last):
File "/mnt/nvme/git/mimzy/tone.py", line 73, in <module>
main()
File "/mnt/nvme/git/mimzy/tone.py", line 55, in main
init_audio()
File "/mnt/nvme/git/mimzy/tone.py", line 20, in init_audio
s = pa.open(output=True,
File "/mnt/nvme/git/mimzy/mimzy-env/lib/python3.10/site-packages/pyaudio/__init__.py", line 639, in open
stream = PyAudio.Stream(self, *args, **kwargs)
File "/mnt/nvme/git/mimzy/mimzy-env/lib/python3.10/site-packages/pyaudio/__init__.py", line 441, in __init__
self._stream = pa.open(**arguments)
OSError: [Errno -9997] Invalid sample rate
Here are the logs from the linked document:
kernel.log (85.9 KB)
dt.log (390.8 KB)
tone.py.txt (1.6 KB)
I am at my wits end at this stage and am suspect that the issue is with the Orin AGX which I purchased new a couple of months ago and came with Jetpack 6.0. Perhaps this is something that is broken in the this pre-release?
At this point, I am dead in the water.
Should I open up a new issue since after a lot of investigations this is an issue on the host device.