Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.
Admin message
The migration is almost done, at least the rest should happen in the background. There are still a few technical difference between the old cluster and the new ones, and they are summarized in this issue. Please pay attention to the TL:DR at the end of the comment.
Sending audio to the TV results in this mess: 3106__2023-05-15_21_23_28_ This is KDE Plasma's speaker testing utility, we can only hear front left (but audio is garbled), front right does not do anything at all.
There is also a monitor connected using DisplayPort, this audio connection works fine.
The HDMI connection to the TV works fine under Windows, so this cannot be a hardware problem.
The HDMI connection is listed as a DisplayPort connection in the eld info, whether this is actually a problem and if it is related to the audio issue I don't know.
Sending ac3 audio (which is listed as supported and also works under Windows) results in no sound at all.
Happens both with kernel version 6.3.2 and the latest drm-tip.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
The speaker-test command comes back with an error, again only front left is audible:
speaker-test -c2 -twav -Dhdmi:CARD=PCH_1,DEV=0 -l 10speaker-test 1.2.9Playback device is hdmi:CARD=PCH_1,DEV=0Stream parameters are 48000Hz, S16_LE, 2 channelsWAV file(s)Rate set to 48000Hz (requested 48000Hz)Buffer size range from 64 to 1048576Period size range from 32 to 524288Using max buffer size 1048576Periods = 4was set period_size = 262144was set buffer_size = 10485760 - Front Left1 - Front RightWrite error: -77,File descriptor in bad statexrun_recovery failed: -77,File descriptor in bad stateTransfer failed: File descriptor in bad state
speaker-test -c2 -twav -Dplughw:CARD=PCH_1,DEV=3 -l 10speaker-test 1.2.9Playback device is plughw:CARD=PCH_1,DEV=3Stream parameters are 48000Hz, S16_LE, 2 channelsWAV file(s)Rate set to 48000Hz (requested 48000Hz)Buffer size range from 64 to 1048576Period size range from 32 to 524288Using max buffer size 1048576Periods = 4was set period_size = 262144was set buffer_size = 10485760 - Front Left1 - Front RightWrite error: -77,File descriptor in bad statexrun_recovery failed: -77,File descriptor in bad stateTransfer failed: File descriptor in bad state
Nowa Ammerlaanchanged title from A770: Garbled HDMI audio to A770: Garbled HDMI audio. Transfer failed: File descriptor in bad state
changed title from A770: Garbled HDMI audio to A770: Garbled HDMI audio. Transfer failed: File descriptor in bad state
@AndrewAmmerlaan can you share output of alsa-info tool (preferably when the garbled audio is output). And can you try "speaker-test -c2 -twav -Dhw:1,3 -l 10"? The errors look like the some ALSA plugin would be used here (giving the EBADFD/77 errors), but could be issue with the hardware as well.
speaker-test -c2 -twav -Dhw:1,3 -l 10speaker-test 1.2.9Playback device is hw:1,3Stream parameters are 48000Hz, S16_LE, 2 channelsWAV file(s)Rate set to 48000Hz (requested 48000Hz)Buffer size range from 64 to 1048576Period size range from 32 to 524288Using max buffer size 1048576Periods = 4was set period_size = 262144was set buffer_size = 10485760 - Unknown1 - UnknownWrite error: -77,File descriptor in bad statexrun_recovery failed: -77,File descriptor in bad stateTransfer failed: File descriptor in bad state
I do have the alsa-plugins and dcaenc packages installed, but I already tried removing these and this made no difference.
These packages are the owners of those files (I already tried without dcaenc and alsa-plugins):
andrew@andrew-gentoo-pc ~ % equery b /etc/alsa/conf.d* Searching for /etc/alsa/conf.d ...media-plugins/alsa-plugins-1.2.7.1-r1 (/etc/alsa/conf.d)media-sound/dcaenc-3-r1 (/etc/alsa/conf.d)media-video/pipewire-0.3.71-r2 (/etc/alsa/conf.d)
I used to have a hdmi-audio splitter between the tv and the computer, this used to work. I replaced the splitter with a usb audio s/pdif device (which also works if the tv is off). Now that the tv is connected directly to the computer I have this garbled audio problem.
@AndrewAmmerlaan ALSA configuration seems fine and there is nothing suspicious in alsa-info. Have you tried with different resolution -- does that impact?
The error seems to definitely come from kernel (not ALSA plugins). To debug this, you could put following to /etc/modprobe.d/hda-debug.conf
Have you tried with different resolution -- does that impact?
Video resolutions?
I just tried some different display resolutions and refresh rates. None of them fix the issue though some of them change how the distortion sounds. I still only get front left though, front right is silent.
Here's the dmesg log with those debug options enabled: audio-debug.log
With these options enabled no audible sound is produced at all. The speaker-test command returns with the same error as before.
I should mention this motherboard is a MSI z370-a pro which is a pci-e version 3 platform. So the link speed is slower then usual/expected (maybe that is somehow relevant). Here's the lspci info (note that LnkSta says (downgraded):
Additionally due to an unrelated issue the Arc GPU is not the boot gpu, instead posting etc is done of the iGPU. This effects the order in which the kernel initializes the audio and video devices. Not sure why that should matter but might as well mention it just in case.
@kaivehmanenintel If I connect the tv using a DisplayPort to HDMI adapter then front left plays without any distortion! Front right is still silent and still results in this error:
Write error: -77,File descriptor in bad statexrun_recovery failed: -77,File descriptor in bad stateTransfer failed: File descriptor in bad state
If I use the DisplayPort connection on the motherboard instead of the on on the GPU then I have the same problem (no distortion, front left works, front right is silent). The issue (or part of it at least) is therefore not specific to DG2. The CPU is a Intel i9-9900KS (Coffee Lake) with UHD Graphics 630.
@AndrewAmmerlaan The audio_debug.log suprisingly did not have any errors, which is really quite surprising. Is this now specific to your HKC-TV TV? If yo just switch another to another HDMI receiver, will the problem still happen? @suresh_kurmi Can you have someone look at the display setup in the logs. Given negotiated resolution affectes the artifacts, this hints at something with the display setup.
One audio side thing is to still try with silent streaming disabled ("options snd_hda_codec_hdmi enable_silent_stream=N" to some file under /etc/modprobe.d/ ). Pretty unlikely this will have effect, but pretty much the only audio-side thing to try out.
Very likely. As I said in my previous comments, it works if I put a HDMI audio splitter in between. The audio of the main display connected with DisplayPort also works (unplugging this does not help). Unfortunately I do not have a second HDMI display device available to test, but as I said this works fine under windows so there is not a hardware problem with the TV, cable or HDMI port.
One audio side thing is to still try with silent streaming disabled ("options snd_hda_codec_hdmi enable_silent_stream=N" to some file under /etc/modprobe.d/ ). Pretty unlikely this will have effect, but pretty much the only audio-side thing to try out.
Unfortunately this does not fix my problem. I had a different issue with silent_stream=Y that was also unreproducible on Intel's side, this however was worked around since it also effected others: #8307
Can you have someone look at the display setup in the logs. Given negotiated resolution affectes the artifacts, this hints at something with the display setup.
If I run speaker-test in a tty before logging in (i.e. SDDM is running in an X server) there is no audio corruption. Once I log in and start the KDE Plasma wayland session the audio is messed up again. Perhaps this is somehow specific to wayland/kwin, or perhaps it is related to pipewire not running when I run speaker-test in a tty?
Even in the tty I still only have front left though, front right remains silent. This is for me a bigger issue since the audio corruption I can work around with the DisplayPort to HDMI adapter.
The audio_debug.log suprisingly did not have any errors, which is really quite surprising.
@kaivehmanenintel I just realized that the ordering of the audio devices sometimes changes, specifically rebooting flips the order of the internal audio card and the one on the GPU. Last time I tested with those debug flags you mentioned I didn't actually hear any audio from the same speaker-test command, probably the reason was because I was running the wrong speaker-test command since the order of the devices had changed.
I tried this again, taking special care that the ids in the speaker-test command actually matched the output of alsa-info. This time I hear (ungarbled) front left, but again no front right. Here's the new log: audio-debug_2_.log
Compared to the previous log it shows some of these lines which to me look suspicious:
The CONNECT_LIST is likely from pipewire (or some other user-space entity) going through the ALSA sysfs entries and this will result in invalid CONNECT_LIST debug logs.
The actual playback part seems completely fine:
[ 275.332682] snd_hda_codec_hdmi hdaudioC1D2: hdmi_pin_hbr_setup: NID=0x4, pinctl=0x40
[ 275.332825] snd_hda_codec_hdmi hdaudioC1D2: hda_codec_setup_stream: NID=0x3, stream=0x1, channel=0, format=0x11
[ 280.802897] snd_hda_codec_hdmi hdaudioC1D2: hda_codec_cleanup_stream: NID=0x3
... this looks completely fine for 48khz 16bit stereo playback. This is likely some interoperability issue with your TV. When you launch KDE desktop, the display resolution changes, so it's a new situation in terms of sending audio data over HDMI.
Nowa Ammerlaanchanged title from A770: Garbled HDMI audio. Transfer failed: File descriptor in bad state to Garbled HDMI audio. Transfer failed: File descriptor in bad state
changed title from A770: Garbled HDMI audio. Transfer failed: File descriptor in bad state to Garbled HDMI audio. Transfer failed: File descriptor in bad state
Please find attached debug patch, This patch checks and print debug logs for required audio bandwidth and available blank bandwidth for current mode. Based on it calculate possible combination of channel and frequency. Please try on latest drm-tip, try with different resolution and please share logs.
Please try on latest drm-tip, try with different resolution and please share logs.
I pulled drm-tip again, applied the patch and recompiled. Here's the new log: audio-debug_3_.log
I cycled through the available display resolutions, starting low and going higher. There are a couple where the distortion is noticeably less, there is no clear pattern unfortunately. Even when the distortion is less the audio quality is far from what I would consider decent, and again there is only audio from front left.
Required Audio BW: 24576000 Available Blank BW: 28800000 Max freq Supported: 96000 Max channel supported: 8
could not find below log line in your attached debug log file,
pr_err("\n\ni915_debug %s: \nsad_count: %d \nmask= %x crtc_state->audio.max_freq: %d\nsink supported channels: %d crtc_state->audio.max_channel: %d \nShould prune this SAD ?? :: %s \nsad[%d][0]: %d sad[%d][1]: %d \n", func, drm_eld_sad_count(eld), mask, crtc_state->audio.max_frequency, sad_to_channels(temp_sad), crtc_state->audio.max_channel, crtc_state->audio.max_channel <= sad_to_channels(temp_sad)? "yes":"not applicable, as sink support is already lesser", index, temp_sad[0] & 0x7, index,temp_sad[1] & 0xf);
As above log help to check supported sink rate and supported channel by sink. Can you please help and check if we get this log by increasing log level ?
Possibly related: It is not possible to use pavucontrol advanced settings to enable the E-AC3 format for the tv (even though it is listed as supported). I can click the checkbox but pactl shows that the setting is not being applied and after restarting pavucontrol this is also reflected there. The settings for AC3 and other formats do work, but when using passthrough still no sound is produced. E-AC3 can be enabled as a supported format on the other sinks.
If I put this audio-splitter that I mentioned earlier back between the computer and the tv all audio works as it should. The ELD info changes to:
Note that E-AC3 is no longer listed as a supported format, and DTS is added. This makes sense since the audio-splitter has an optical output which of course only supports PCM, AC3 and DTS. This reduces the maximum number of channels from 8 to 6. Other differences are: higher rates (88200 to 192000) and bit depth (24) are allowed and support_ai (whatever that means) is now enabled.
@kaivehmanenintel@mgolani I suspect one of these differences is the reason why it works with audio-splitter but not without. Is there anyway I can control or manipulate the ELD info to see which property (if any) is responsible?
We can use method 1 to manually change the SAD (Short Audio Descriptor) bytes in the edid and then overriding the edid but this would be bit gnarly.
Regarding your query of the monitor being connected to a DP port even though you are connecting it to a HDMI port. It seems your device has DP dual mode port(DP++). This should explain the observation as DP in dual mode can output HDMI signals.
[ 2.302493] i915 0000:00:02.0: [drm:intel_bios_init [i915]] Port B VBT info: CRT:0 DVI:1 HDMI:1 DP:1 eDP:0 DSI:0 DP++:1 LSPCON:0 USB-Type-C:0 TBT:0 DSC:0[ 2.302604] i915 0000:00:02.0: [drm:intel_bios_init [i915]] Port B VBT HDMI level shift: 10
However, this means the patch shared by Mitul won't be of much help as it is for native HDMI ports. We are currently working on a similar patch for the DP path. That should be shared with you soon.
In the meantime, please check if the steps above helps. Also, please share the edid file once you retrieve it.
If I force apply the EDID of the splitter audio works as it should, without the splitter actually being connected!
If I connect the splitter again, and then force apply the EDID of the TV (without splitter) the issue comes back.
So the issue is definitely somehow related to the EDID of the TV.
Your patch successfully disables E-AC3 (verified in /proc/asound/card2/eld\#2.0) but unfortunately does not fix the issue. So the issue is most likely not related to E-AC3 and the problem I was having with enabling this is probably a separate issue (maybe in pipewire).
By the way, I also tested this with a laptop (Dynabook Satellite Pro L50-G-188 with i7-10510U iGPU) and found the same problem there. The distortion on front left sounds different though.
@AndrewAmmerlaan Thank you for the feedback. I am trying to find a comparable set up to reproduce the issue. Haven't been successful yet. I will keep looking.
Do you see any difference in parameters between working and non-working scenario?
speaker-test -c2 -twav -Dhw:1,3 -l 10speaker-test 1.2.9Playback device is hw:1,3Stream parameters are 48000Hz, S16_LE, 2 channelsWAV file(s)Rate set to 48000Hz (requested 48000Hz)Buffer size range from 64 to 1048576Period size range from 32 to 524288Using max buffer size 1048576Periods = 4was set period_size = 262144was set buffer_size = 1048576
@kaivehmanenintel Let us know if you see anything unusual in the edid that can cause us some problems.
Do you see any difference in parameters between working and non-working scenario?
Actually, the plot is thickening, the output from speaker-test is identical. And..... I somehow even get the same error:
Without EDID override:
andrew@andrew-gentoo-pc ~ % speaker-test -c2 -twav -Dhw:1,3 -l 10speaker-test 1.2.9Playback device is hw:1,3Stream parameters are 48000Hz, S16_LE, 2 channelsWAV file(s)Rate set to 48000Hz (requested 48000Hz)Buffer size range from 64 to 1048576Period size range from 32 to 524288Using max buffer size 1048576Periods = 4was set period_size = 262144was set buffer_size = 10485760 - Front Left1 - Front RightWrite error: -77,File descriptor in bad statexrun_recovery failed: -77,File descriptor in bad stateTransfer failed: File descriptor in bad state
With EDID override:
andrew@andrew-gentoo-pc ~ % speaker-test -c2 -twav -Dhw:2,3 -l 10speaker-test 1.2.9Playback device is hw:2,3Stream parameters are 48000Hz, S16_LE, 2 channelsWAV file(s)Rate set to 48000Hz (requested 48000Hz)Buffer size range from 64 to 1048576Period size range from 32 to 524288Using max buffer size 1048576Periods = 4was set period_size = 262144was set buffer_size = 10485760 - Front Left1 - Front RightWrite error: -77,File descriptor in bad statexrun_recovery failed: -77,File descriptor in bad stateTransfer failed: File descriptor in bad stateandrew@andrew-gentoo-pc ~ % speaker-test -c2 -twav -Dhw:2,3speaker-test -c2 -twav -Dhdmi:CARD=PCH,DEV=0 -l 10speaker-test 1.2.9Playback device is hdmi:CARD=PCH,DEV=0Stream parameters are 48000Hz, S16_LE, 2 channelsWAV file(s)Rate set to 48000Hz (requested 48000Hz)Buffer size range from 64 to 1048576Period size range from 32 to 524288Using max buffer size 1048576Periods = 4was set period_size = 262144was set buffer_size = 10485760 - Front Left1 - Front RightWrite error: -77,File descriptor in bad statexrun_recovery failed: -77,File descriptor in bad stateTransfer failed: File descriptor in bad state
And with speaker-test there is again no front right (front left sounds fine though, no distortion). Yet somehow if I use the KDE Plasma speaker testing utility (which was the one I was using before) everything works just fine (provided I override the EDID). I can also play regular audio to the TV just fine if I override the EDID.
Yet somehow speaker-test still throws this error. Speaker-test must be doing something slightly different then the KDE Plasma speaker testing utility, though they sound the same. Overriding the EDID "fixes" things in the sense that it works for regular desktop things, but speaker-test exposes that there is still some underlying problem. Could it be that speaker-test somehow ignores the EDID override?
I am trying to find a comparable set up to reproduce the issue. Haven't been successful yet.
Maybe using the "broken" EDID on some similar display is enough to break the audio? I have the same issue with 9th gen iGPU, 10th gen iGPU and DG2 so I suspect the model of (i)GPU is not a factor.
I've been playing with this for a bit and I can somehow make this work with the --buffer option:
andrew@andrew-gentoo-pc ~ % speaker-test -c2 -twav -Dhw:2,3 -l10 -b0speaker-test 1.2.9Playback device is hw:2,3Stream parameters are 48000Hz, S16_LE, 2 channelsWAV file(s)Rate set to 48000Hz (requested 48000Hz)Buffer size range from 64 to 1048576Period size range from 32 to 524288Using max buffer size 1048576Periods = 4was set period_size = 262144was set buffer_size = 10485760 - Front Left1 - Front RightWrite error: -77,File descriptor in bad statexrun_recovery failed: -77,File descriptor in bad stateTransfer failed: File descriptor in bad stateandrew@andrew-gentoo-pc ~ % speaker-test -c2 -twav -Dhw:2,3 -l10 -b1speaker-test 1.2.9Playback device is hw:2,3Stream parameters are 48000Hz, S16_LE, 2 channelsWAV file(s)Rate set to 48000Hz (requested 48000Hz)Buffer size range from 64 to 1048576Period size range from 32 to 524288Requested buffer time 1 usPeriods = 4was set period_size = 32was set buffer_size = 640 - Front Left1 - Front RightTime per period = 3.4982920 - Front Left1 - Front RightTime per period = 3.9095440 - Front Left1 - Front RightTime per period = 3.2954540 - Front Left1 - Front RightTime per period = 3.4307370 - Front LeftWrite error: -32,Broken pipe1 - Front RightTime per period = 3.8582790 - Front Left1 - Front RightTime per period = 3.4989500 - Front Left1 - Front RightWrite error: -32,Broken pipeTime per period = 3.6785460 - Front Left1 - Front RightTime per period = 3.5454870 - Front Left1 - Front RightTime per period = 3.5917260 - Front Left1 - Front RightTime per period = 3.460506
Even a value as tiny as 1us is enough to 'fix' the problem, however with tiny values there is some weird noise when it switches from front left to front right, this goes away for values higher then 10ms (with EDID override).
If I don't override the EDID I can still get rid of the error with -b1. However this weird switching noise I mentioned is worse, again values above 10ms make this weird noise go away. "Normal" desktop audio is still messed up if I don't override the EDID.
@ckborah@kaivehmanenintel I think the root of my problem here is a too small buffer. That it works with the EDID override is still a bit confusing to me, maybe the other EDID somehow makes pipewire/alsa/kernel use a larger buffer size? Is there any information on buffers in the EDID?
[EDIT] Now it becomes even more interesting. Note that if I don't specify the --buffer parameter or set it to zero, I get:
Using max buffer size 1048576
Now if I explicitly set the buffer size to the value speaker-test claims it is using:
andrew@andrew-gentoo-pc ~ % speaker-test -c2 -twav -Dhw:1,3 -l1 -b1048576speaker-test 1.2.9Playback device is hw:1,3Stream parameters are 48000Hz, S16_LE, 2 channelsWAV file(s)Rate set to 48000Hz (requested 48000Hz)Buffer size range from 64 to 1048576Period size range from 32 to 524288Requested buffer time 1000000 usPeriods = 4was set period_size = 12000was set buffer_size = 480000 - Front Left1 - Front RightTime per period = 2.250610
Note that now we have Requested buffer time 1000000 us which is less then what I set it to on the command line (what it was claiming to be the maximum).
Even if I set the buffer to 1000001 speaker-test actually tells me it is using 1000000. So clearly 1000000 is the maximum! Yet, if I don't specify this parameter speaker-test uses a larger value (1048576). So probably the problem is that the buffer is too large, not too small. And that something somewhere is using a buffer larger then the maximum if it is not explicitly told to use a different size.
Explicitly setting --period to values lower then 740031 also makes the Write error: -77 go away:
andrew@andrew-gentoo-pc ~ % speaker-test -c2 -twav -Dplughw:CARD=PCH,DEV=3 -l1 -p 740031speaker-test 1.2.9Playback device is plughw:CARD=PCH,DEV=3Stream parameters are 48000Hz, S16_LE, 2 channelsWAV file(s)Rate set to 48000Hz (requested 48000Hz)Buffer size range from 64 to 1048576Period size range from 32 to 524288Requested period time 740031 usPeriods = 4was set period_size = 35522was set buffer_size = 1420880 - Front Left1 - Front RightWrite error: -77,File descriptor in bad statexrun_recovery failed: -77,File descriptor in bad stateTransfer failed: File descriptor in bad stateandrew@andrew-gentoo-pc ~ % speaker-test -c2 -twav -Dplughw:CARD=PCH,DEV=3 -l1 -p 740030speaker-test 1.2.9Playback device is plughw:CARD=PCH,DEV=3Stream parameters are 48000Hz, S16_LE, 2 channelsWAV file(s)Rate set to 48000Hz (requested 48000Hz)Buffer size range from 64 to 1048576Period size range from 32 to 524288Requested period time 740030 usPeriods = 4was set period_size = 35521was set buffer_size = 1420840 - Front Left1 - Front RightTime per period = 0.743841
Maybe using the "broken" EDID on some similar display is enough to break the audio? I have the same issue with 9th gen iGPU, 10th gen iGPU and DG2 so I suspect the model of (i)GPU is not a factor.
That is the idea, I haven't found a similar display yet. I will keep you updated.
Note that now we have Requested buffer time 1000000 us which is less then what I set it to on the command line (what it was claiming to be the maximum).
Important to distinguish here between buffer time and buffer size.
Using max buffer size 1048576
Requested buffer time 1000000 us
I tried reproducing this issue in some monitors and a tv that we have.
I can never reproduce the original issue.
Write error: -77,File descriptor in bad statexrun_recovery failed: -77,File descriptor in bad stateTransfer failed: File descriptor in bad state
However, with the default parameters[1], parts of the audio prompt are muted. Mostly the word "Front".
I am not sure if the issues are related. However, the parameters for which @AndrewAmmerlaan's problem gets healed also seem to work on the problem I find.
@kaivehmanenintel Your inputs?
@ckborah as you pointed out I got the units confused here. According to @perexg over at the alsa-utils github a maximum buffer size of 1048576 means a maximum buffer time of 1048576 / 48000 seconds. After applying the patch I can successfully set this buffer time, and as expected this makes speaker-test error out again:
andrew@andrew-gentoo-pc alsa-utils % speaker-test -c2 -twav -Dplughw:CARD=PCH,DEV=7 --buffer 21845333speaker-test 1.2.9Playback device is plughw:CARD=PCH,DEV=7Stream parameters are 48000Hz, S16_LE, 2 channelsWAV file(s)Rate set to 48000Hz (requested 48000Hz)Buffer size range from 64 to 1048576Period size range from 32 to 524288Requested buffer time 21845333 usPeriods = 4was set period_size = 262144was set buffer_size = 10485760 - Front Left1 - Front RightWrite error: -77,File descriptor in bad statexrun_recovery failed: -77,File descriptor in bad stateTransfer failed: File descriptor in bad state
Using trial and error I have determined that the maximum buffer time for which speaker-test works is 2960093 us:
andrew@andrew-gentoo-pc alsa-utils % speaker-test -c2 -twav -Dplughw:CARD=PCH,DEV=7 --buffer 2960093speaker-test 1.2.9Playback device is plughw:CARD=PCH,DEV=7Stream parameters are 48000Hz, S16_LE, 2 channelsWAV file(s)Rate set to 48000Hz (requested 48000Hz)Buffer size range from 64 to 1048576Period size range from 32 to 524288Requested buffer time 2960093 usPeriods = 4was set period_size = 35521was set buffer_size = 1420840 - Front Left1 - Front RightTime per period = 0.743704
If the buffer time is 1 us larger, speaker-test fails with error -77 again:
andrew@andrew-gentoo-pc alsa-utils % speaker-test -c2 -twav -Dplughw:CARD=PCH,DEV=7 --buffer 2960094speaker-test 1.2.9Playback device is plughw:CARD=PCH,DEV=7Stream parameters are 48000Hz, S16_LE, 2 channelsWAV file(s)Rate set to 48000Hz (requested 48000Hz)Buffer size range from 64 to 1048576Period size range from 32 to 524288Requested buffer time 2960094 usPeriods = 4was set period_size = 28417was set buffer_size = 1420850 - Front Left1 - Front RightWrite error: -77,File descriptor in bad statexrun_recovery failed: -77,File descriptor in bad stateTransfer failed: File descriptor in bad state
As I understand it, the maximum buffer size (1048576) is communicated by the driver. What I would like to try is to instruct/patch the driver to communicate a lower maximum buffer size to see if this fixes my issue without overriding the TV's EDID. But I'm not sure how to do this, could you give me some pointers?
[EDIT] According to this article, on Windows 10+ the driver is also responsible for communicating the buffer constraints. I would be curious to know what these constraints are for the Intel driver on Windows, perhaps these are different on the different platforms, and this might be the root cause of why audio playback works fine for me on Windows but fails on Linux.
Gentle ping, I still have to apply this drm.edid_firmware workaround/hack to get working HDMI audio to my TV. Without it I still run into this buffer issue/Write error: -77 which causes audio to be garbled. Would love to help debug further, but I'm not sure how to continue from here.
I compared the edids again and it doesn't help that the edid that is working for you adds things (like higher sampling rates). So there is nothing in the TVs edid that we can try removing. I will try looking in other directions.
In the mean time, @kaivehmanenintel anything we can do here from audio driver's perspective? What really causes the error code -77 (EBADFD)?
@mgolani May be we can share a patch to check what is happening with the bandwidth?
Quick update: The issue is also present when using the Xe kernel driver instead of the i915 kernel driver. I unfortunately do not have a non-intel machine lying around to test if this issue is also present when using the amdgpu or nouveau/nvidia kernel drivers.