Ubuntu 22.04 audio capture issue
Hi all, We are using an Ubuntu 22.04 install with X (not Wayland) on an Intel NUC 11 Pro NUC11TNKi3. When simply launching a terminal, we can record audio easily, and with success: ffmpeg -f alsa -i default alsaout.wav However, we need to launch this as the same user as we used in X, but from a daemon. We use sudo to become that same user and launch the exact same ffmpeg command as above. This results in ffmpeg giving the following error: [alsa @ 0x5560dc7f9e40] cannot open audio device default (No such file or directory) default: Input/output error In both situations we can run alsamixer with success, and 'arecord -L' shows: null Discard all samples (playback) or generate zero samples (capture) default Playback/recording through the PulseAudio sound server samplerate Rate Converter Plugin Using Samplerate Library speexrate Rate Converter Plugin Using Speex Resampler jack JACK Audio Connection Kit oss Open Sound System pulse PulseAudio Sound Server upmix Plugin for channel upmix (4,6,8) vdownmix Plugin for channel downmix (stereo) with a simple spacialization usbstream:CARD=PCH HDA Intel PCH USB Stream Output However also in both cases, 'arecord -l' only shows **** List of CAPTURE Hardware Devices **** If we use ssh to that same machine, using that same user, it is also working fine. We have tried to find any indications what is the cause (like making that user part of the audio group), but none of it worked. In previous versions of Ubuntu (LTS), this was no problem at all. Any hints or ideas are welcome, Christof Christof Ameye CTO T +32 56 74 50 10 E christof.ameye@oscart.eu oscart.eu
On 11/28/2022 8:14 AM, Christof Ameye (Oscart Group) wrote:
We have tried to find any indications what is the cause (like making that user part of the audio group), but none of it worked. At first blush, it sounds like the environments may be different- perhaps something is set in one of the login/(ba)sh .rc files differently for interactive vs non-interactive invocations (these files can change between releases and usually nobody looks at them) or alsa behaves differently when interactive.
(Please include the message text in the email body, not as attached images. Thanks.) Dave B- Custom distros are simply not an option for many people, either for time or ability to make them, company standards, etc. It's pretty likely that most people who need them are already rolling their own. (And IMHO this is off-topic for the ffmpeg list, anyway.) Later, z!
Followup: We have found a solution via a different group: https://unix.stackexchange.com/questions/231941/cant-run-aplay-as-root/60270... It involves setting the XDG_RUNTIME_DIR environment variable. Just wanted to let you know. -- Christof [https://cdn.sstatic.net/Sites/unix/Img/apple-touch-icon@2.png?v=32fb07f7ce26]<https://unix.stackexchange.com/questions/231941/cant-run-aplay-as-root/602707> Can't run aplay as root!<https://unix.stackexchange.com/questions/231941/cant-run-aplay-as-root/602707> Not that I need to aplay as root but it came across me and I wondered why it shouldn't work. # aplay /home/bibek/apert.wav XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid... unix.stackexchange.com Christof Ameye CTO T +32 56 74 50 10 E christof.ameye@oscart.eu oscart.eu ________________________________ Van: ffmpeg-user <ffmpeg-user-bounces@ffmpeg.org> namens Christof Ameye (Oscart Group) <christof.ameye@oscart.eu> Verzonden: maandag 28 november 2022 17:14 Aan: ffmpeg-user@ffmpeg.org <ffmpeg-user@ffmpeg.org> Onderwerp: [FFmpeg-user] Ubuntu 22.04 audio capture issue Hi all, We are using an Ubuntu 22.04 install with X (not Wayland) on an Intel NUC 11 Pro NUC11TNKi3. When simply launching a terminal, we can record audio easily, and with success: ffmpeg -f alsa -i default alsaout.wav However, we need to launch this as the same user as we used in X, but from a daemon. We use sudo to become that same user and launch the exact same ffmpeg command as above. This results in ffmpeg giving the following error: [alsa @ 0x5560dc7f9e40] cannot open audio device default (No such file or directory) default: Input/output error In both situations we can run alsamixer with success, and 'arecord -L' shows: null Discard all samples (playback) or generate zero samples (capture) default Playback/recording through the PulseAudio sound server samplerate Rate Converter Plugin Using Samplerate Library speexrate Rate Converter Plugin Using Speex Resampler jack JACK Audio Connection Kit oss Open Sound System pulse PulseAudio Sound Server upmix Plugin for channel upmix (4,6,8) vdownmix Plugin for channel downmix (stereo) with a simple spacialization usbstream:CARD=PCH HDA Intel PCH USB Stream Output However also in both cases, 'arecord -l' only shows **** List of CAPTURE Hardware Devices **** If we use ssh to that same machine, using that same user, it is also working fine. We have tried to find any indications what is the cause (like making that user part of the audio group), but none of it worked. In previous versions of Ubuntu (LTS), this was no problem at all. Any hints or ideas are welcome, Christof Christof Ameye CTO T +32 56 74 50 10 E christof.ameye@oscart.eu oscart.eu
participants (2)
-
Carl Zwanzig -
Christof Ameye (Oscart Group)