INTERACT FORUM
More => Old Versions => JRiver Media Center 23 for Linux => Topic started by: mattkhan on February 22, 2018, 08:58:35 am
-
I'm attempting to get MC to play to a loopback device. I see the following in the logs
1289688: 2166068992: Playback: CALSAPlugin::OpenALSA: Opened audio device plughw:CARD=Loopback,DEV=0
1289688: 2166068992: Playback: CALSAPlugin::OpenALSA: Opened device at bitdepth S16_LE
1289688: 2166068992: Playback: CALSAPlugin::OpenALSA: Failed to get desired sample rate (48000): Invalid argument
1289688: 2166068992: Playback: CALSAPlugin::OpenALSA: Finish (1 ms)
This log is with the PCM output format explicitly set to S16_LE (hence the 2nd line), I get the same behaviour if I set this to auto.
The error displayed is
1289689: 2211079936: Playback: CPlayerZone::JRPlaybackEngine_PlaybackError: Start
1289689: 2211079936: Playback: CPlayerZone::JRPlaybackEngine_PlaybackError: Error: Playback could not be started on the output 'ALSA' using the format
'48 kHz 2ch'.
This output format may not be supported by your hardware. You can use DSP Studio to change the output to a compatible format.
Also, make sure that your system has a valid sound playback device and that it is properly configured in playback options.
1289689: 2211079936: Playback: CPlayerZone::JRPlaybackEngine_PlaybackError: Finish (0 ms)
the same file plays without issue using aplay
$ aplay -D plughw:CARD=Loopback,DEV=0 MeasSweep_48000_0_24000_LR_refL.wav
Playing WAVE 'MeasSweep_48000_0_24000_LR_refL.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
any ideas how to get MC to play to this device?
-
I'm attempting to get MC to play to a loopback device. I see the following in the logs
1289688: 2166068992: Playback: CALSAPlugin::OpenALSA: Opened audio device plughw:CARD=Loopback,DEV=0
1289688: 2166068992: Playback: CALSAPlugin::OpenALSA: Opened device at bitdepth S16_LE
1289688: 2166068992: Playback: CALSAPlugin::OpenALSA: Failed to get desired sample rate (48000): Invalid argument
1289688: 2166068992: Playback: CALSAPlugin::OpenALSA: Finish (1 ms)
This log is with the PCM output format explicitly set to S16_LE (hence the 2nd line), I get the same behaviour if I set this to auto.
The error displayed is
1289689: 2211079936: Playback: CPlayerZone::JRPlaybackEngine_PlaybackError: Start
1289689: 2211079936: Playback: CPlayerZone::JRPlaybackEngine_PlaybackError: Error: Playback could not be started on the output 'ALSA' using the format
'48 kHz 2ch'.
This output format may not be supported by your hardware. You can use DSP Studio to change the output to a compatible format.
Also, make sure that your system has a valid sound playback device and that it is properly configured in playback options.
1289689: 2211079936: Playback: CPlayerZone::JRPlaybackEngine_PlaybackError: Finish (0 ms)
the same file plays without issue using aplay
$ aplay -D plughw:CARD=Loopback,DEV=0 MeasSweep_48000_0_24000_LR_refL.wav
Playing WAVE 'MeasSweep_48000_0_24000_LR_refL.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
any ideas how to get MC to play to this device?
The only thing I see here is that you are using a plughw: device. MC will NOT let ALSA do sample rate manipulation using the plughw devices. You might want to check to see what sample rates your loopback device supports then setup DSP studio to use them and not use a plughw device.
Since I really don't know much about loopback devices, it's possible that it won't work at any rate but you could give this a try.
-
The only thing I see here is that you are using a plughw: device. MC will NOT let ALSA do sample rate manipulation using the plughw devices. You might want to check to see what sample rates your loopback device supports then setup DSP studio to use them and not use a plughw device.
Since I really don't know much about loopback devices, it's possible that it won't work at any rate but you could give this a try.
it's just another device, as far as I can see it supports
S32_LE:44100,48000,88200,96000,176400,192000
and we can see that 48kHz is ok because aplay can play that file without issue. I have tried with MC set to 48kHz or passthrough to no avail.
Which device should I try instead?
-
it's just another device, as far as I can see it supports
S32_LE:44100,48000,88200,96000,176400,192000
and we can see that 48kHz is ok because aplay can play that file without issue. I have tried with MC set to 48kHz or passthrough to no avail.
Which device should I try instead?
What does the output of /usr/lib/jriver/Media\ Center\ 23/alsacap look like?
-
What does the output of /usr/lib/jriver/Media\ Center\ 23/alsacap look like?
it reports 44100 only on that device
Card 2, ID `Loopback', name `Loopback'
Device 0, ID `Loopback PCM', name `Loopback PCM', 8 subdevices (8 available)
2 channels, sampling rates 44100 Hz
Sample formats: S32_LE
Subdevice 0, name `subdevice #0'
Subdevice 1, name `subdevice #1'
Subdevice 2, name `subdevice #2'
Subdevice 3, name `subdevice #3'
Subdevice 4, name `subdevice #4'
Subdevice 5, name `subdevice #5'
Subdevice 6, name `subdevice #6'
Subdevice 7, name `subdevice #7'
Device 1, ID `Loopback PCM', name `Loopback PCM', 8 subdevices (8 available)
1..32 channels, sampling rates 8000, 11025, 16000, 22050, 32000, 44100, 48000, 88200, 96000, 176400, 192000 Hz
Sample formats: S16_LE, S16_BE, S32_LE, S32_BE, FLOAT_LE, FLOAT_BE
Subdevice 0, name `subdevice #0'
Subdevice 1, name `subdevice #1'
Subdevice 2, name `subdevice #2'
Subdevice 3, name `subdevice #3'
Subdevice 4, name `subdevice #4'
Subdevice 5, name `subdevice #5'
Subdevice 6, name `subdevice #6'
Subdevice 7, name `subdevice #7'
what is it reading to get that info?
-
and I can confirm it does play a 44.1kHz file back ok
-
it reports 44100 only on that device
Card 2, ID `Loopback', name `Loopback'
Device 0, ID `Loopback PCM', name `Loopback PCM', 8 subdevices (8 available)
2 channels, sampling rates 44100 Hz
Sample formats: S32_LE
Subdevice 0, name `subdevice #0'
Subdevice 1, name `subdevice #1'
Subdevice 2, name `subdevice #2'
Subdevice 3, name `subdevice #3'
Subdevice 4, name `subdevice #4'
Subdevice 5, name `subdevice #5'
Subdevice 6, name `subdevice #6'
Subdevice 7, name `subdevice #7'
Device 1, ID `Loopback PCM', name `Loopback PCM', 8 subdevices (8 available)
1..32 channels, sampling rates 8000, 11025, 16000, 22050, 32000, 44100, 48000, 88200, 96000, 176400, 192000 Hz
Sample formats: S16_LE, S16_BE, S32_LE, S32_BE, FLOAT_LE, FLOAT_BE
Subdevice 0, name `subdevice #0'
Subdevice 1, name `subdevice #1'
Subdevice 2, name `subdevice #2'
Subdevice 3, name `subdevice #3'
Subdevice 4, name `subdevice #4'
Subdevice 5, name `subdevice #5'
Subdevice 6, name `subdevice #6'
Subdevice 7, name `subdevice #7'
what is it reading to get that info?
Directly from ALSA. The only thing I added was the test for sample rates.
-
and I can confirm it does play a 44.1kHz file back ok
The multirate device could just be a pseudo device reflecting the resampler.
-
The multirate device could just be a pseudo device reflecting the resampler.
FWIW my previous output (which reported all the sample rates) came from https://github.com/ronalde/mpd-configure/blob/master/alsa-capabilities
What does MC do in this case? Does it attempt to play anyway or just report the error?
-
FWIW my previous output (which reported all the sample rates) came from https://github.com/ronalde/mpd-configure/blob/master/alsa-capabilities
What does MC do in this case? Does it attempt to play anyway or just report the error?
It depends on the setting of the audio advanced option "Auto configure on playback failure". It will guess a sample rate if playback fails.
Best to use DSP studio to set the rate. The important thing to know is that plughw as a default implies using ALSA resampling which we don't allow.
-
It depends on the setting of the audio advanced option "Auto configure on playback failure". It will guess a sample rate if playback fails.
Best to use DSP studio to set the rate. The important thing to know is that plughw as a default implies using ALSA resampling which we don't allow.
OK. ALSA devices have confused me for many many years but I'll ask anyway :) Any idea why aplay works to same device?
-
OK. ALSA devices have confused me for many many years but I'll ask anyway :) Any idea why aplay works to same device?
Because it's not disabling re-sampling when opening the device.
It looks to me from what you've posted that the native sample rate of that device is 44.1k.
-
Because it's not disabling re-sampling when opening the device.
It looks to me from what you've posted that the native sample rate of that device is 44.1k.
I don't think that's true
for example if I do this in one terminal
$ aplay -D hw:CARD=Loopback,DEV=0 --disable-resample Sine_1000.wav
Playing WAVE 'Sine_1000.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
then in another one
$ cat /proc/asound/card2/pcm0p/sub0/hw_params
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 48000 (48000/1)
period_size: 6000
buffer_size: 24000
I don't see any evidence, apart from in MC, that this is a 44.1kHz device
actually now I try this again I see alsacap reports
..32 channels, sampling rates 8000, 11025, 16000, 22050, 32000, 44100, 48000, 88200, 96000, 176400, 192000 Hz
no idea what is going on there, anyway at least I now know how to work out how MC sees the device capabilities. Thanks.
-
I don't think that's true
for example if I do this in one terminal
$ aplay -D hw:CARD=Loopback,DEV=0 --disable-resample Sine_1000.wav
Playing WAVE 'Sine_1000.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
then in another one
$ cat /proc/asound/card2/pcm0p/sub0/hw_params
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 48000 (48000/1)
period_size: 6000
buffer_size: 24000
I don't see any evidence, apart from in MC, that this is a 44.1kHz device
actually now I try this again I see alsacap reports
..32 channels, sampling rates 8000, 11025, 16000, 22050, 32000, 44100, 48000, 88200, 96000, 176400, 192000 Hz
no idea what is going on there, anyway at least I now know how to work out how MC sees the device capabilities. Thanks.
MC simply asks ALSA what the suggestions are for opening the devices. That's where the list of audio devices in MC comes from.
It starts with S32_LE and works it's way down the format list until one is successful when opening the device (auto mode) which you can override by specifying a format.
Sets the period and buffer times (perhaps you need to make those smaller)?
Uses the sample rate of the file when opening the device unless DSP studio is specifying something different and also disables device resampling. It's pretty straightforward.
I don't know why your loopback device shows up twice with different sample rates.
I'm suspicious that aplay with the sample rate disable flag isn't working as advertised on the device you are choosing.
-
I'm suspicious that aplay with the sample rate disable flag isn't working as advertised on the device you are choosing.
not sure how to tell if that is happening, I guess I could play and record a dirac pulse and see if it comes out untouched