[pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry
Hello, I'm not entirely sure about if pulseaudio is the culprit here, but I'm out of ideas and need some advise. Connecting _the_same_usb _sound_card_ to my laptop or to the raspberry makes pulseaudio detect different rate capabilities. Unfortunatelly the raspberry detects the wrong rate (48000) so it forces samplerate conversion for 44100 streams. It doesn't matter the parameter that I change (default-sample-rate, rate=), pulseaudio always detect the wrong rate. Other applications on raspberry like mpd (alsa output) have not problem using 44100. Linux macbook 3.17.1-gentoo-r1-macbook4,1 #1 SMP PREEMPT Fri Oct 17 17:29:07 CEST 2014 x86_64 Intel(R) Core(TM)2 Duo CPU T8300 @ 2.40GHz GenuineIntel GNU/Linux [...] I: [pulseaudio] sink.c: Created sink 1 "alsa_output.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00-CODEC.analog-stereo" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right Linux rpi 3.12.29+ #714 PREEMPT Wed Oct 1 23:11:38 BST 2014 armv6l GNU/Linux [...] I: [pulseaudio] sink.c: Created sink 0 "alsa_output.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00-CODEC.analog-stereo" with sample spec s16le 2ch 48000Hz and channel map front-left,front-right any clue where can be the problem? full trace laptop and raspberry: user001@macbook ~ $ pulseaudio -v I: [pulseaudio] main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted I: [pulseaudio] main.c: setrlimit(RLIMIT_RTPRIO, (9, 9)) failed: Operation not permitted I: [pulseaudio] core-util.c: Failed to acquire high-priority scheduling: No such file or directory I: [pulseaudio] main.c: This is PulseAudio 5.0 I: [pulseaudio] main.c: Page size is 4096 bytes I: [pulseaudio] main.c: Machine ID is 7d6eea8ee7748e57e70771c7521539b8. I: [pulseaudio] main.c: Session ID is 3. I: [pulseaudio] main.c: Using runtime directory /run/user/1001/pulse. I: [pulseaudio] main.c: Using state directory /home/users/user001/.pulse. I: [pulseaudio] main.c: Using modules directory /usr/lib64/pulse-5.0/modules. I: [pulseaudio] main.c: Running in system mode: no I: [pulseaudio] main.c: Fresh high-resolution timers available! Bon appetit! I: [pulseaudio] cpu-x86.c: CPU flags: CMOV MMX SSE SSE2 SSE3 SSSE3 SSE4_1 I: [pulseaudio] svolume_mmx.c: Initialising MMX optimized volume functions. I: [pulseaudio] remap_mmx.c: Initialising MMX optimized remappers. I: [pulseaudio] svolume_sse.c: Initialising SSE2 optimized volume functions. I: [pulseaudio] remap_sse.c: Initialising SSE2 optimized remappers. I: [pulseaudio] sconv_sse.c: Initialising SSE2 optimized conversions. I: [pulseaudio] svolume_orc.c: Initialising ORC optimized volume functions. I: [pulseaudio] module-device-restore.c: Successfully opened database file '/home/users/user001/.pulse/7d6eea8ee7748e57e70771c7521539b8-device-volumes'. I: [pulseaudio] module.c: Loaded "module-device-restore" (index: #0; argument: ""). I: [pulseaudio] module-stream-restore.c: Successfully opened database file '/home/users/user001/.pulse/7d6eea8ee7748e57e70771c7521539b8-stream-volumes'. I: [pulseaudio] module.c: Loaded "module-stream-restore" (index: #1; argument: ""). I: [pulseaudio] module-card-restore.c: Successfully opened database file '/home/users/user001/.pulse/7d6eea8ee7748e57e70771c7521539b8-card-database'. I: [pulseaudio] module.c: Loaded "module-card-restore" (index: #2; argument: ""). I: [pulseaudio] module.c: Loaded "module-augment-properties" (index: #3; argument: ""). I: [pulseaudio] module.c: Loaded "module-switch-on-port-available" (index: #4; argument: ""). I: [pulseaudio] utils.c: could not open configuration file /usr/share/alsa/ucm/HDA Intel/HDA Intel.conf I: [pulseaudio] parser.c: error: could not parse configuration for card HDA Intel I: [pulseaudio] main.c: error: failed to import HDA Intel use case configuration -2 I: [pulseaudio] alsa-ucm.c: UCM not available for card HDA Intel I: [pulseaudio] alsa-util.c: Failed to set hardware parameters on plug:hw:0: Invalid argument I: [pulseaudio] control.c: Invalid CTL front:0 I: [pulseaudio] alsa-util.c: Unable to attach to mixer front:0: No such file or directory I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0' I: [pulseaudio] control.c: Invalid CTL iec958:0 I: [pulseaudio] alsa-util.c: Unable to attach to mixer iec958:0: No such file or directory I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0' I: [pulseaudio] alsa-util.c: Failed to set hardware parameters on plug:hw:0: Invalid argument I: [pulseaudio] control.c: Invalid CTL front:0 I: [pulseaudio] alsa-util.c: Unable to attach to mixer front:0: No such file or directory I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0' I: [pulseaudio] control.c: Invalid CTL surround40:0 I: [pulseaudio] alsa-util.c: Unable to attach to mixer surround40:0: No such file or directory I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0' I: [pulseaudio] pcm_params.c: Slave PCM not usable I: [pulseaudio] pcm_params.c: Slave PC
Re: [pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry
> > Hello, > > I'm not entirely sure about if pulseaudio is the culprit here, but I'm out of ideas and need some advise. > > Connecting _the_same_usb _sound_card_ to my laptop or to the raspberry makes pulseaudio detect different rate capabilities. Unfortunatelly the raspberry detects the wrong rate (48000) so it forces samplerate conversion for 44100 streams. It doesn't matter the parameter that I change (default-sample-rate, rate=), pulseaudio always detect the wrong rate. > > Other applications on raspberry like mpd (alsa output) have not problem using 44100. > > Linux macbook 3.17.1-gentoo-r1-macbook4,1 #1 SMP PREEMPT Fri Oct 17 17:29:07 CEST 2014 x86_64 Intel(R) Core(TM)2 Duo CPU T8300 @ 2.40GHz GenuineIntel GNU/Linux > [...] > I: [pulseaudio] sink.c: Created sink 1 "alsa_output.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00-CODEC.analog-stereo" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right > > > Linux rpi 3.12.29+ #714 PREEMPT Wed Oct 1 23:11:38 BST 2014 armv6l GNU/Linux > [...] > I: [pulseaudio] sink.c: Created sink 0 "alsa_output.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00-CODEC.analog-stereo" with sample spec s16le 2ch 48000Hz and channel map front-left,front-right > > > any clue where can be the problem? Post the output of lsusb - You can find the supported rates in those usb descriptors of your usb audio ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry
Hi all, the usb card have hardware support for 32000, 44100 and 48000 samplerates: root@rpi:~# cat /proc/asound/card1/stream0 Burr-Brown from TI USB Audio CODEC at usb-bcm2708_usb-1.2, full speed : USB Audio Playback: Status: Stop Interface 1 Altset 1 Format: S16_LE Channels: 2 Endpoint: 2 OUT (ADAPTIVE) Rates: 32000, 44100, 48000 [...] (full trace below) root@rpi:~# lsusb -v -s 1:14 Bus 002 Device 004: ID 08bb:2902 Texas Instruments PCM2902 Audio Codec [...] AudioStreaming Interface Descriptor: bLength17 bDescriptorType36 bDescriptorSubtype 2 (FORMAT_TYPE) bFormatType 1 (FORMAT_TYPE_I) bNrChannels 2 bSubframeSize 2 bBitResolution 16 bSamFreqType3 Discrete tSamFreq[ 0]32000 tSamFreq[ 1]44100 tSamFreq[ 2]48000 and other aplications like the music player daemon, with alsa output, have not problem using 44100 samplerate, pulseaudio output is a cpu hog because the innecesary sample rate conversion, music is 44100 so pulseaudio 48000 detection triggers resampling. my doubt is that makes pulseadio detect 48000 in the raspberry and 44100 in the laptop when I am using the same usb sound card in both cases ¿? any clues? Full trace of lsusb... # lsusb -v -s 1:14 Bus 002 Device 004: ID 08bb:2902 Texas Instruments PCM2902 Audio Codec Device Descriptor: bLength18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x08bb Texas Instruments idProduct 0x2902 PCM2902 Audio Codec bcdDevice1.00 iManufacturer 1 Burr-Brown from TI iProduct2 USB Audio CODEC iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 1191 bNumInterfaces 4 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 100mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber0 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 1 Audio bInterfaceSubClass 1 Control Device bInterfaceProtocol 0 iInterface 0 AudioControl Interface Descriptor: bLength10 bDescriptorType36 bDescriptorSubtype 1 (HEADER) bcdADC 1.00 wTotalLength 62 bInCollection 2 baInterfaceNr( 0) 1 baInterfaceNr( 1) 2 AudioControl Interface Descriptor: bLength12 bDescriptorType36 bDescriptorSubtype 2 (INPUT_TERMINAL) bTerminalID 1 wTerminalType 0x0101 USB Streaming bAssocTerminal 0 bNrChannels 2 wChannelConfig 0x0003 Left Front (L) Right Front (R) iChannelNames 0 iTerminal 0 AudioControl Interface Descriptor: bLength 9 bDescriptorType36 bDescriptorSubtype 3 (OUTPUT_TERMINAL) bTerminalID 2 wTerminalType 0x0301 Speaker bAssocTerminal 0 bSourceID 3 iTerminal 0 AudioControl Interface Descriptor: bLength10 bDescriptorType36 bDescriptorSubtype 6 (FEATURE_UNIT) bUnitID 3 bSourceID 1 bControlSize1 bmaControls( 0) 0x01 Mute Control bmaControls( 1) 0x02 Volume Control bmaControls( 2) 0x02 Volume Control iFeature0 AudioControl Interface Descriptor: bLength12 bDescriptorType36 bDescriptorSubtype 2 (INPUT_TERMINAL) bTerminalID 4 wTerminalType 0x0201 Microphone bAssocTerminal 0 bNrChannels 2 wChannelConfig 0x0003 Left Front (L) Right Front (R) iChannelNames 0 iTerminal 0 AudioControl Interface Descriptor: bLength 9 bDescriptorType36 bDescriptorSubtype 3 (OUTPUT_TERMINAL) bTerminalID 5 wTerminalType 0x0101 USB Streaming bAssocTerminal 0 bSourceID
Re: [pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry
I had to put something like pcm.!default { type hw card 0 } in my /etc/asound.conf in order to get a default rate of 44100. Laurentiu On Thu, Oct 23, 2014, at 11:25, mailing lists wrote: > Hi all, > > the usb card have hardware support for 32000, 44100 and 48000 > samplerates: > > root@rpi:~# cat /proc/asound/card1/stream0 > Burr-Brown from TI USB Audio CODEC at usb-bcm2708_usb-1.2, full speed : > USB Audio > > Playback: > Status: Stop > Interface 1 > Altset 1 > Format: S16_LE > Channels: 2 > Endpoint: 2 OUT (ADAPTIVE) > Rates: 32000, 44100, 48000 > [...] > > (full trace below) > root@rpi:~# lsusb -v -s 1:14 > Bus 002 Device 004: ID 08bb:2902 Texas Instruments PCM2902 Audio Codec > [...] > AudioStreaming Interface Descriptor: > bLength17 > bDescriptorType36 > bDescriptorSubtype 2 (FORMAT_TYPE) > bFormatType 1 (FORMAT_TYPE_I) > bNrChannels 2 > bSubframeSize 2 > bBitResolution 16 > bSamFreqType3 Discrete > tSamFreq[ 0]32000 > tSamFreq[ 1]44100 > tSamFreq[ 2]48000 > > > and other aplications like the music player daemon, with alsa output, > have not problem using 44100 samplerate, pulseaudio output is a cpu hog > because the innecesary sample rate conversion, music is 44100 so > pulseaudio 48000 detection triggers resampling. > > my doubt is that makes pulseadio detect 48000 in the raspberry and 44100 > in the laptop when I am using the same usb sound card in both cases ¿? > > any clues? > > > Full trace of lsusb... > # lsusb -v -s 1:14 > Bus 002 Device 004: ID 08bb:2902 Texas Instruments PCM2902 Audio Codec > Device Descriptor: > bLength18 > bDescriptorType 1 > bcdUSB 1.10 > bDeviceClass0 (Defined at Interface level) > bDeviceSubClass 0 > bDeviceProtocol 0 > bMaxPacketSize0 8 > idVendor 0x08bb Texas Instruments > idProduct 0x2902 PCM2902 Audio Codec > bcdDevice1.00 > iManufacturer 1 Burr-Brown from TI > iProduct2 USB Audio CODEC > iSerial 0 > bNumConfigurations 1 > Configuration Descriptor: > bLength 9 > bDescriptorType 2 > wTotalLength 1191 > bNumInterfaces 4 > bConfigurationValue 1 > iConfiguration 0 > bmAttributes 0x80 > (Bus Powered) > MaxPower 100mA > Interface Descriptor: > bLength 9 > bDescriptorType 4 > bInterfaceNumber0 > bAlternateSetting 0 > bNumEndpoints 0 > bInterfaceClass 1 Audio > bInterfaceSubClass 1 Control Device > bInterfaceProtocol 0 > iInterface 0 > AudioControl Interface Descriptor: > bLength10 > bDescriptorType36 > bDescriptorSubtype 1 (HEADER) > bcdADC 1.00 > wTotalLength 62 > bInCollection 2 > baInterfaceNr( 0) 1 > baInterfaceNr( 1) 2 > AudioControl Interface Descriptor: > bLength12 > bDescriptorType36 > bDescriptorSubtype 2 (INPUT_TERMINAL) > bTerminalID 1 > wTerminalType 0x0101 USB Streaming > bAssocTerminal 0 > bNrChannels 2 > wChannelConfig 0x0003 > Left Front (L) > Right Front (R) > iChannelNames 0 > iTerminal 0 > AudioControl Interface Descriptor: > bLength 9 > bDescriptorType36 > bDescriptorSubtype 3 (OUTPUT_TERMINAL) > bTerminalID 2 > wTerminalType 0x0301 Speaker > bAssocTerminal 0 > bSourceID 3 > iTerminal 0 > AudioControl Interface Descriptor: > bLength10 > bDescriptorType36 > bDescriptorSubtype 6 (FEATURE_UNIT) > bUnitID 3 > bSourceID 1 > bControlSize1 > bmaControls( 0) 0x01 > Mute Control > bmaControls( 1) 0x02 > Volume Control > bmaControls( 2) 0x02 > Volume Control > iFeature0 > AudioControl Interface Descriptor: > bLength12 > bDescriptorType36 > bDescriptorSubtype 2 (INPUT_TERMINAL) > bTerminalID 4 > wTerminalType 0x0201 Microphone > bAssocTerminal 0 >
Re: [pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry
> I had to put something like > > pcm.!default { > type hw > card 0 > } > > in my /etc/asound.conf in order to get a default rate of 44100. > > Laurentiu it doesn't make any difference, the core problem is that pulseaudio detects diferent capabilities on diferent architectures with the same sound card, as it is shown in the following example: I: [pulseaudio] alsa-util.c: Device front:0 doesn't support 44100 Hz, changed to 48000 Hz. this message doesn't appears when the card is plugged to my laptop. Unfortunately I lack the knowledge to debug this discrepancy :-( Thank you anyway. ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry
> > Hi all, > > the usb card have hardware support for 32000, 44100 and 48000 samplerates: > > root@rpi:~# cat /proc/asound/card1/stream0 > Burr-Brown from TI USB Audio CODEC at usb-bcm2708_usb-1.2, full speed : USB Audio > > Playback: > Status: Stop > Interface 1 > Altset 1 > Format: S16_LE > Channels: 2 > Endpoint: 2 OUT (ADAPTIVE) > Rates: 32000, 44100, 48000 > [...] Your usb audio seem support mono, stereo, 8 bits and 16 bits and some endpoint support 8000,11025,16000,22025Hz Seem like driver bug if you can only use 32000 44100 and 48000Hz > > (full trace below) > root@rpi:~# lsusb -v -s 1:14 > Bus 002 Device 004: ID 08bb:2902 Texas Instruments PCM2902 Audio Codec 1 Audio > bInterfaceSubClass 2 Streaming > bInterfaceProtocol 0 > iInterface 0 > 1 Audio > bInterfaceSubClass 2 Streaming > bInterfaceProtocol 0 > iInterface 0 > AudioStreaming Interface Descriptor: > bLength 7 > bDescriptorType36 > bDescriptorSubtype 1 (AS_GENERAL) > bTerminalLink 5 > bDelay 0 frames > wFormatTag 1 PCM > AudioStreaming Interface Descriptor: > bLength11 > bDescriptorType36 > bDescriptorSubtype 2 (FORMAT_TYPE) > bFormatType 1 (FORMAT_TYPE_I) > bNrChannels 1 > bSubframeSize 2 > bBitResolution 16 > bSamFreqType1 Discrete > tSamFreq[ 0]22050 > Endpoint Descriptor: > bLength 9 > bDescriptorType 5 > bEndpointAddress 0x84 EP 4 IN > bmAttributes5 > Transfer TypeIsochronous > Synch Type Asynchronous > Usage Type Data > wMaxPacketSize 0x002e 1x 46 bytes > bInterval 1 > bRefresh0 > bSynchAddress 0 > AudioControl Endpoint Descriptor: > bLength 7 > bDescriptorType37 > bDescriptorSubtype 1 (EP_GENERAL) > bmAttributes 0x00 > bLockDelayUnits 2 Decoded PCM samples > wLockDelay 0 Decoded PCM samples > Interface Descriptor: > bLength 9 > bDescriptorType 4 > bInterfaceNumber2 > bAlternateSetting 9 > bNumEndpoints 1 > bInterfaceClass 1 Audio > bInterfaceSubClass 2 Streaming > bInterfaceProtocol 0 > iInterface 0 > AudioStreaming Interface Descriptor: > bLength 7 > bDescriptorType36 > bDescriptorSubtype 1 (AS_GENERAL) > bTerminalLink 5 > bDelay 0 frames > wFormatTag 1 PCM > AudioStreaming Interface Descriptor: > bLength11 > bDescriptorType36 > bDescriptorSubtype 2 (FORMAT_TYPE) > bFormatType 1 (FORMAT_TYPE_I) > bNrChannels 2 > bSubframeSize 2 > bBitResolution 16 > bSamFreqType1 Discrete > tSamFreq[ 0]16000 > Endpoint Descriptor: > bLength 9 > bDescriptorType 5 > bEndpointAddress 0x84 EP 4 IN > bmAttributes5 > Transfer TypeIsochronous > Synch Type Asynchronous > Usage Type Data > wMaxPacketSize 0x0044 1x 68 bytes > bInterval 1 > bRefresh0 > bSynchAddress 0 > AudioControl Endpoint Descriptor: > bLength 7 > bDescriptorType37 > bDescriptorSubtype 1 (EP_GENERAL) > bmAttributes 0x00 > bLockDelayUnits 2 Decoded PCM samples > wLockDelay 0 Decoded PCM samples > Interface Descriptor: > bLength 9 > bDescriptorType 4 > bInterfaceNumber2 > bAlternateSetting 10 > bNumEndpoints 1 > bInterfaceClass 1 Audio > bInterfaceSubClass 2 Streaming > bInterfaceProtocol 0 > iInterface 0 > AudioStreaming Interface Descriptor: > bLength 7 > bDescriptorType36 > bDescriptorSubtype 1 (AS_GENERAL) > bTerminalLink 5 > bDelay 0 frames > wFormatTag 1 PCM > AudioStreaming Interface Descriptor: > bLen
Re: [pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry
>Your usb audio seem support mono, stereo, 8 bits and 16 bits > >and some endpoint support 8000,11025,16000,22025Hz > >Seem like driver bug if you can only use 32000 44100 and 48000Hz The 8000, 11025, 16000 and 22050 values are capture samplerates (see below /proc/asound/card1/stream0 output), for playback the card support 32000, 44100, 48000. my laptop is running kernel 3.17.1 and the raspberry kernel 3.12.29, which are less than a year apart and both reports the same capabilities, so why PA 5 detects different samplerates? I even run PA as root to discard file permissions problems but the result is the same. As I said I'm out of ideas, but it seems a problem with PA, is there anything that I can do to find the cause? $ cat /proc/asound/card1/stream0 Burr-Brown from TI USB Audio CODEC at usb-:00:1d.0-2, full speed : USB Audio Playback: Status: Stop Interface 1 Altset 1 Format: S16_LE Channels: 2 Endpoint: 2 OUT (ADAPTIVE) Rates: 32000, 44100, 48000 Interface 1 Altset 2 Format: S16_LE Channels: 1 Endpoint: 2 OUT (ADAPTIVE) Rates: 32000, 44100, 48000 Interface 1 Altset 3 Format: S8 Channels: 2 Endpoint: 2 OUT (ADAPTIVE) Rates: 32000, 44100, 48000 Interface 1 Altset 4 Format: S8 Channels: 1 Endpoint: 2 OUT (ADAPTIVE) Rates: 32000, 44100, 48000 Interface 1 Altset 5 Format: U8 Channels: 2 Endpoint: 2 OUT (ADAPTIVE) Rates: 32000, 44100, 48000 Interface 1 Altset 6 Format: U8 Channels: 1 Endpoint: 2 OUT (ADAPTIVE) Rates: 32000, 44100, 48000 Capture: Status: Stop Interface 2 Altset 1 Format: S16_LE Channels: 2 Endpoint: 4 IN (ASYNC) Rates: 48000 Interface 2 Altset 2 Format: S16_LE Channels: 1 Endpoint: 4 IN (ASYNC) Rates: 48000 Interface 2 Altset 3 Format: S16_LE Channels: 2 Endpoint: 4 IN (ASYNC) Rates: 44100 Interface 2 Altset 4 Format: S16_LE Channels: 1 Endpoint: 4 IN (ASYNC) Rates: 44100 Interface 2 Altset 5 Format: S16_LE Channels: 2 Endpoint: 4 IN (ASYNC) Rates: 32000 Interface 2 Altset 6 Format: S16_LE Channels: 1 Endpoint: 4 IN (ASYNC) Rates: 32000 Interface 2 Altset 7 Format: S16_LE Channels: 2 Endpoint: 4 IN (ASYNC) Rates: 22050 Interface 2 Altset 8 Format: S16_LE Channels: 1 Endpoint: 4 IN (ASYNC) Rates: 22050 Interface 2 Altset 9 Format: S16_LE Channels: 2 Endpoint: 4 IN (ASYNC) Rates: 16000 Interface 2 Altset 10 Format: S16_LE Channels: 1 Endpoint: 4 IN (ASYNC) Rates: 16000 Interface 2 Altset 11 Format: S8 Channels: 2 Endpoint: 4 IN (ASYNC) Rates: 16000 Interface 2 Altset 12 Format: S8 Channels: 1 Endpoint: 4 IN (ASYNC) Rates: 16000 Interface 2 Altset 13 Format: S8 Channels: 2 Endpoint: 4 IN (ASYNC) Rates: 8000 Interface 2 Altset 14 Format: S8 Channels: 1 Endpoint: 4 IN (ASYNC) Rates: 8000 Interface 2 Altset 15 Format: S16_LE Channels: 2 Endpoint: 4 IN (SYNC) Rates: 11025 Interface 2 Altset 16 Format: S16_LE Channels: 1 Endpoint: 4 IN (SYNC) Rates: 11025 Interface 2 Altset 17 Format: S8 Channels: 2 Endpoint: 4 IN (SYNC) Rates: 11025 Interface 2 Altset 18 Format: S8 Channels: 1 Endpoint: 4 IN (SYNC) Rates: 11025 ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry
On Tue, 2014-10-28 at 10:42 +, mailing lists wrote: > >Your usb audio seem support mono, stereo, 8 bits and 16 bits > > > >and some endpoint support 8000,11025,16000,22025Hz > > > >Seem like driver bug if you can only use 32000 44100 and 48000Hz > > The 8000, 11025, 16000 and 22050 values are capture samplerates (see > below /proc/asound/card1/stream0 output), for playback the card > support 32000, 44100, 48000. > > my laptop is running kernel 3.17.1 and the raspberry kernel 3.12.29, > which are less than a year apart and both reports the same > capabilities, so why PA 5 detects different samplerates? I even run PA > as root to discard file permissions problems but the result is the > same. > > As I said I'm out of ideas, but it seems a problem with PA, is there > anything that I can do to find the cause? I'm not sure if you mentioned this already before (sorry for not bothering to check), but is the PA version the same between the machines? If not, then something may have been fixed in PA, but in any case it seems more likely to me that there was some change in the kernel driver or alsa-lib that fixed the issue that makes PulseAudio conclude that the sound card doesn't support 44100 Hz. -- Tanu ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry
Hello Tanu, > I'm not sure if you mentioned this already before (sorry for not > bothering to check), but is the PA version the same between the > machines? If not, then something may have been fixed in PA, but in any > case it seems more likely to me that there was some change in the kernel > driver or alsa-lib that fixed the issue that makes PulseAudio conclude > that the sound card doesn't support 44100 Hz. raspbian comes with PA 2, but I did compiled PA 5, just to discard this type of problems, you can see the output here and yes both test are with PA 5: http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-October/022015.html I don't think there is a kernel driver or alsa-lib bug because other software like the Music Player Daemon haven't problem using the alsa device with only 10% of cpu usage (mp3 decoding), but with mpd Pulseaudio output or any other program (local or remote) cpu is 100% ... you known music is 44100 and PA detects a 48000 sound card so it needs resampling. That I don't understand is how PA determines sound card capabilities any clue? ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry
28.10.2014 16:39, mailing lists wrote: Hello Tanu, I'm not sure if you mentioned this already before (sorry for not bothering to check), but is the PA version the same between the machines? If not, then something may have been fixed in PA, but in any case it seems more likely to me that there was some change in the kernel driver or alsa-lib that fixed the issue that makes PulseAudio conclude that the sound card doesn't support 44100 Hz. raspbian comes with PA 2, but I did compiled PA 5, just to discard this type of problems, you can see the output here and yes both test are with PA 5: http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-October/022015.html I don't think there is a kernel driver or alsa-lib bug because other software like the Music Player Daemon haven't problem using the alsa device with only 10% of cpu usage (mp3 decoding), but with mpd Pulseaudio output or any other program (local or remote) cpu is 100% ... you known music is 44100 and PA detects a 48000 sound card so it needs resampling. That I don't understand is how PA determines sound card capabilities The theory is very simple. It probes at startup whether the configured sample rate and the alternate sample rate (both can be seen in /etc/pulse/daemon.conf) are supported. If none is supported, PulseAudio picks a somewhat-random rate that is supported by the card. The result of this step is either one or two rates that are known to be supported. So, the first step in debugging should be to see whether daemon.conf files are identical. When a new stream appears, PulseAudio attempts to open the sound device (sink) and chooses a sample rate. Of course, if either the device or its monitor is already used, then the sample rate cannot be changed, end of story. If the device is not already open, then PulseAudio tries to make sure that the resampler has less work to do. Namely, if both the stream and one of the two detected known-supported rates are from the "divisible by 11025 Hz" family, this kind of rate is used (i.e. if 44100 Hz is supported, then a 22050 Hz stream would be resampled to 44100 Hz, even if 48000 Hz is also supported). The same rule is then applied to the "divisible by 4000 Hz" family of sample rates. If none of the family-rules work, the default sample rate is tried. Of course, "tried" and "used" is not the same - the device may have its own constraints, e.g. require identical rates for capture and playback. In any case, the final say in the sample rate choice is with the hardware. All this logic is properly logged in the "pulseaudio -vvv" output. So it would be nice if you provide these logs via some pastebin service. As for resampling that eats 100% of your CPU, that's a misconfiguration (which is unfortunately too common on non-x86 CPUs). First, you should build speex with fixed-point support if you are not on x86-family CPU. Redundant float <-> fixed conversions, not the actual resampling process, is what eats CPU time on non-x86. Then, you should set the resampler to speex-fixed-1 (or to speex-fixed-3 just for a benchmark) in /etc/pulse/daemon.conf. As for "why resampling at all" - this may be related to module-echo-cancel. Its stream always works at 32 kHz natively, so the rules above would select 48 kHz if this is supported by the card. Then, if some music appears before module-echo-cancel corks its stream due to timeout, it will also get resampled to 48 kHz. -- Alexander E. Patrakov ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry
On Tue, Oct 28, 2014 at 8:39 AM, mailing lists wrote: > raspbian comes with PA 2, but I did compiled PA 5 FWIW, you could enable the jessie repository and pull pa 5 from there. You could also pick up newer alsa-lib and kernel too. deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi In order to prevent upgrading everything, you can also add a file /etc/apt/apt.conf.d/default with the content: APT::Default-Release "wheezy"; Then you can install selected software from jessie using apt-get install -t jessie -- Saludos, Felipe Sateler ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry
Alexander, thank you very much for the detailed explanation. > The theory is very simple. It probes at startup whether the configured > sample rate and the alternate sample rate (both can be seen in > /etc/pulse/daemon.conf) are supported. If none is supported, PulseAudio > picks a somewhat-random rate that is supported by the card. The result > of this step is either one or two rates that are known to be supported. but (I suppose) that the default|alternative rates declared in etc/pulse/daemon.conf are contrasted with the rates detected from alsa devices and the common ones considered for use. When I played with this two variables on the laptop, the frecuencies were rounded to the nearest frecuency supported by the usb sound card, this did not happen when I changed the values on the raspberry, and we talk of the same sound card. It doesn't matter what I put is was always "Device front:1 doesn't support 44100 Hz, changed to 48000 Hz". it sounds like PA did a fallback to a "safe" sample rate. Here is the verbose (-vvv) output: http://pastebin.com/wfgxATEq > So, the first step in debugging should be to see whether daemon.conf > files are identical. the configuration files used were: user@rpi ~ $ grep '^[^#]' pulseaudio/etc/pulse/default.pa load-module module-device-restore load-module module-stream-restore load-module module-card-restore load-module module-alsa-card device_id=0 load-module module-native-protocol-unix load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;10.20.30.0/24 load-module module-zeroconf-publish load-module module-rtp-recv load-module module-default-device-restore load-module module-rescue-streams load-module module-always-sink load-module module-intended-roles load-module module-suspend-on-idle timeout=10 .ifexists module-console-kit.so load-module module-console-kit .endif .ifexists module-systemd-login.so load-module module-systemd-login .endif load-module module-switch-on-port-available user@rpi ~ $ grep '^[^;#]' pulseaudio/etc/pulse/daemon.conf high-priority = yes nice-level = -11 realtime-scheduling = yes realtime-priority = 5 default-sample-rate = 44100 > When a new stream appears, PulseAudio attempts to open the sound device > (sink) and chooses a sample rate. Of course, if either the device or its > monitor is already used, then the sample rate cannot be changed, end of > story. If the device is not already open, then PulseAudio tries to make > sure that the resampler has less work to do. Namely, if both the stream > and one of the two detected known-supported rates are from the > "divisible by 11025 Hz" family, this kind of rate is used (i.e. if 44100 > Hz is supported, then a 22050 Hz stream would be resampled to 44100 Hz, > even if 48000 Hz is also supported). The same rule is then applied to > the "divisible by 4000 Hz" family of sample rates. If none of the > family-rules work, the default sample rate is tried. Of course, "tried" > and "used" is not the same - the device may have its own constraints, > e.g. require identical rates for capture and playback. In any case, the > final say in the sample rate choice is with the hardware. interesting. > As for resampling that eats 100% of your CPU, that's a misconfiguration > (which is unfortunately too common on non-x86 CPUs). First, you should > build speex with fixed-point support if you are not on x86-family CPU. > Redundant float <-> fixed conversions, not the actual resampling > process, is what eats CPU time on non-x86. Then, you should set the > resampler to speex-fixed-1 (or to speex-fixed-3 just for a benchmark) in > /etc/pulse/daemon.conf. I wonder if raspbian people had this in mind. I will look into this, for now I prefer avoid resampling, the raspberry is running as a jukebox to attempt modernize my (very) old amplifier. ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry
29.10.2014 15:14, mailing lists пишет: Alexander, thank you very much for the detailed explanation. The theory is very simple. It probes at startup whether the configured sample rate and the alternate sample rate (both can be seen in /etc/pulse/daemon.conf) are supported. If none is supported, PulseAudio picks a somewhat-random rate that is supported by the card. The result of this step is either one or two rates that are known to be supported. but (I suppose) that the default|alternative rates declared in etc/pulse/daemon.conf are contrasted with the rates detected from alsa devices and the common ones considered for use. When I played with this two variables on the laptop, the frecuencies were rounded to the nearest frecuency supported by the usb sound card, this did not happen when I changed the values on the raspberry, and we talk of the same sound card. It doesn't matter what I put is was always "Device front:1 doesn't support 44100 Hz, changed to 48000 Hz". it sounds like PA did a fallback to a "safe" sample rate. Here is the verbose (-vvv) output: http://pastebin.com/wfgxATEq I have looked. Your log contains this line: I: [pulseaudio] alsa-util.c: Device front:0 doesn't support 44100 Hz, changed to 48000 Hz. So this is not a PulseAudio problem. Maybe some ALSA misconfiguration. I have to guess here, unfortunately. Could you please post the output of the following debugging commands (they play one second of silence and describe how they do it) while PulseAudio is not running? aplay -vv -d 1 -f cd -D hw:0 /dev/zero aplay -vv -d 1 -f cd -D front:0 /dev/zero -- Alexander E. Patrakov ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry
29.10.2014 15:37, Alexander E. Patrakov wrote: 29.10.2014 15:14, mailing lists пишет: Alexander, thank you very much for the detailed explanation. The theory is very simple. It probes at startup whether the configured sample rate and the alternate sample rate (both can be seen in /etc/pulse/daemon.conf) are supported. If none is supported, PulseAudio picks a somewhat-random rate that is supported by the card. The result of this step is either one or two rates that are known to be supported. but (I suppose) that the default|alternative rates declared in etc/pulse/daemon.conf are contrasted with the rates detected from alsa devices and the common ones considered for use. When I played with this two variables on the laptop, the frecuencies were rounded to the nearest frecuency supported by the usb sound card, this did not happen when I changed the values on the raspberry, and we talk of the same sound card. It doesn't matter what I put is was always "Device front:1 doesn't support 44100 Hz, changed to 48000 Hz". it sounds like PA did a fallback to a "safe" sample rate. Here is the verbose (-vvv) output: http://pastebin.com/wfgxATEq I have looked. Your log contains this line: I: [pulseaudio] alsa-util.c: Device front:0 doesn't support 44100 Hz, changed to 48000 Hz. So this is not a PulseAudio problem. Maybe some ALSA misconfiguration. I have to guess here, unfortunately. Could you please post the output of the following debugging commands (they play one second of silence and describe how they do it) while PulseAudio is not running? aplay -vv -d 1 -f cd -D hw:0 /dev/zero aplay -vv -d 1 -f cd -D front:0 /dev/zero Upon reading your log further, I have a better guess. It looks like your sound card supports only 48 kHz for capture, and, while capture is active, also requires playback to be open at 48 kHz. You can work around this limitation by setting the card profile to "output:analog-stereo" using pacucontrol. -- Alexander E. Patrakov ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry
29.10.2014 15:37, Alexander E. Patrakov пишет: 29.10.2014 15:14, mailing lists пишет: Alexander, thank you very much for the detailed explanation. The theory is very simple. It probes at startup whether the configured sample rate and the alternate sample rate (both can be seen in /etc/pulse/daemon.conf) are supported. If none is supported, PulseAudio picks a somewhat-random rate that is supported by the card. The result of this step is either one or two rates that are known to be supported. but (I suppose) that the default|alternative rates declared in etc/pulse/daemon.conf are contrasted with the rates detected from alsa devices and the common ones considered for use. When I played with this two variables on the laptop, the frecuencies were rounded to the nearest frecuency supported by the usb sound card, this did not happen when I changed the values on the raspberry, and we talk of the same sound card. It doesn't matter what I put is was always "Device front:1 doesn't support 44100 Hz, changed to 48000 Hz". it sounds like PA did a fallback to a "safe" sample rate. Here is the verbose (-vvv) output: http://pastebin.com/wfgxATEq I have looked. Your log contains this line: I: [pulseaudio] alsa-util.c: Device front:0 doesn't support 44100 Hz, changed to 48000 Hz. So this is not a PulseAudio problem. Maybe some ALSA misconfiguration. I have to guess here, unfortunately. Could you please post the output of the following debugging commands (they play one second of silence and describe how they do it) while PulseAudio is not running? aplay -vv -d 1 -f cd -D hw:0 /dev/zero aplay -vv -d 1 -f cd -D front:0 /dev/zero Sorry for the spam, but you have a very serious smoking gun in your log: D: [pulseaudio] alsa-util.c: Plug PCM: Direct Stream Mixing PCM PulseAudio must not be running on top of dmix. dmix is the thing that, by default, uses 48 kHz and does not support dynamic rate change. You have something wrong in your .asoundrc or /etc/asound.conf. Please delete both files. -- Alexander E. Patrakov ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry
> Upon reading your log further, I have a better guess. It looks like your > sound card supports only 48 kHz for capture, and, while capture is > active, also requires playback to be open at 48 kHz. > > You can work around this limitation by setting the card profile to > "output:analog-stereo" using pacucontrol. the 2902 specs[1] are: Sampling Rate: – DAC: 32, 44.1, 48 kHz – ADC: 8, 11.025, 16, 22.05, 32, 44.1, 48 kHz and it is consistent with the capabilities reported by the kernel module [2], also it fails to explain why mpd have not problem using 44100 with alsa output. If it were an alsa bug It should affect both programs. I will do the tests tonight at home. [1] http://www.ti.com/lit/gpn/pcm2902 [2] http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-October/022140.html ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry
> The 8000, 11025, 16000 and 22050 values are capture samplerates (see below /proc/asound/card1/stream0 output), for playback the card support 32000, 44100, 48000. > > my laptop is running kernel 3.17.1 and the raspberry kernel 3.12.29, which are less than a year apart and both reports the same capabilities, so why PA 5 detects different samplerates? I even run PA as root to discard file permissions problems but the result is the same. > > As I said I'm out of ideas, but it seems a problem with PA, is there anything that I can do to find the cause? sysfs.path = "/devices/pci:00/:00:1d.0/usb3/3-1/3-1:1.0/sound/card1 sysfs.path = "/devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.0/sound/card1" Seem snd-usb-audio on different platform have different constraints. (period time ms and period size ) W: [pulseaudio] sink.c: Default and alternate sample rates are the same. Seem you are using same rate for default and alternate sampleing rate It is strange that so many disable tsched mode but only one [pulseaudio] alsa-sink.c: Cannot enable timer-based scheduling, falling back to sound IRQ scheduling. I: [pulseaudio] alsa-util.c: Disabling tsched mode since BATCH flag is set I: [pulseaudio] alsa-util.c: Disabling tsched mode since BATCH flag is set I: [pulseaudio] alsa-util.c: Disabling tsched mode since BATCH flag is set I: [pulseaudio] alsa-util.c: Disabling tsched mode since BATCH flag is set I: [pulseaudio] alsa-util.c: Disabling tsched mode since BATCH flag is set I: [pulseaudio] alsa-util.c: Disabling tsched mode since BATCH flag is set I: [pulseaudio] alsa-util.c: Disabling tsched mode since BATCH flag is set I: [pulseaudio] alsa-util.c: Failed to set hardware parameters on plug:surround40:1: Invalid argument I: [pulseaudio] pcm_params.c: Slave PCM not usable I: [pulseaudio] pcm_params.c: Slave PCM not usabl Is is strange the error is slave pcm not usable instead of Channel count not supported Did you have same /usr/share/alsa/conf/cards/USB-Audio.conf? pulseaudio] source.c: device.description = "PCM2902 Audio Codec Analog Stereo" I: [pulseaudio] source.c: alsa.mixer_name = "USB Mixer" I: [pulseaudio] source.c: alsa.components = "USB08bb:2902" I: [pulseaudio] source.c: module-udev-detect.discovered = "1" I: [pulseaudio] source.c: device.icon_name = "audio-card-usb" I: [pulseaudio] alsa-source.c: Using 5.0 fragments of size 4096 bytes (21.33ms), buffer size is 20480 bytes (106.67ms) [pulseaudio] server-lookup.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11 W: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error. NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11 ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry
> To debug the issue, I need the output of these two commands: > > aplay -vv -d 1 -f cd -D hw:0 /dev/zero > > aplay -vv -d 1 -f cd -D front:0 /dev/zero I'm sorry, here they are: root@rpi:~# aplay -vv -d 1 -f cd -D hw:0 /dev/zero Playing raw data '/dev/zero' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo Hardware PCM card 0 'USB Audio CODEC' device 0 subdevice 0 Its setup is: stream : PLAYBACK access : RW_INTERLEAVED format : S16_LE subformat: STD channels : 2 rate : 44100 exact rate : 44100 (44100/1) msbits : 16 buffer_size : 22050 period_size : 5513 period_time : 125011 tstamp_mode : NONE period_step : 1 avail_min: 5513 period_event : 0 start_threshold : 22050 stop_threshold : 22050 silence_threshold: 0 silence_size : 0 boundary : 1445068800 appl_ptr : 0 hw_ptr : 0 #+ | 00% root@rpi:~# root@rpi:~# aplay -vv -d 1 -f cd -D front:0 /dev/zero Playing raw data '/dev/zero' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo Plug PCM: Rate conversion PCM (48000, sformat=S16_LE) Converter: libspeex (builtin) Protocol version: 10002 Its setup is: stream : PLAYBACK access : RW_INTERLEAVED format : S16_LE subformat: STD channels : 2 rate : 44100 exact rate : 44100 (44100/1) msbits : 16 buffer_size : 15052 period_size : 940 period_time : 21333 tstamp_mode : NONE period_step : 1 avail_min: 940 period_event : 0 start_threshold : 15052 stop_threshold : 15052 silence_threshold: 0 silence_size : 0 boundary : 986447872 Slave: Direct Stream Mixing PCM Its setup is: stream : PLAYBACK access : MMAP_INTERLEAVED format : S16_LE subformat: STD channels : 2 rate : 48000 exact rate : 48000 (48000/1) msbits : 16 buffer_size : 16384 period_size : 1024 period_time : 21333 tstamp_mode : NONE period_step : 1 avail_min: 1024 period_event : 0 start_threshold : 16384 stop_threshold : 16384 silence_threshold: 0 silence_size : 0 boundary : 1073741824 Hardware PCM card 0 'USB Audio CODEC' device 0 subdevice 0 Its setup is: stream : PLAYBACK access : MMAP_INTERLEAVED format : S16_LE subformat: STD channels : 2 rate : 48000 exact rate : 48000 (48000/1) msbits : 16 buffer_size : 16384 period_size : 1024 period_time : 21333 tstamp_mode : ENABLE period_step : 1 avail_min: 1024 period_event : 0 start_threshold : 1 stop_threshold : 1073741824 silence_threshold: 0 silence_size : 1073741824 boundary : 1073741824 appl_ptr : 0 hw_ptr : 0 #+ | 00% ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry
30.10.2014 16:12, mailing lists wrote: To debug the issue, I need the output of these two commands: aplay -vv -d 1 -f cd -D hw:0 /dev/zero aplay -vv -d 1 -f cd -D front:0 /dev/zero I'm sorry, here they are: root@rpi:~# aplay -vv -d 1 -f cd -D hw:0 /dev/zero Playing raw data '/dev/zero' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo Hardware PCM card 0 'USB Audio CODEC' device 0 subdevice 0 <...> This is correct. root@rpi:~# root@rpi:~# aplay -vv -d 1 -f cd -D front:0 /dev/zero Playing raw data '/dev/zero' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo Plug PCM: Rate conversion PCM (48000, sformat=S16_LE) <...> Slave: Direct Stream Mixing PCM And this is wrong. However, the strace from the previous email did not find any custom ALSA configuration files that could affect the outcome. Thus, I conclude that you, or maybe some stupid script that you ran, modified some file in /usr/share/alsa in a bad way in the past. Please reinstall alsa-lib (which may be known as libasound2 in some Debian-based distributions). Or, please tar up the whole /usr/share/alsa directory and send the tarball here, and I'll look what exactly is damaged there. -- Alexander E. Patrakov ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry
> And this is wrong. However, the strace from the previous email did not > find any custom ALSA configuration files that could affect the outcome. > Thus, I conclude that you, or maybe some stupid script that you ran, > modified some file in /usr/share/alsa in a bad way in the past. Please > reinstall alsa-lib (which may be known as libasound2 in some > Debian-based distributions). it's a year old raspbian installation with only mpd, lirc, lcdproc and now PA. IFAIK I did not run programs/scripts as the root user on this device which could modify the alsa configuration. I will reinstall all alsa packages as you said, but they were already the default files. > Or, please tar up the whole /usr/share/alsa directory and send the > tarball here, and I'll look what exactly is damaged there. ok, I will send you directly. ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry
> And this is wrong. However, the strace from the previous email did not > find any custom ALSA configuration files that could affect the outcome. > Thus, I conclude that you, or maybe some stupid script that you ran, > modified some file in /usr/share/alsa in a bad way in the past. Please > reinstall alsa-lib (which may be known as libasound2 in some > Debian-based distributions). Alexander, you was right all time. I edited that file a year ago and I completely forgot about it. I was also confused by the fact that mpd was inmune to this user induced bug. Sorry about the noise and thank you for all the help. ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry
On Tue, 2014-10-28 at 11:39 +, mailing lists wrote: > Hello Tanu, > > > I'm not sure if you mentioned this already before (sorry for not > > bothering to check), but is the PA version the same between the > > machines? If not, then something may have been fixed in PA, but in any > > case it seems more likely to me that there was some change in the kernel > > driver or alsa-lib that fixed the issue that makes PulseAudio conclude > > that the sound card doesn't support 44100 Hz. > > raspbian comes with PA 2, but I did compiled PA 5, just to discard > this type of problems, you can see the output here and yes both test > are with PA 5: > > http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-October/022015.html > > I don't think there is a kernel driver or alsa-lib bug because other > software like the Music Player Daemon haven't problem using the alsa > device with only 10% of cpu usage (mp3 decoding), but with mpd > Pulseaudio output or any other program (local or remote) cpu is > 100% ... you known music is 44100 and PA detects a 48000 sound card so > it needs resampling. > > That I don't understand is how PA determines sound card capabilities > > any clue? If the same PulseAudio version works on a newer kernel but not on an older kernel, then that very strongly suggests that something was changed in the kernel that made it work. If MPD works also on the older kernel, then apparently PulseAudio and MPD do something differently. Feel free to compare the source code of MPD and PulseAudio to see if PulseAudio does something wrong (I lack the motivation to do that myself). The "Device %s doesn't support %u Hz, changed to %u Hz." message is printed from src/modules/alsa/alsa-util.c, so that's a good place to start. -- Tanu ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry
02.11.2014 18:11, Tanu Kaskinen wrote: On Tue, 2014-10-28 at 11:39 +, mailing lists wrote: Hello Tanu, I'm not sure if you mentioned this already before (sorry for not bothering to check), but is the PA version the same between the machines? If not, then something may have been fixed in PA, but in any case it seems more likely to me that there was some change in the kernel driver or alsa-lib that fixed the issue that makes PulseAudio conclude that the sound card doesn't support 44100 Hz. raspbian comes with PA 2, but I did compiled PA 5, just to discard this type of problems, you can see the output here and yes both test are with PA 5: http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-October/022015.html I don't think there is a kernel driver or alsa-lib bug because other software like the Music Player Daemon haven't problem using the alsa device with only 10% of cpu usage (mp3 decoding), but with mpd Pulseaudio output or any other program (local or remote) cpu is 100% ... you known music is 44100 and PA detects a 48000 sound card so it needs resampling. That I don't understand is how PA determines sound card capabilities any clue? If the same PulseAudio version works on a newer kernel but not on an older kernel, then that very strongly suggests that something was changed in the kernel that made it work. If MPD works also on the older kernel, then apparently PulseAudio and MPD do something differently. Feel free to compare the source code of MPD and PulseAudio to see if PulseAudio does something wrong (I lack the motivation to do that myself). The "Device %s doesn't support %u Hz, changed to %u Hz." message is printed from src/modules/alsa/alsa-util.c, so that's a good place to start. Tanu, please ignore the "issue". It was caused by a bad edit to /usr/share/alsa/alsa.conf. The bad edit was: -pcm.front cards.pcm.default +##pcm.front cards.pcm.front +pcm.front cards.pcm.default As a result, the front:0 device was redirected to dmix, which by default accepts only 48 kHz. -- Alexander E. Patrakov ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry
On Sun, 2014-11-02 at 18:52 +0500, Alexander E. Patrakov wrote: > 02.11.2014 18:11, Tanu Kaskinen wrote: > > On Tue, 2014-10-28 at 11:39 +, mailing lists wrote: > >> Hello Tanu, > >> > >>> I'm not sure if you mentioned this already before (sorry for not > >>> bothering to check), but is the PA version the same between the > >>> machines? If not, then something may have been fixed in PA, but in any > >>> case it seems more likely to me that there was some change in the kernel > >>> driver or alsa-lib that fixed the issue that makes PulseAudio conclude > >>> that the sound card doesn't support 44100 Hz. > >> > >> raspbian comes with PA 2, but I did compiled PA 5, just to discard > >> this type of problems, you can see the output here and yes both test > >> are with PA 5: > >> > >> http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-October/022015.html > >> > >> I don't think there is a kernel driver or alsa-lib bug because other > >> software like the Music Player Daemon haven't problem using the alsa > >> device with only 10% of cpu usage (mp3 decoding), but with mpd > >> Pulseaudio output or any other program (local or remote) cpu is > >> 100% ... you known music is 44100 and PA detects a 48000 sound card so > >> it needs resampling. > >> > >> That I don't understand is how PA determines sound card capabilities > >> > >> any clue? > > > > If the same PulseAudio version works on a newer kernel but not on an > > older kernel, then that very strongly suggests that something was > > changed in the kernel that made it work. If MPD works also on the older > > kernel, then apparently PulseAudio and MPD do something differently. > > Feel free to compare the source code of MPD and PulseAudio to see if > > PulseAudio does something wrong (I lack the motivation to do that > > myself). The "Device %s doesn't support %u Hz, changed to %u Hz." > > message is printed from src/modules/alsa/alsa-util.c, so that's a good > > place to start. > > Tanu, please ignore the "issue". It was caused by a bad edit to > /usr/share/alsa/alsa.conf. > > The bad edit was: > > -pcm.front cards.pcm.default > +##pcm.front cards.pcm.front > +pcm.front cards.pcm.default > > As a result, the front:0 device was redirected to dmix, which by default > accepts only 48 kHz. Oops, I didn't remember to check if the mail had already got answers before I replied to it! I was reading the mails in oldest-first order, without threading... Good that the issue was resolved! -- Tanu ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry [SOLVED]
>Sorry for the spam, but you have a very serious smoking gun in your log: I like this type of (instructive) spam ;-) > D: [pulseaudio] alsa-util.c: Plug PCM: Direct Stream Mixing PCM > > PulseAudio must not be running on top of dmix. dmix is the thing that, > by default, uses 48 kHz and does not support dynamic rate change. > > You have something wrong in your .asoundrc or /etc/asound.conf. Please > delete both files. I took the precaution of checking for alsa configuration files before report the case, not personal configuration files were present (.asoundrc) and the system wide config file was: root@rpi:/tmp# ls -l /etc/asound* -rw-r--r-- 1 root root 132 Feb 9 2013 /etc/asound.conf.disabled but a bit more investigation: root@rpi:/tmp# strace -f -e trace=file aplay -vv -d 1 -f cd -D front:0 /dev/zero 2>&1 | grep "^open.*alsa" | grep -v ENOENT open("/usr/share/alsa/alsa.conf", O_RDONLY) = 3 open("/usr/share/alsa/alsa.conf.d/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3 open("/usr/share/alsa/alsa.conf.d//50-pulseaudio.conf", O_RDONLY) = 3 open("/usr/share/alsa/alsa.conf.d//pulse.conf", O_RDONLY) = 3 open("/usr/lib/arm-linux-gnueabihf/alsa-lib/libasound_module_conf_pulse.so", O_RDONLY) = 3 open("/usr/share/alsa/cards/aliases.conf", O_RDONLY) = 3 open("/usr/share/alsa/pcm/default.conf", O_RDONLY) = 4 open("/usr/share/alsa/pcm/dmix.conf", O_RDONLY) = 4 open("/usr/share/alsa/pcm/dsnoop.conf", O_RDONLY) = 4 open("/usr/share/alsa/cards/USB-Audio.conf", O_RDONLY) = 3 open("/usr/share/alsa/pcm/front.conf", O_RDONLY) = 4 open("/usr/share/alsa/pcm/surround40.conf", O_RDONLY) = 4 open("/usr/share/alsa/pcm/surround41.conf", O_RDONLY) = 4 open("/usr/share/alsa/pcm/surround50.conf", O_RDONLY) = 4 open("/usr/share/alsa/pcm/surround51.conf", O_RDONLY) = 4 open("/usr/share/alsa/pcm/surround71.conf", O_RDONLY) = 4 open("/usr/share/alsa/pcm/iec958.conf", O_RDONLY) = 4 open("/usr/lib/arm-linux-gnueabihf/alsa-lib/libasound_module_rate_speexrate.so", O_RDONLY) = 6 the file "/usr/share/alsa/alsa.conf" contains (among others plugins) dmix settings, and it seems that is the common configuration on several distros that I checked. root@rpi:/tmp# grep dmix /usr/share/alsa/alsa.conf defaults.pcm.dmix.max_periods 0 defaults.pcm.dmix.rate 48000 defaults.pcm.dmix.format "unchanged" defaults.pcm.dmix.card defaults.pcm.card defaults.pcm.dmix.device defaults.pcm.device pcm.dmix cards.pcm.dmix commenting out this lines results on the desired rate: I: [pulseaudio] sink.c: Created sink 0 "alsa_output.0.analog-stereo" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right well I suppose that the solution is comment this lines, but it seems a bit dirty solution... A big thanks to Alexander and the rest of the members who helped me to find this. P.D: just curiosity .. why PA triggers this plugin and mpd not??? (output: opened plugin=alsa name="My ALSA device" audio_format=44100:16:2) /ect/mpd.conf [...] audio_output { type"alsa" name"My ALSA device" device "hw:0,0"# optional mixer_device"default" # optional mixer_control "Master"# optional mixer_index "0" # optional auto_resample "no" auto_channels "no" auto_format "no" } [...] client: [38] opened from 10.20.30.10:38882 client: [38] process command "play" playlist: play 0:"2014/misc/song0003.mp3" decoder_thread: clearing mixramp tags decoder_control: mixramp_start = NULL decoder_control: mixramp_prev_end = NULL decoder: audio_format=44100:24:2, seekable=true client: [38] command returned 0 playlist: queue song 1:"2014/misc/song0003.mp3" client: [38] process command list client: command_process_list: process command "status" client: command_process_list: command returned 0 client: command_process_list: process command "currentsong" client: command_process_list: command returned 0 client: [38] process command list returned 0 client: [38] closed alsa: buffer: size=90..262144 time=2040..5944309 alsa: period: size=45..131072 time=1020..2972155 alsa: default period_time = buffer_time/4 = 50/4 = 125000 alsa: buffer_size=22050 period_size=5513 output: opened plugin=alsa name="My ALSA device" audio_format=44100:16:2 output: converting from 44100:24:2 ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] pulseaudio (V5) incorrect rate detection on usb sound card with raspberry [SOLVED]
30.10.2014 15:43, mailing lists wrote: open("/usr/share/alsa/pcm/dmix.conf", O_RDONLY) = 4 That's normal as long as the devices contained there are not actually opened and as long as no new devices are created that use the dmix plugin. To debug the issue, I need the output of these two commands: aplay -vv -d 1 -f cd -D hw:0 /dev/zero aplay -vv -d 1 -f cd -D front:0 /dev/zero -- Alexander E. Patrakov ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss