Summary: | Pulseaudio doesn't work on (pro audio- non interleaved access mode) soundcards with high channel counts | ||
---|---|---|---|
Product: | PulseAudio | Reporter: | benjamin |
Component: | alsa | Assignee: | pulseaudio-bugs |
Status: | RESOLVED MOVED | QA Contact: | pulseaudio-bugs |
Severity: | normal | ||
Priority: | medium | CC: | lennart |
Version: | unspecified | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
Pulseaudio verbose log
alsa-info.sh output logging when only non-interleaved PCM available add SNDRV_PCM_INFO_BATCH when precise_ptr is not enabled attachment-5407-0.html |
Description
benjamin
2014-10-08 14:49:49 UTC
http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/src/modules/alsa/alsa-mixer.c?id=48edd0a00f455df075efcf1986103e5f507c816f do you mean multichannel profile still not fix your problem? you have to post pulseaudio verbose log, output of alsa-info.sh if tje multichannel profile still not work Created attachment 107567 [details]
Pulseaudio verbose log
Created attachment 107568 [details]
alsa-info.sh output
Hi, I only use pulseaudio 5.0 from Debian testing. If the multichannel profile has been added to the 5.0 release then I have it, otherwise I need some help on how to use it. I've attached what you asked for. I should probably add that pulseaudio itself runs fine, but doesn't give me any audio output at all, I've checked this via hdspmixer. 2014-08-23 alsa: Remove four channel input profile 2014-08-01 alsa: Add a multichannel fallback mapping 2014-08-01 alsa: Allow "fallback" configuration for mappings and profiles 2014-08-01 alsa: Add "exact-channels" mapping configurability those patches were supposed to support firewire audio which don't support mono, stereo surround40,..surround71 playback and mono,stereo4 ch capture http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-August/021037.html http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-August/021036.html you need to follow up if it still not fix your problem Hey Raymond, again, is the multichannel profile included in pulseaduio 5.0? It seems to me that these commits are more recent, and I don't build pulseaudio from source. Yes, the multichannel fix is newer than 5.0. If you feel adventurous enough to install pulseaudio from source, here are steps for installing the current git version: git clone git://anongit.freedesktop.org/pulseaudio/pulseaudio cd pulseaudio ./bootstrap.sh make sudo make install sudo ldconfig The bootstrap.sh script will probably give you all kinds of errors, if you don't have the development tools and the headers of various dependecy libraries already installed. I think debian has some tool for installing the build dependencies, which should make it pretty painless to get everything installed, something like "apt-get build-dependencies pulseaudio". I don't know the exact command, google will help you. your driver seem need to set autosync source 1992.311070] snd_hdsp 0000:04:07.0: No AutoSync source for requested rate [ 2007.259919] snd_hdsp 0000:04:07.0: No AutoSync source for requested rate [ 2029.877275] snd_hdsp 0000:04:07.0: No AutoSync source for requested rate [ 2050.904205] snd_hdsp 0000:04:07.0: No AutoSync source for requested rate [ 2072.123263] snd_hdsp 0000:04:07.0: No AutoSync source for requested rate That's true, I use an external autosync source with 44100hz, so that's the only possible rate. Alsa has no issues with this. seem no active ports/ports https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1381475/+attachment/4237185/+files/pulseverbose.log Card #3 Name: alsa_card.firewire-0x000aac0300592827 Driver: module-alsa-card.c Owner Module: 8 Properties: alsa.card = "0" alsa.card_name = "PHASE 88 Rack FW" alsa.long_card_name = "TerraTec Electronic Gmb PHASE 88 Rack FW (id:3, rev:1), GUID 000aac0300592827 a" alsa.driver_name = "snd_bebob" device.bus_path = "pci-0000:01:09.0" sysfs.path = "/devices/pci0000:00/0000:00:09.0/0000:01:09.0/fw2/fw2.0/sound/card0" udev.id = "firewire-0x000aac0300592827" device.bus = "firewire" device.vendor.name = "Texas Instruments" device.product.name = "TSB43AB22A IEEE-1394a-2000 Controller (PHY/Link) [iOHCI-Lynx]" device.string = "0" device.description = "TSB43AB22A IEEE-1394a-2000 Controller (PHY/Link) [iOHCI-Lynx]" module-udev-detect.discovered = "1" device.icon_name = "audio-card-firewire" Profiles: input:10-channels: 10 Channels Input (sinks: 0, sources: 1, priority. 10) output:10-channels: 10 Channels Output (sinks: 1, sources: 0, priority. 1000) output:10-channels+input:10-channels: 10 Channels Output + 10 Channels Input (sinks: 1, sources: 1, priority. 1010) off: Off (sinks: 0, sources: 0, priority. 0) Active Profile: output:10-channels+input:10-channels why did pulseaidio still probe channels higher than channels_max ? ( 2.896| 0.000) I: [pulseaudio] alsa-util.c: Device hw:0 doesn't support sample format s16le, changed to s32le. ( 2.909| 0.012) D: [pulseaudio] alsa-mixer.c: Profile output:10-channels+input:10-channels supported. ( 2.909| 0.000) D: [pulseaudio] alsa-mixer.c: Skipping profile output:10-channels+input:12-channels - will not be able to open input:12-channels ( 2.910| 0.000) D: [pulseaudio] alsa-mixer.c: Skipping profile output:10-channels+input:14-channels - will not be able to open input:14-channels ( 2.910| 0.000) D: [pulseaudio] alsa-mixer.c: Skipping profile output:10-channels+input:16-channels - will not be able to open input:16-channels ( 2.910| 0.000) D: [pulseaudio] alsa-mixer.c: Skipping profile output:10-channels+input:18-channels - will not be able to open input:18-channels ( 2.911| 0.000) D: [pulseaudio] alsa-mixer.c: Looking at profile output:12-channels ( 2.911| 0.000) D: [pulseaudio] alsa-mixer.c: Checking for playback on 12 Channels (12-channels) ( 2.911| 0.000) D: [pulseaudio] alsa-util.c: Trying hw:0 with SND_PCM_NO_AUTO_FORMAT ... I finally tried out the multichannel fallback patch (with the help of the Debian pulseaudio maintenance team) but it doesn't solve my problem. I have no clue why there are no active ports or why pa probes higher channels. http://colin.guthr.ie/2010/09/compiling-and-running-pulseaudio-from-git/ you can try build and run pulseaudio from git without install and post the verbose log if it still not work post the output of aplay -v --dump-hw-params -Dhw:0,0 test.wav arecord -v --dump-hw-params -Dhw:0,0 test.wav --- $ arecord -v --dump-hw-params -Dhw:0,0 test.wav Aufnahme: WAVE 'test.wav' : Unsigned 8 bit, Rate: 8000 Hz, mono HW Params of device "hw:0,0": -------------------- ACCESS: MMAP_NONINTERLEAVED RW_NONINTERLEAVED FORMAT: S32_LE SUBFORMAT: STD SAMPLE_BITS: 32 FRAME_BITS: [448 832] CHANNELS: [14 26] RATE: [32000 96000] PERIOD_TIME: (666 256000] PERIOD_SIZE: [64 8192] PERIOD_BYTES: [3584 851968] PERIODS: 2 BUFFER_TIME: (1333 512000] BUFFER_SIZE: [128 16384] BUFFER_BYTES: [7168 1703936] TICK_TIME: ALL -------------------- arecord: set_params:1228: Zugriffs-Modus nicht unterstützt -- The last message means "Access-mode not supported" --- aplay -v --dump-hw-params -Dhw:0,0 music.wav Wiedergabe: WAVE 'music.wav' : Signed 16 bit Little Endian, Rate: 44100 Hz, stereo HW Params of device "hw:0,0": -------------------- ACCESS: MMAP_NONINTERLEAVED RW_NONINTERLEAVED FORMAT: S32_LE SUBFORMAT: STD SAMPLE_BITS: 32 FRAME_BITS: [448 832] CHANNELS: [14 26] RATE: [32000 96000] PERIOD_TIME: (666 256000] PERIOD_SIZE: [64 8192] PERIOD_BYTES: [3584 851968] PERIODS: 2 BUFFER_TIME: (1333 512000] BUFFER_SIZE: [128 16384] BUFFER_BYTES: [7168 1703936] TICK_TIME: ALL -------------------- aplay: set_params:1228: Zugriffs-Modus nicht unterstützt those pa_log_debug() should be pa_log_error() to indicate both MMAP_NONINTERLEAVED RW_NONINTERLEAVED are not supported if (_use_mmap) { if (snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_MMAP_INTERLEAVED) < 0) { /* mmap() didn't work, fall back to interleaved */ if ((ret = snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) { pa_log_debug("snd_pcm_hw_params_set_access() failed: %s", pa_alsa_strerror(ret)); goto finish; } _use_mmap = false; } } else if ((ret = snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) { pa_log_debug("snd_pcm_hw_params_set_access() failed: %s", pa_alsa_strerror(ret)); goto finish; } need to test whether sound card only support non interleaved mode by using snd_pcm_hw_params_test_access instead of snd_pcm_hw_params_set_access http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=include/pcm.h;hb=HEAD /** PCM access type */ typedef enum _snd_pcm_access { /** mmap access with simple interleaved channels */ SND_PCM_ACCESS_MMAP_INTERLEAVED = 0, /** mmap access with simple non interleaved channels */ SND_PCM_ACCESS_MMAP_NONINTERLEAVED, /** mmap access with complex placement */ SND_PCM_ACCESS_MMAP_COMPLEX, /** snd_pcm_readi/snd_pcm_writei access */ SND_PCM_ACCESS_RW_INTERLEAVED, /** snd_pcm_readn/snd_pcm_writen access */ SND_PCM_ACCESS_RW_NONINTERLEAVED, SND_PCM_ACCESS_LAST = SND_PCM_ACCESS_RW_NONINTERLEAVED } snd_pcm_access_t; there are five pcm access type but pulseaudio only support two and does not report any error when the sound card does not support interleaved modes Created attachment 109516 [details] [review] logging when only non-interleaved PCM available patch which adds logging if no suitable access format found; non-interleaved PCM is still unsupported (In reply to Peter Meerwald from comment #21) > Created attachment 109516 [details] [review] [review] > logging when only non-interleaved PCM available > > patch which adds logging if no suitable access format found; non-interleaved > PCM is still unsupported did your patch really works ? if you want to test different accesses, you need to use test_access to find out whether the access is support before you use set_access which is destructive when error ocurrs try snd-dummy model=rme9652 https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/sound/drivers/dummy.c (In reply to Peter Meerwald from comment #21) > Created attachment 109516 [details] [review] [review] > logging when only non-interleaved PCM available > > patch which adds logging if no suitable access format found; non-interleaved > PCM is still unsupported this is a fatal error when the interleaced access is not supported by the alsa driver the card is unusable by pulseaudio Read / Write transfer There are two versions of read / write routines. The first expects the interleaved samples at input (SND_PCM_ACCESS_RW_INTERLEAVED access method), and the second one expects non-interleaved (samples in separated buffers - SND_PCM_ACCESS_RW_NONINTERLEAVED access method) at input. There are these functions for interleaved transfers: snd_pcm_writei() snd_pcm_readi(). For non-interleaved transfers, there are these functions: snd_pcm_writen() and snd_pcm_readn(). this mean pulseaudio still need snd_pcm_writen() and snd_pcm_readn() to support SND_PCM_ACCESS_RW_NONINTERLEAVED access method Hi benjamin, PulseAudio 6.0 has now been released and it includes the multichannel fallback, which should have solved your issue, but apparently it has not. Could you submit a new PulseAudio verbose log with PA 6.0? Thanks. Comment on attachment 109516 [details] [review] logging when only non-interleaved PCM available Review of attachment 109516 [details] [review]: ----------------------------------------------------------------- Well, that is a truth with modification, I believe - PulseAudio as a last resort tries to open plug:hw:* and that should auto-convert from noninterleaved to interleaved. So this should not be an issue. Peter, forget the last comment. I read your patch again and it looks good, so I've pushed it now. (This does not change the fact that we still need a new verbose log from Benjamin with PA 6.0.) Hi, I built PA 6 from git and got the exact same verbose output of aplay and arecord than I posted on 2014-10-27. The apps are working though - partly. Browsers and music apps like aqualung play sounds now, but there are a lot of dropouts in the sound. Sometimes, it even plays back at the wrong speed. I started PA, fired up a browser, played back the beginning of a youtube video and closed everything again: http://pastebin.com/HbRc2yQF Thanks, so in fact the card is detected now. The crackling looks like a driver problem but I'm not sure. You could try to change this line in default.pa: load-module module-udev-detect to this: load-module module-udev-detect tsched=0 ...and try again. tsched=0 !!! That seems to do the trick! Pulseaudio 6.0 is running with every app simultaneously without a glitch! I will do more testing, but it looks perfect right now! Thank you all! refer rme9652_hw_pointer() to rme9652.c if (!rme9652->precise_ptr) return (status & RME9652_buffer_id) ? period_size : 0; if precise_ptr is not enabled by module parameter, it just return pointer value as period_size or zero, this mean time scheduling should be disabled since driver can only use two periods (impossible to rewind) Created attachment 113564 [details] [review] add SNDRV_PCM_INFO_BATCH when precise_ptr is not enabled rme9652 driver need to specify SNDRV_PCM_INFO_BATCH when precise_ptr is not enabled Ok. So the "high channel count" part is fixed with 6.0. The "non interleaved access" was never a problem (emulated by alsa plug layer). Tsched=0 workarounds...should in general be fixed in ALSA rather than PulseAudio. Raymond's patch is probably correct but I'm not qualified to review it. Raymond, could you turn the patch into a proper commit (git commit -s ) and then send it upstream on the alsa-devel mailinglist (using git send-email or git format-patch)? Thanks. Hi, I'm not sure if this is 100% the same issue, but my problems started again when Debian upgraded from pulseaudio 8 to 9 recently. Even though I still use tsched=0, I hear huge amounts of clicks and pops while playing back (everything sounds like a very old vinyl recording now...). Enabling tsched makes no difference, in fact I think that it is still of even though I tried tsched=1. I'll attach the verbose log. https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=55a25246ee80aa950bf27f811c0cc176d0821a4e pulseaudio does not support non-interlaved mode static void check_access(snd_pcm_t *pcm_handle, snd_pcm_hw_params_t *hwparams, bool use_mmap) { if ((use_mmap && !snd_pcm_hw_params_test_access(pcm_handle, hwparams, SND_PCM_ACCESS_MMAP_INTERLEAVED)) || !snd_pcm_hw_params_test_access(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED)) pa_log_error("Weird, PCM claims to support interleaved access, but snd_pcm_hw_params_set_access() failed."); + Created attachment 125150 [details] attachment-5407-0.html Meaning what exactly? It worked with previous versions. And even if it doesn't work - what is the recommended step here? Remove pulseaudio? Thanks & best regards Benjamin Am 19. Juli 2016 16:09:10 MESZ, schrieb bugzilla-daemon@freedesktop.org: >https://bugs.freedesktop.org/show_bug.cgi?id=84804 > >--- Comment #37 from Raymond <superquad.vortex2@gmail.com> --- >https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=55a25246ee80aa950bf27f811c0cc176d0821a4e > > >pulseaudio does not support non-interlaved mode > > >static void check_access(snd_pcm_t *pcm_handle, snd_pcm_hw_params_t >*hwparams, >bool use_mmap) { > if ((use_mmap && !snd_pcm_hw_params_test_access(pcm_handle, hwparams, >SND_PCM_ACCESS_MMAP_INTERLEAVED)) || > !snd_pcm_hw_params_test_access(pcm_handle, hwparams, >SND_PCM_ACCESS_RW_INTERLEAVED)) > pa_log_error("Weird, PCM claims to support interleaved access, but >snd_pcm_hw_params_set_access() failed."); >+ > >-- >You are receiving this mail because: >You reported the bug. The log shows that you're not using module-udev-detect. I don't know if that's why things stopped working, but that would anyway be the first thing to fix. Debian changed the packaging so that "pulseaudio-module-udev" is now a separate package. You have probably disabled automatic installation of recommended packages, because by default that package should get installed automatically. https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/sound/pci/rme9652/hdsp.c static struct snd_pcm_hardware snd_hdsp_capture_subinfo = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_NONINTERLEAVED | SNDRV_PCM_INFO_SYNC_START), #ifdef SNDRV_BIG_ENDIAN .formats = SNDRV_PCM_FMTBIT_S32_BE, #else .formats = SNDRV_PCM_FMTBIT_S32_LE, #endif .rates = (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_64000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000), .rate_min = 32000, .rate_max = 96000, .channels_min = 5, .channels_max = HDSP_MAX_CHANNELS, .buffer_bytes_max = HDSP_CHANNEL_BUFFER_BYTES * HDSP_MAX_CHANNELS, .period_bytes_min = (64 * 4) * 10, .period_bytes_max = (8192 * 4) * HDSP_MAX_CHANNELS, .periods_min = 2, .periods_max = 2, .fifo_size = 0 }; only support 2 periods and non-interleaved access mode pulseaudio cannot use 4 fragments this mean one period of channel 1 , follow by one period of channel 2 ,..., one period of channel n seem has flag to control the precision of hw pointer static snd_pcm_uframes_t hdsp_hw_pointer(struct hdsp *hdsp) { int position; position = hdsp_read(hdsp, HDSP_statusRegister); if (!hdsp->precise_ptr) return (position & HDSP_BufferID) ? (hdsp->period_bytes / 4) : 0; position &= HDSP_BufferPositionMask; position /= 4; position &= (hdsp->period_bytes/2) - 1; return position; } (In reply to Tanu Kaskinen from comment #39) > The log shows that you're not using module-udev-detect. I don't know if > that's why things stopped working, but that would anyway be the first thing > to fix. Debian changed the packaging so that "pulseaudio-module-udev" is now > a separate package. You have probably disabled automatic installation of > recommended packages, because by default that package should get installed > automatically. Thanks a lot! My system really didn't install module-udev-detect (package pulseaudio-module-udev in debian stretch/testing). Now it works again! -- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/457. |
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.