Summary: | Pulseaudio doesn't list all devices profiles that are listed by alsa | ||
---|---|---|---|
Product: | PulseAudio | Reporter: | Stéphane <mathojojo> |
Component: | alsa | Assignee: | pulseaudio-bugs |
Status: | RESOLVED NOTABUG | QA Contact: | pulseaudio-bugs |
Severity: | major | ||
Priority: | medium | CC: | lennart |
Version: | unspecified | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | picture of alsa available profiles in deadbeef |
Description
Stéphane
2017-07-27 08:07:14 UTC
Does "pasuspender -- speaker-test -Dfront:Ultra --channels=2" produce noise? pasuspender will make pulseaudio not access the alsa devices while speaker-test runs, and speaker-test plays noise to each channel (in this case two channels) in turn. Since pulseaudio doesn't offer a stereo profile, I suspect that the "front" alsa device doesn't work at all. Created attachment 133084 [details]
picture of alsa available profiles in deadbeef
(In reply to Tanu Kaskinen from comment #1) > Does "pasuspender -- speaker-test -Dfront:Ultra --channels=2" produce noise? > > pasuspender will make pulseaudio not access the alsa devices while > speaker-test runs, and speaker-test plays noise to each channel (in this > case two channels) in turn. Since pulseaudio doesn't offer a stereo profile, > I suspect that the "front" alsa device doesn't work at all. Thank you for your help. Your command line doesn't work for me. It says : "The Read device is front:Ultra The Streams are set to 48000Hz, S16_LE, 2 channels Using 16 octaves of 'pink noise' The sample format is unavailable for playback : invalid argument Failed to set device parameters : invalid argument" In another hand, I'm used to listen to music with Deadbeef because this player allow me to select ALSA driver (and avoid Pulseaudio when I don't want any resampling and quality discrease). And there, I can select my front:ultra profile (see picture attachment), and it works very well. The same for squeezelite player, I set it to use the front:Ultra profile, without any problem. That's why I think the Front:Ultra profile exists and worksn but I don't know why your command fails, and why pulseaudio doesn't make it available. (Another think I remember to add : In the past (maybe 3 years ago, maybe Ubuntu 14.04, but >I can't be sure now), all profiles were listed with the same Fasttrack Ultra soundcard, and it worked fine. SO.. something changed, but what ?) (In reply to Stéphane from comment #3) > The sample format is unavailable for playback : invalid argument It looks like the S16_LE format is not supported by the card. Maybe PulseAudio is failing due to wrong format too? I would expect PulseAudio to switch to the correct format automatically, but maybe PA is not as smart as I think. What does "aplay -Dfront:Ultra -f cd /dev/zero" print? I expect it to fail due to an unavailable format, and list the formats that are available. > It looks like the S16_LE format is not supported by the card. Maybe
> PulseAudio is failing due to wrong format too? I would expect PulseAudio to
> switch to the correct format automatically, but maybe PA is not as smart as
> I think.
>
> What does "aplay -Dfront:Ultra -f cd /dev/zero" print? I expect it to fail
> due to an unavailable format, and list the formats that are available.
aplay -Dfront:Ultra -f cd /dev/zero
Lecture données brutes '/dev/zero' : Signed 16 bit Little Endian, Fréquence 44100 Hz, Stéréo
aplay: set_params:1233: Ce format d'échantillonage n'est pas disponible
Available formats:
- S24_3LE
Testing with :
"aplay -Dfront:Ultra -f S24_3LE -c7 -r48000 /dev/zero"
Lecture données brutes '/dev/zero' : Signed 24 bit Little Endian in 3bytes, Fréquence 48000 Hz, 7 Canaux
aplay: set_params:1239: Nombre de canaux non disponible
(the last line mean : Number of channels unavailable)
AND
Testing with :
"aplay -Dsurround71:Ultra -f S24_3LE -c7 -r48000 /dev/zero"
Lecture données brutes '/dev/zero' : Signed 24 bit Little Endian in 3bytes, Fréquence 48000 Hz, 7 Canaux
No error in this case.
So the problem might come from an undefined number of channels for all profiles, but surround71.
Is it possible to change that ? where ? (Pulseaudio, alsa, alsa driver snd-audio-usb ???).
I have the feeling the problem could be easy to resolve, but I may be wrong :).
Anyway, thank you for the help.
I did a little mistake : Testing with : "aplay -Dfront:Ultra -f S24_3LE -c7 -r48000 /dev/zero" Lecture données brutes '/dev/zero' : Signed 24 bit Little Endian in 3bytes, Fréquence 48000 Hz, 7 Canaux aplay: set_params:1239: Nombre de canaux non disponible I replace 7 channels with 2 channels (better for stereo profile): Testing with : "aplay -Dfront:Ultra -f S24_3LE -c2 -r48000 /dev/zero" Lecture données brutes '/dev/zero' : Signed 24 bit Little Endian in 3bytes, Fréquence 48000 Hz, 2 Canaux aplay: set_params:1239: Nombre de canaux non disponible But the result is the same : Number of channels unavailable. "front" is supposed to be a two-channel device, so either the driver is buggy when it rejects the configuration, or the alsa userspace configuration (that contains the "front" device definition) is buggy by claiming that the "front" device exists for this card. The remaining mystery is how does deadbeef work? Can you play something with deadbeef using the "front" device, and during playback run this command: cat /proc/asound/card*/pcm0p/sub0/hw_params The asterisk is there because I don't know the card index. You can replace it with the correct index, but it doesn't matter much if you just use the asterisk. If all other sound cards are not being used, there will just be one or more lines saying "closed". So, your command : cat /proc/asound/card*/pcm0p/sub0/hw_params The output when selecting Front Speakers: access: RW_INTERLEAVED format: S24_3LE subformat: STD channels: 8 rate: 96000 (96000/1) period_size: 1024 buffer_size: 8192 The output when selecting Surround71: access: MMAP_INTERLEAVED format: S24_3LE subformat: STD channels: 8 rate: 96000 (96000/1) period_size: 1024 buffer_size: 8192 The only difference is with the access output (RW vs MMAP). I don't know what it means. And the channels output is always 8. Weird for the front speaker profile, no ? (I talked about deadbeef as an example, but I also use squeezelite which can use alsa drivers directly without pulseausio as well. and it works too) And the sound is fine in both case. Ok, so deadbeef automatically falls back to using 8 channels when 2 channels doesn't work. I'll close this as a NOTABUG. If you want, you can report a bug to the alsa developers about the "front" device being present even though it doesn't work (working with 8 channels doesn't count, because the definition of the "front" device is that it's a stereo device). http://alsa-project.org/main/index.php/Bug_Tracking You can create a stereo sink in pulseaudio by loading module-remap-sink: pactl load-module module-remap-sink sink_name=my_stereo_sink master=MASTER_SINK_NAME channels=2 master_channel_map=front-left,front-right channel_map=front-left,front-right remix=no Replace MASTER_SINK_NAME with the real name of the master sink. You can put the load-module command in /etc/pulse/default.pa if you have the sound card always plugged in. If it's sometimes unplugged, you need to load the module manually, because pulseaudio doesn't currently provide a mechanism to automatically set up the remap sink when the USB sound card appears. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.