VirtualBox

Ticket #1908 (new enhancement)

Opened 6 years ago

Last modified 3 years ago

VirtualBox mute on alsa/dmix configuration

Reported by: therp Owned by:
Priority: minor Component: audio
Version: VirtualBox 1.6.4 Keywords:
Cc: Guest type: other
Host type: other

Description

dmix is an alsa plugin for user space sound stream mixing. The problem is that when the "default" alsa audio device is routed through dmix, then applications that try to open "default" for recording fail as dmix is only an output plugin. In general, the trick is to set the input device to something besides from "default" for these applications ("null"/"hw:0,0" is an option). This is possible with VirtualBox by setting the VBOX_ALSA_ADC_DEV=".." variable.

First suggestion: Replacing the error message

00:00:08.982 ALSA: Failed to open 'default' as ADC

with something like

00:00:08.982 ALSA: Failed to open 'default' as ADC, set VBOX_ALSA_ADC_DEV environment variable.

in alsaaudio.c. I had to read "audio_process_options/audio_get_conf_in" in audio.c closely to understand what the code is actually doing.

Second suggestion: If the input device is unavailable, complain but don't go mute completely. I presume the user rarely cares about a working input stream but will most certainly care about a working output stream. The strategy for alsaaudio.c in alsa_init_in could be: call alsa_open for a second time but with "null" set as conf.pcm_name_in.

Change History

comment:1 follow-ups: ↓ 2 ↓ 3 Changed 5 years ago by lex

Can you give more detail on how to implement your suggested workaround?

I tried this:

$ export VBOX_ALSA_ADC_DEV="null" $ VirtualBox

But I still get this in my log and I get the same audio open failure:

00:00:01.195 Audio: Trying driver 'alsa'. 00:00:01.196 Audio: set_record_source ars=0 als=0 (not implemented) 00:00:01.209 ALSA: ADC frequency 44100Hz, period size 0, buffer size -1209028620 00:00:01.289 ALSA: ADC frequency 44100Hz, period size 0, buffer size -1209028620 00:00:01.411 ALSA: Failed to apply audio parameters 00:00:01.534 ALSA: Failed to apply audio parameters 00:00:01.609 ALSA: ADC frequency 44100Hz, period size 0, buffer size -1296204370 00:00:01.689 ALSA: ADC frequency 44100Hz, period size 0, buffer size -1296204370 00:00:01.749 AC97: WARNING: Unable to open PCM IN! 00:00:01.749 AC97: WARNING: Unable to open PCM MC! 00:00:01.749 AC97: WARNING: Unable to open PCM OUT! 00:00:01.749 Audio: Using NULL audio driver 00:00:01.749 Audio: set_record_source ars=0 als=0 (not implemented) 00:00:01.750 VM: Raising runtime error 'HostAudioNotResponding' (fFlags=0x0)

What am I doing wrong?

comment:2 in reply to: ↑ 1 Changed 5 years ago by lex

Well, that sure was gross. Let me try again.

00:00:01.195 Audio: Trying driver 'alsa'.
00:00:01.196 Audio: set_record_source ars=0 als=0 (not implemented)
00:00:01.209 ALSA: ADC frequency 44100Hz, period size 0, buffer size -1209028620
00:00:01.289 ALSA: ADC frequency 44100Hz, period size 0, buffer size -1209028620
00:00:01.411 ALSA: Failed to apply audio parameters
00:00:01.534 ALSA: Failed to apply audio parameters
00:00:01.609 ALSA: ADC frequency 44100Hz, period size 0, buffer size -1296204370
00:00:01.689 ALSA: ADC frequency 44100Hz, period size 0, buffer size -1296204370
00:00:01.749 AC97: WARNING: Unable to open PCM IN!
00:00:01.749 AC97: WARNING: Unable to open PCM MC!
00:00:01.749 AC97: WARNING: Unable to open PCM OUT!
00:00:01.749 Audio: Using NULL audio driver
00:00:01.749 Audio: set_record_source ars=0 als=0 (not implemented)
00:00:01.750 VM: Raising runtime error 'HostAudioNotResponding' (fFlags=0x0)

comment:3 in reply to: ↑ 1 Changed 3 years ago by denisq

Dmix support for the alsa backend is also my biggest feature request. However, with the trick provided above (exporting VBOX_ALSA_ADC_DEV="null") solves the issue for me.

I would therefore recommend the developers to take this workaround into consideration and to make the alsa output dmix compatible.

Replying to lex:

Can you give more detail on how to implement your suggested workaround?

I tried this:

$ export VBOX_ALSA_ADC_DEV="null" $ VirtualBox

But I still get this in my log and I get the same audio open failure:

00:00:01.195 Audio: Trying driver 'alsa'. 00:00:01.196 Audio: set_record_source ars=0 als=0 (not implemented) 00:00:01.209 ALSA: ADC frequency 44100Hz, period size 0, buffer size -1209028620 00:00:01.289 ALSA: ADC frequency 44100Hz, period size 0, buffer size -1209028620 00:00:01.411 ALSA: Failed to apply audio parameters 00:00:01.534 ALSA: Failed to apply audio parameters 00:00:01.609 ALSA: ADC frequency 44100Hz, period size 0, buffer size -1296204370 00:00:01.689 ALSA: ADC frequency 44100Hz, period size 0, buffer size -1296204370 00:00:01.749 AC97: WARNING: Unable to open PCM IN! 00:00:01.749 AC97: WARNING: Unable to open PCM MC! 00:00:01.749 AC97: WARNING: Unable to open PCM OUT! 00:00:01.749 Audio: Using NULL audio driver 00:00:01.749 Audio: set_record_source ars=0 als=0 (not implemented) 00:00:01.750 VM: Raising runtime error 'HostAudioNotResponding' (fFlags=0x0)

What am I doing wrong?

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use